Skip to content

Commit

Permalink
Allow both service_worker and scripts in MV3
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Apr 27, 2024
1 parent b8f7f90 commit 9b9ea91
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Expand Up @@ -4,7 +4,9 @@
"version": "0.1",
"manifest_version": 3,
"background": {
"service_worker": "background.js"
"service_worker": "background.js",
"type": "module",
"scripts": [ "background.js" ]
},
"permissions": [
"scripting",
Expand Down
1 change: 1 addition & 0 deletions packages/core/integration-tests/test/webextension.js
Expand Up @@ -111,6 +111,7 @@ describe('webextension', function () {
assets: ['manifest.json'],
},
{assets: ['background.js']},
{assets: ['background.js']},
{assets: ['popup.html']},
{assets: ['popup.css']},
{assets: ['popup.js', 'esmodule-helpers.js', 'bundle-url.js']},
Expand Down
1 change: 1 addition & 0 deletions packages/transformers/webextension/src/schema.js
Expand Up @@ -469,6 +469,7 @@ export const MV3Schema = ({
type: 'object',
properties: {
service_worker: string,
scripts: arrStr, // to support both Chrome and Firefox
type: {
type: 'string',
enum: ['classic', 'module'],
Expand Down

0 comments on commit 9b9ea91

Please sign in to comment.