Firefox support via shared manifest#43
Open
caezium wants to merge 1 commit into
Open
Conversation
Make the extension load and behave correctly in Firefox without forking the codebase. Adds gecko settings + an event-page background entry to the manifest, and teaches the URL-handling code about moz-extension://, about:newtab, about:home, and resource:// so badge counts and Tab Out self-detection stay accurate.
pintaste
added a commit
to pintaste/tab-out
that referenced
this pull request
May 16, 2026
Use chrome.runtime.getURL() instead of hardcoded chrome-extension:// prefix. Add moz-extension:// and resource:// to internal URL filters. Recognise about:newtab and about:home as Tab Out pages. Manifest: add browser_specific_settings.gecko and scripts fallback for Firefox compatibility. Adapted from upstream PR zarazhangrui#43 by caezium.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #11
Adds Firefox support without forking the codebase. The extension already
uses the WebExtension API surface (
chrome.tabs,chrome.storage,chrome.action,chrome_url_overrides) and Firefox aliaseschrome.*to
browser.*, so the only real divergences are URL schemes and themanifest. Three small changes are enough.
Changes (32 lines, 3 files)
manifest.json— make the same manifest load in both browsers:background.scripts: ["background.js"]next toservice_worker. Chrome MV3 usesservice_worker; Firefox MV3 usesscriptsas an event-page entry. Both keys coexist.browser_specific_settings.geckowith extensionidandstrict_min_version: "121.0"(the Firefox version that ships MV3 + the APIs used here).app.js— three URL-handling sites:`chrome-extension://${id}/index.html`withchrome.runtime.getURL('index.html'). That returnschrome-extension://...in Chrome andmoz-extension://...in Firefox, so Tab Out's own pages are detected correctly in both.chrome://newtab/(Chrome),about:newtab(Firefox), andabout:home(Firefox alternate).getRealTabs(), also excludemoz-extension://andresource://so Firefox internals don't show up in the grid.background.js— apply the samemoz-extension://andresource://filters in the badge counter, so the badge doesn't inflate by 1 on every Tab Out tab when running in Firefox.