Skip to content

Commit

Permalink
feat: upgrade to Manifest V3 in Edge and Opera
Browse files Browse the repository at this point in the history
  • Loading branch information
dessant committed Jun 7, 2024
1 parent cb6af14 commit 292d584
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const isProduction = process.env.NODE_ENV === 'production';
const enableContributions =
(process.env.ENABLE_CONTRIBUTIONS || 'true') === 'true';

const mv3 = ['chrome'].includes(targetEnv);
const mv3 = ['chrome', 'edge', 'opera'].includes(targetEnv);

const distDir = path.join(__dirname, 'dist', targetEnv);

Expand Down
17 changes: 10 additions & 7 deletions src/assets/manifest/edge.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"manifest_version": 2,
"manifest_version": 3,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "0.1.0",
Expand All @@ -18,11 +18,15 @@
"activeTab",
"notifications",
"webRequest",
"webRequestBlocking",
"<all_urls>"
"declarativeNetRequest",
"scripting"
],

"content_security_policy": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src * data:; connect-src *; object-src 'none'; media-src 'none'; child-src 'none'; form-action 'none';",
"host_permissions": ["<all_urls>"],

"content_security_policy": {
"extension_pages": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src * data:; connect-src *; object-src 'none'; media-src 'none'; child-src 'none'; form-action 'none';"
},

"icons": {
"16": "src/assets/icons/app/icon-16.png",
Expand All @@ -36,7 +40,7 @@
"128": "src/assets/icons/app/icon-128.png"
},

"browser_action": {
"action": {
"default_icon": {
"16": "src/assets/icons/app/icon-16.png",
"19": "src/assets/icons/app/icon-19.png",
Expand All @@ -52,12 +56,11 @@

"options_ui": {
"page": "src/options/index.html",
"chrome_style": false,
"open_in_tab": true
},

"background": {
"page": "src/background/index.html"
"service_worker": "src/background/script.js"
},

"content_scripts": [
Expand Down
17 changes: 10 additions & 7 deletions src/assets/manifest/opera.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"manifest_version": 2,
"manifest_version": 3,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "0.1.0",
Expand All @@ -18,11 +18,15 @@
"activeTab",
"notifications",
"webRequest",
"webRequestBlocking",
"<all_urls>"
"declarativeNetRequest",
"scripting"
],

"content_security_policy": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src * data:; connect-src *; object-src 'none'; media-src 'none'; child-src 'none'; form-action 'none';",
"host_permissions": ["<all_urls>"],

"content_security_policy": {
"extension_pages": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src * data:; connect-src *; object-src 'none'; media-src 'none'; child-src 'none'; form-action 'none';"
},

"icons": {
"16": "src/assets/icons/app/icon-16.png",
Expand All @@ -36,7 +40,7 @@
"128": "src/assets/icons/app/icon-128.png"
},

"browser_action": {
"action": {
"default_icon": {
"16": "src/assets/icons/app/icon-16.png",
"19": "src/assets/icons/app/icon-19.png",
Expand All @@ -52,12 +56,11 @@

"options_ui": {
"page": "src/options/index.html",
"chrome_style": false,
"open_in_tab": true
},

"background": {
"page": "src/background/index.html"
"service_worker": "src/background/script.js"
},

"content_scripts": [
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const isProduction = process.env.NODE_ENV === 'production';
const enableContributions =
(process.env.ENABLE_CONTRIBUTIONS || 'true') === 'true';

const mv3 = ['chrome'].includes(targetEnv);
const mv3 = ['chrome', 'edge', 'opera'].includes(targetEnv);

const provideExtApi = !['firefox', 'safari'].includes(targetEnv);

Expand Down

0 comments on commit 292d584

Please sign in to comment.