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

Support Manifest v3 #2909

Open
piroor opened this issue May 27, 2021 · 14 comments
Open

Support Manifest v3 #2909

piroor opened this issue May 27, 2021 · 14 comments

Comments

@piroor
Copy link
Owner

piroor commented May 27, 2021

Mozilla announced that the background page is deprecated and we need to migrate to service workers on manifest v3.
https://blog.mozilla.org/addons/2021/05/27/manifest-v3-update/

There are some information to migrate background page to service workers:

@irvinm
Copy link
Contributor

irvinm commented May 27, 2021

I understand their rationale for wanting to do this, but I would imagine the requirement to migrate from background pages to services workers will likely break addons that haven't been updated for a long time. That is unfortunate. I guess we will know more when they update us on that specific portion of the change.

Background pages will be replaced by background service workers (bug 1578286). This is a substantial change and will continue to be developed over the next few months. We will make a new announcement once we have something that can be tested in Nightly.

@piroor
Copy link
Owner Author

piroor commented May 27, 2021

Currently TST's functionality looks impossible to be migrated to service workers. My comment at bugzilla.mozilla.org: https://bugzilla.mozilla.org/show_bug.cgi?id=1578286#c5

@irvinm
Copy link
Contributor

irvinm commented May 27, 2021

@piroor other than the 2 points you mentioned are you aware of any other challenges with the basic functionality at least working? It will be interesting to see how they reply to you and what other feedback they get with this transition.

@piroor
Copy link
Owner Author

piroor commented Jun 1, 2021

There maybe some more possible incompatibilities. Until the manifest v2 become unsupported, I'll need to do more efforts...

@irvinm
Copy link
Contributor

irvinm commented Jun 12, 2021

@piroor I think the good thing is that they have said they plan on supporting manifest v2 for at least a year AFTER manifest v3 lands. So there will be some time especially considering I think v3 won't land for several months.

@irvinm
Copy link
Contributor

irvinm commented Oct 5, 2021

Chrome transition dates seem to be agreed upon: (September 23, 2021) https://developer.chrome.com/blog/mv2-transition/

  • January 17, 2022: New Manifest V2 extensions will no longer be accepted by the Chrome Web Store. Developers may still push updates to existing Manifest V2 extensions, but no new Manifest V2 items may be submitted.

  • January 2023: The Chrome browser will no longer run Manifest V2 extensions. Developers may no longer push updates to existing Manifest V2 extensions.

I haven't been able to find anything more recent about Firefox's plan, scope, and dates other than what we were given in May 2021.

@irvinm
Copy link
Contributor

irvinm commented Nov 17, 2021

Kind of an interesting comment at the last WECG Meeting on Nov 11: (Meeting Minutes)

Meeting notes

  • [alexei] Google has given a timeline, with the appearance that MV3 is stable. The community response has been largely negative. Wonderful that Devlin can join us. Would like to have a discussion to discuss the trade-offs and whether they make sense.

If you look over the meeting minutes, there appears to still be a lot of questions about how the different browsers are going to handle different aspects of Manifest v3. I'm glad to see the WECG are concerned how Google are moving forward without agreement across the community. It will be interesting to see what Devlin (from Google) will say at the December 9th meeting.

@irvinm
Copy link
Contributor

irvinm commented May 18, 2022

A new update today: https://blog.mozilla.org/addons/2022/05/18/manifest-v3-in-firefox-recap-next-steps/

Some important parts:

In MV3, we’re introducing a new architecture: the background script must be designed to be restartable. To support this, we’ve reworked existing and introduced new APIs, enabling extensions to declare how the browser should behave without requiring the background script.

In launching our Developer Preview program for Manifest v3, our hope is that authors will test out our MV3 implementation to help us identify gaps or incompatibilities in our implementation. Work is continuing in parallel, and we expect to launch MV3 support for all users by the end of 2022. As we get closer to completion, we will follow up with more detail on timing and how we will support extensions through the transition.

@irvinm
Copy link
Contributor

irvinm commented May 18, 2022

@pixiekat
Copy link

I'm glad to see the WECG are concerned how Google are moving forward without agreement across the community.

Good glimpse into the future of how Google/Blink will act with a full on browser monopoly.

@irvinm
Copy link
Contributor

irvinm commented Nov 1, 2022

@Fanolian
Copy link

@irvinm
Copy link
Contributor

irvinm commented Mar 14, 2024

Another Mozilla blog post on MV2 & MV3 from March 13, 2024: https://blog.mozilla.org/addons/2024/03/13/manifest-v3-manifest-v2-march-2024-update/

Nothing drastic other them reiterating there will still be at least 1 year transition if\when they ever decide to deprecate MV2 for Firefox. They also mention Google's intent to start the MV2 deprecation timeline for Chrome again.

@piroor
Copy link
Owner Author

piroor commented Mar 15, 2024

While TST 4.0 development I tried to think how to implement TST with short-live (unpersistent) background page.

  • When the sidebar UI is invisible
    • Tab changes would be handled with tabs.onXXX events but they would be delayed if the background script is unloaded.
    • On the initial startup, the script fetches all tabs via tabs.query(), and loads previous status via sessions.getTabValue().
      The script constructs status of tabs and saves it to the session storage via storage.session.set() as a RAM cache.
      And after a while Firefox will unload the script (to save the RAM).
    • When tab events (tabs.onCreated, tabs.onRemoved, tabs.onMoved and so on) are notified to the addon, the script is loaded again.
      On this case the script just loads cached status via storage.session.get() instead of constructing status from live information got via tabs.query() and sessions.getTabValue().
      The script handles the notified event and updates Firefox's native tabs.
      (E.g. the script may move the tab to next to the active tab based on the tree information.)
      And the script also updates the cached status in parallel.
      Before the script is unloaded, the script saves the updated cached status to the session storage via storage.session.set().
  • When the sidebar UI is visible
    • Tab changes would be handled with tabs.onXXX events without delay by the sidebar script.
      The script handles the notified event and updates Firefox's native tabs.
      (E.g. the script may move the tab to next to the active tab based on the tree information.)
      And the script also saves the result as a cached status (which is constructed by the background script) in parallel.
    • The background script does nothing in this case, to avoid conflicting of changes by both the background script and the sidebar script.

We need to measure performance of these processes, especially the overhead of saving/loading cached status.

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

No branches or pull requests

4 participants