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 3, 2024
1 parent 290dfba commit f3e09bf
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 38 deletions.
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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
46 changes: 28 additions & 18 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 @@ -13,13 +13,18 @@
"storage",
"notifications",
"webRequest",
"webRequestBlocking",
"declarativeNetRequest",
"webNavigation",
"nativeMessaging",
"<all_urls>"
"offscreen",
"scripting"
],

"content_security_policy": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src * data:; connect-src *; object-src 'none'; frame-ancestors http://127.0.0.1:*;",
"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'; frame-ancestors http://127.0.0.1:*;"
},

"icons": {
"16": "src/assets/icons/app/icon-16.png",
Expand All @@ -33,7 +38,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 @@ -47,6 +52,15 @@
}
},

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

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

"content_scripts": [
{
"matches": [
Expand All @@ -71,20 +85,16 @@
}
],

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

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

"web_accessible_resources": [
"src/setup/index.html",
"src/scripts/reset.js",
"src/base/solver-button.css"
{
"resources": [
"src/setup/index.html",
"src/scripts/reset.js",
"src/base/solver-button.css"
],
"matches": ["http://*/*", "https://*/*"],
"use_dynamic_url": true
}
],

"incognito": "split"
Expand Down
46 changes: 28 additions & 18 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 @@ -13,13 +13,18 @@
"storage",
"notifications",
"webRequest",
"webRequestBlocking",
"declarativeNetRequest",
"webNavigation",
"nativeMessaging",
"<all_urls>"
"offscreen",
"scripting"
],

"content_security_policy": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src * data:; connect-src *; object-src 'none'; frame-ancestors http://127.0.0.1:*;",
"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'; frame-ancestors http://127.0.0.1:*;"
},

"icons": {
"16": "src/assets/icons/app/icon-16.png",
Expand All @@ -33,7 +38,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 @@ -47,6 +52,15 @@
}
},

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

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

"content_scripts": [
{
"matches": [
Expand All @@ -71,20 +85,16 @@
}
],

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

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

"web_accessible_resources": [
"src/setup/index.html",
"src/scripts/reset.js",
"src/base/solver-button.css"
{
"resources": [
"src/setup/index.html",
"src/scripts/reset.js",
"src/base/solver-button.css"
],
"matches": ["http://*/*", "https://*/*"],
"use_dynamic_url": true
}
],

"incognito": "split"
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 f3e09bf

Please sign in to comment.