Note
This project is provided as-is and we are not actively promoting contributions. However, if you wish to contribute to this repository, you will have to sign a Contributor License Agreement (CLA) in order for you PRs to be considered for merging.
- Create a new JSON file
locales/{locale}.json
with the according ISO 639 2-letter language code based on the defaulten.json
. - Import the new JSON file in the
i18n.js
file.
npm install
MANIFEST_VERSION=3 # available: 3, 2
BROWSER_TARGET=chrome # available: chrome, firefox
MANIFEST_HOST_API=*://*.streamfinity.code/*
MANIFEST_HOST_FRONTEND=*://localhost:3000/*
VITE_API_URL=http://streamfinity.code
VITE_FRONTEND_URL=http://localhost:3000
VITE_OAUTH_CLIENT_ID=
Rebuilds extension on file changes. Requires a reload of the extension (and page reload if using content scripts).
npm run dev:firefox
Hot Module Reloading is used to load changes inline without requiring extension rebuilds and extension/page reloads. Currently only works in Chromium based browsers.
npm run dev:chrome
Minifies and optimizes extension build.
Important
You need to explicitly prepend the MANIFEST_VERSION
and BROWSER_TARGET
variables if not specified in a .env.local
file.
npm run build
- Open
about:debugging
page - Navigate to "This Firefox" tab
- Click the "Load Temporary Add-on..." button
- Navigate to the
dist/
folder of this repository
- Open
chrome://extensions/
page - Toggle "Developmer mode" in the top right corner
- Click the "Load unpacked" button
- Navigate to the
dist/
folder of this repository
- Download the
Firefox_X.X.X_mv2_signed.xpi
version - Firefox will prompt you to install the extension
- Download & Unpack extension
- Open
about:debugging
page - Navigate to "This Firefox" tab
- Click "Load Temporary Add-on..."
- Select the manifest.json file
This is only possible if you are on Firefox Developer or Nightly Edition.
- Navigate to
about:config
- Search for
xpinstall.signatures.required
and double click until the value showsfalse
- Download the
Firefox_X.X.X_mv2.xpi
version - Firefox will prompt you to install the extension
- Download extension (
*_mv3.zip
) - Open
chrome://extensions/
page - Toggle "Developmer mode" in the top right corner
- Drag the
.zip
file into the browser window (or select the extracted the parent folder via "Load unpacked")
By tagging a commit, the Extension will be built and sent to the Chrome Web Store (Manifest 3) & Mozilla AMO platform (Manifest 2).
- Commits tagged with
-dev
(eg.0.0.1-dev.1
) will only be signed (Mozilla AMO) or uploaded in unlisted (Chrome Web Store). - Commits without development tags will be published instantly (eg.
0.0.1
) - The core version prefix must be unique across all tags. There can not be a
0.0.1
and0.0.1-dev.1
(or0.0.1-dev.2
etc.) at the same time because the Extensions Manifest requires all versions to be in a{int}.{int}.{int}
format. Thus the specific version prefix will also be unique on the Chrome Web Store and Mozilla AMO platform.
- Popup Script not working in Chrome due to injected inline JS
- Firefox is not yet supporting service workers: stackoverflow.com
- HMR not available in Firefox:
- See issue vite-plugin-web-extension#87
- We can not load the transpiled JS bundle from
localhost
since Firefox only allows loading content scripts frommoz-extension
URLs. (WebExtension content scripts may only load modules with moz-extension URLs and not: “http://localhost:5173/@vite/client”.)
If you have discovered a vulnerability or security related issue, please send a mail at [email protected]. Do not open an issue on GitHub.
CC BY-ND 4.0 Deed. Please see the License File for more information.
Based on samrum/vite-plugin-web-extension (via create-vite-plugin-web-extension).