From 8446cc50be8bad2ab1a17fd075250651c3f294c3 Mon Sep 17 00:00:00 2001 From: metoule Date: Thu, 23 May 2024 21:44:36 +0200 Subject: [PATCH] Migrate manifest --- .gitignore | 3 ++- .prettierrc.cjs | 4 ++++ manifest.json | 47 ++++++++++++++++----------------------- scripts/service_worker.js | 2 ++ 4 files changed, 27 insertions(+), 29 deletions(-) create mode 100644 .prettierrc.cjs create mode 100644 scripts/service_worker.js diff --git a/.gitignore b/.gitignore index cfd95af..896c87d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ syntax:glob *.zip .project .settings -.vs \ No newline at end of file +.vs +node_modules \ No newline at end of file diff --git a/.prettierrc.cjs b/.prettierrc.cjs new file mode 100644 index 0000000..d983f88 --- /dev/null +++ b/.prettierrc.cjs @@ -0,0 +1,4 @@ +const config = { + "tabWidth": 2, + "useTabs": false +} diff --git a/manifest.json b/manifest.json index df36fc8..924f099 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "manifest_version": 2, + "manifest_version": 3, "version": "0.0.0.1", "name": "__MSG_extName__", "short_name": "__MSG_extShortName__", @@ -10,41 +10,32 @@ "48": "imgs/icons/deezer_48x48.png", "128": "imgs/icons/deezer_128x128.png" }, - "browser_action": { + "action": { "default_icon": "imgs/icons/deezer_19x19.png", - "default_title": "__MSG_defaultTitle__" + "default_title": "__MSG_defaultTitle__", + "default_popup": "popup.html" }, "background": { - "scripts": [ - "scripts/localstorage.js", - "scripts/notifications.js", - "scripts/background.js" - ], - "persistent": false + "service_worker": "scripts/service_worker.js", + "type": "module" }, "options_page": "options.html", "content_scripts": [ { - "matches": [ - "*://*.deezer.com/*" - ], - "js": [ - "scripts/player_listener.js", - "scripts/deezer/bootstrap.js" - ] + "matches": ["*://*.deezer.com/*"], + "js": ["scripts/player_listener.js", "scripts/deezer/bootstrap.js"] } ], - "permissions": [ - "*://*.deezer.com/*", - "notifications", - "tabs", - "webNavigation" - ], - "content_security_policy": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' https://e-cdns-images.dzcdn.net/images/;", - "optional_permissions": [ - "" - ], + "permissions": ["notifications", "tabs", "webNavigation"], + "host_permissions": ["*://*.deezer.com/*"], + "optional_host_permissions": ["*://*/*"], + "content_security_policy": { + "extension_pages": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' https://e-cdns-images.dzcdn.net/images/;" + }, "web_accessible_resources": [ - "scripts/deezer/player_observer.js" + { + "resources": ["scripts/deezer/player_observer.js"], + "matches": ["*://*.deezer.com/*"] + } ] -} \ No newline at end of file +} diff --git a/scripts/service_worker.js b/scripts/service_worker.js new file mode 100644 index 0000000..3168266 --- /dev/null +++ b/scripts/service_worker.js @@ -0,0 +1,2 @@ + +console.log('service worker loaded'); \ No newline at end of file