Skip to content

Conversation

@bakulf
Copy link
Collaborator

@bakulf bakulf commented Dec 2, 2025

This patch is a starting point to migrate this add-on to manifest v3.

@bakulf bakulf force-pushed the v3 branch 5 times, most recently from 9ec9eaf to c315a89 Compare December 3, 2025 07:11
Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

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

Very early feedback based on the diff only. I did not check whether there may be other issues.

A significant difference between the pre-patch behavior and the patch is that the background page is now non-persistent; that means that the background page may suspend after a (short) period of inactivity. If the extension relies on global variables or a specific order of execution, or does "one-time" initialization when some of the background scripts execute, then the switch to MV3 may cause regressions. This is not uniquely MV2 vs MV3, in MV2 non-persistent background pages also exist (opt in via "persistent": false in the background object), but it is still a new change introduced in this PR.

It is also worth noting that host permissions were not automatically granted on install in MV3 until Firefox 128. This is significant for ESR115 users: Existing users will retain the permissions, but new users will not have any host permissions.

@@ -0,0 +1,14 @@
diff --git a/node_modules/webextensions-jsdom/src/nyc.js b/node_modules/webextensions-jsdom/src/nyc.js
index 4ce55b5..909b822 100644
--- a/node_modules/webextensions-jsdom/src/nyc.js
Copy link
Member

Choose a reason for hiding this comment

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

The relation between this change and the purpose of the PR is unclear. Could you elaborate? In this case it looks like a test-only issue which is not that concerning, but generally extensions should use third-party libraries in unmodified form.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In order to validate the manifest v3, I had to update all the dependencies. The latest webextension-jsdom package is unable to create the cache/testing folder and that introduces an intermittent failure in our tests.
As you see, I had to convert a mkdirp method from async to sync to be sure the folder exists before continuing with the rest of the tests.

@bakulf
Copy link
Collaborator Author

bakulf commented Dec 4, 2025

Thank you Rob!

I did a bit of testing and the code does have almost 0 states. The only one I spot so far is related to the isolation key and the 3rd commit is about that bit.

It is also worth noting that host permissions were not automatically granted on install in MV3 until Firefox 128. This is significant for ESR115 users: Existing users will retain the permissions, but new users will not have any host permissions.

This is what I'm mostly concern about: the backward compatibility of this change.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants