Skip to content

Firefox support via shared manifest#43

Open
caezium wants to merge 1 commit into
zarazhangrui:mainfrom
caezium:main
Open

Firefox support via shared manifest#43
caezium wants to merge 1 commit into
zarazhangrui:mainfrom
caezium:main

Conversation

@caezium

@caezium caezium commented Apr 28, 2026

Copy link
Copy Markdown

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 aliases chrome.*
to browser.*, so the only real divergences are URL schemes and the
manifest. Three small changes are enough.

Changes (32 lines, 3 files)

manifest.json — make the same manifest load in both browsers:

  • Add background.scripts: ["background.js"] next to service_worker. Chrome MV3 uses service_worker; Firefox MV3 uses scripts as an event-page entry. Both keys coexist.
  • Add browser_specific_settings.gecko with extension id and strict_min_version: "121.0" (the Firefox version that ships MV3 + the APIs used here).

app.js — three URL-handling sites:

  • Replace hardcoded `chrome-extension://${id}/index.html` with chrome.runtime.getURL('index.html'). That returns chrome-extension://... in Chrome and moz-extension://... in Firefox, so Tab Out's own pages are detected correctly in both.
  • When matching the empty new-tab page, accept chrome://newtab/ (Chrome), about:newtab (Firefox), and about:home (Firefox alternate).
  • In getRealTabs(), also exclude moz-extension:// and resource:// so Firefox internals don't show up in the grid.

background.js — apply the same moz-extension:// and resource:// filters in the badge counter, so the badge doesn't inflate by 1 on every Tab Out tab when running in Firefox.

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.
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.

Add Firefox Support

1 participant