-
Notifications
You must be signed in to change notification settings - Fork 88
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
Transition to Manifest v3 #350
Comments
Ok, I took a look at this issue and made my own fork with some changes, & it's really unfortunate that it seems MV3 doesn't have exactly suitable replacements for everything. Still need:
|
Thanks for getting this started, @funblaster22. Google has a page about migrating from background pages to service workers: https://developer.chrome.com/docs/extensions/mv3/migrating_to_service_workers/ The following are things that need to happen:
0 -> service worker A (SWA) starts |
I believe the above setup will work correctly in the Chrome Manifest v3 world because no given service worker will live longer than 1 minute, and Tab Wrangler can still poll roughly every 5 seconds like it does now. |
A contact on the Chrome Extensions dev relations team reached out and suggested using a heartbeat to keep the extensions existing background page alive after switching to Manifest v3. Code example from the contact: https://gist.github.com/patrickkettner/ab2e0f3a6341d41d9dbe81d42dfb04c4 async function runHeartbeat() {
await chrome.storage.local.set({ "last-heartbeat": new Date().getTime() });
}
// Run the heartbeat once at service worker startup.
runHeartbeat().then(() => {
// Then again every 20 seconds.
setInterval(runHeartbeat, 20 * 1000);
});
/**
* Returns the last heartbeat stored in extension storage, or undefined if
* the heartbeat has never run before.
*/
async function getLastHeartbeat() {
return (await chrome.storage.local.get("last-heartbeat"))["last-heartbeat"];
} They also linked to a relevant discussion in the chromimum-extensions Google Group: https://groups.google.com/a/chromium.org/g/chromium-extensions/c/hWEe4I93P_E/m/BfLasiaPAQAJ?utm_medium=email&utm_source=footer |
What functionality will be lost after the upgrade? |
@ofek As far as I know right now, no functionality will be lost. Thanks to the tip from the Chrome Extensions team, checking for stale tabs can work as it does right now. The most significant changes from Manifest v2 -> v3 are in functionality that Tab Wrangler does not use. Tab Wrangler v7.0.0 will work on Manifest v3, and any user-facing changes will be documented in the release notes. |
Firefox's implementation of Manifest v3 supports [background scripts][0], not service workers like Chrome's. Build manifest.json separately for Chrome and for Firefox to support both implementations. * Wait 1s after activating to mark tab as fresh (new setting default) * Split popup JS using async imports and React Suspense * Require [dot-notation][1] via ESLint Addresses #350 [0]: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Background_scripts [1]: https://eslint.org/docs/latest/rules/dot-notation
Google Chrome is transitioning to Manifest V3, and Tab Wrangler needs to follow along. Tab Wrangler will be allowed to update on V2 through January 2023, but this transition would ideally happen well in advance of that to ensure operation continues uninterrupted.
The text was updated successfully, but these errors were encountered: