Skip to content

Commit

Permalink
fix: firefox bgsw parsing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgv committed Jun 29, 2023
1 parent a2c37cf commit 35acf07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/parcel-transformer-manifest/src/handle-background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ function handleMV3Background(program: MV3Data) {

function handleFirefoxMV3Background(program: MV3Data) {
const mv2Program = program as unknown as MV2Data
mv2Program.background.scripts = [program.background.service_worker]
delete program.background.service_worker
if (program.background?.service_worker) {
mv2Program.background.scripts = [program.background.service_worker]
delete program.background.service_worker
}

handleMV2BackgroundScript(mv2Program)
handleMV3HotCsp(program)
Expand Down

0 comments on commit 35acf07

Please sign in to comment.