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 22, 2024
1 parent 92dd7e0 commit 32549ad
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 26 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
33 changes: 21 additions & 12 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,13 +18,17 @@
"activeTab",
"notifications",
"webRequest",
"webRequestBlocking",
"<all_urls>"
"declarativeNetRequest",
"scripting"
],

"optional_permissions": ["clipboardRead"],

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

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

"icons": {
"16": "src/assets/icons/app/icon-16.png",
Expand All @@ -38,7 +42,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 @@ -54,12 +58,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 All @@ -72,11 +75,17 @@
],

"web_accessible_resources": [
"src/content/style.css",
"src/select/pointer.css",
"src/select/index.html",
"src/capture/index.html",
"src/confirm/index.html"
{
"resources": [
"src/content/style.css",
"src/select/pointer.css",
"src/select/index.html",
"src/capture/index.html",
"src/confirm/index.html"
],
"matches": ["http://*/*", "https://*/*", "file:///*"],
"use_dynamic_url": true
}
],

"incognito": "split"
Expand Down
33 changes: 21 additions & 12 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,13 +18,17 @@
"activeTab",
"notifications",
"webRequest",
"webRequestBlocking",
"<all_urls>"
"declarativeNetRequest",
"scripting"
],

"optional_permissions": ["clipboardRead"],

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

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

"icons": {
"16": "src/assets/icons/app/icon-16.png",
Expand All @@ -38,7 +42,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 @@ -54,12 +58,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 All @@ -72,11 +75,17 @@
],

"web_accessible_resources": [
"src/content/style.css",
"src/select/pointer.css",
"src/select/index.html",
"src/capture/index.html",
"src/confirm/index.html"
{
"resources": [
"src/content/style.css",
"src/select/pointer.css",
"src/select/index.html",
"src/capture/index.html",
"src/confirm/index.html"
],
"matches": ["http://*/*", "https://*/*", "file:///*"],
"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 32549ad

Please sign in to comment.