From 114eccc31893839d533c72a883325e7406dde150 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 26 Jan 2022 14:14:46 -0300 Subject: [PATCH] adapt manifest.json to v3. --- build.js | 3 ++- extension/manifest.json | 15 +++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.js b/build.js index 4456745..8b1d4c4 100755 --- a/build.js +++ b/build.js @@ -25,7 +25,8 @@ esbuild ], sourcemap: prod ? false : 'inline', define: { - global: 'window' + window: 'self', + global: 'self' } }) .then(() => console.log('build success.')) diff --git a/extension/manifest.json b/extension/manifest.json index 262229d..273ef47 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -3,7 +3,7 @@ "description": "Nostr Signer Extension", "version": "1.1.0", "homepage_url": "https://github.com/fiatjaf/nos2x", - "manifest_version": 2, + "manifest_version": 3, "icons": { "16": "icons/16x16.png", "32": "icons/32x32.png", @@ -12,12 +12,9 @@ }, "options_page": "options.html", "background": { - "scripts": [ - "background.build.js" - ], - "persistent": false + "service_worker": "background.build.js" }, - "browser_action": { + "action": { "default_title": "nos2x", "default_popup": "popup.html" }, @@ -30,6 +27,8 @@ "permissions": [ "storage" ], - "web_accessible_resources": ["nostr-provider.js"], - "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self';" + "web_accessible_resources": [{ + "resources": ["nostr-provider.js"], + "matches": ["https://*/*", "http://localhost:*/*"] + }] }