Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNM/WIP: Manifest v3 Migration (Firefox Preview) #416

Closed
wants to merge 1 commit into from

Conversation

maxxcrawford
Copy link
Collaborator

  • WIP - Manifest v3 Migration
  • Update build command to use Firefox Preview

@willdurand
Copy link
Member

You also need to update "web_accessible_resources" in the manifest.json file. Something like that, although you should probably have a more strict set of URL patterns in "matches":

diff --git a/src/manifest.json b/src/manifest.json
index 46f8f99..68c11cd 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -91,12 +91,17 @@
   ],
 
   "web_accessible_resources": [
-    "images/*.svg",
-    "icons/*.svg",
-    "icons/*.png",
-    "fonts/Inter/*.woff2",
-    "fonts/Metropolis/*.woff2",
-    "*.html"
+    {
+      "resources": [
+        "images/*.svg",
+        "icons/*.svg",
+        "icons/*.png",
+        "fonts/Inter/*.woff2",
+        "fonts/Metropolis/*.woff2",
+        "*.html"
+      ],
+      "matches": ["<all_urls>"]
+    }
   ]
 
 }

"background": {
"scripts": ["js/libs/browser-polyfill.min.js", "js/background/background.js", "js/background/context-menu.js"]
"service_worker": "js/background/background.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

service worker isn't enabled on Firefox yet, what you want is an event page

@maxxcrawford
Copy link
Collaborator Author

Closing this PR as it has served its purpose. We can revisit the manifest file when ready to migrate. Adding a few review notes for some code changes that I'm not 100% sure why was made (by me). 😎

Copy link
Collaborator Author

@maxxcrawford maxxcrawford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questions asked. 🤷

@@ -7,7 +7,7 @@ browser.storage.local.set({ relayApiSource: `${RELAY_SITE_ORIGIN}/api/v1` });
browser.runtime.onInstalled.addListener(async (details) => {
const { firstRunShown } = await browser.storage.local.get("firstRunShown");

if (details.reason == "update") {
if (details.reason == "update" || details.reason == "install") {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Why?

Comment on lines +270 to +273
await browser.runtime.sendMessage({
method: "storeRuntimeData",
forceUpdate: true
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants