Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ jobs:
run: bun install --frozen-lockfile
- name: Run Typecheck
run: bun run typecheck
- name: Build Extension
- name: Build Extension (Chrome MV3)
run: bun run build
- name: Build Extension (Firefox MV2)
run: bun run build:firefox

# release job, runs on main only after successful build
release:
Expand Down
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,34 @@ npm run build
npm run zip
```

Firefox builds are also supported:
To manually load the production build as an unpacked extension in Chrome:

1. Run `npm run build`.
2. Open `chrome://extensions/`.
3. Enable Developer Mode (top right).
4. Click "Load Unpacked" and select the `.output/chrome-mv3/` folder.

### Firefox development

Firefox builds (MV2) are also supported. WXT normalizes the MV3 manifest into
the MV2 shape automatically; the `chrome.scripting.*` API used by the background
worker is supported in Firefox 102 and later.

```bash
# dev server with HMR, launches Firefox with the extension auto-loaded
npm run dev:firefox

# production build (writes to .output/firefox-mv2/)
npm run build:firefox

# zip for AMO submission (writes to .output/<name>-<ver>-firefox.zip)
npm run zip:firefox
```

To manually load the production build as an unpacked extension in Chrome:

1. Run `npm run build`.
2. Open `chrome://extensions/`.
3. Enable Developer Mode (top right).
4. Click "Load Unpacked" and select the `.output/chrome-mv3/` folder.
To customise the browser binary that `npm run dev` / `npm run dev:firefox`
launches (e.g. point at Firefox Developer Edition), copy
`web-ext.config.example.ts` to `web-ext.config.ts` and edit the paths. The
`web-ext.config.ts` file is gitignored — keep it local to your machine.

## License

Expand Down
13 changes: 13 additions & 0 deletions web-ext.config.example.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineWebExtConfig } from "wxt"

// Copy this file to `web-ext.config.ts` (gitignored) and adjust paths for your
// machine. WXT uses it to launch the browser during `wxt` / `wxt -b firefox`.
//
// See https://wxt.dev/guide/essentials/config/browser-startup.html
export default defineWebExtConfig({
binaries: {
chrome: "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
firefox: "firefoxdeveloperedition",
},
startUrls: ["https://schoolbox.education/"],
})
9 changes: 9 additions & 0 deletions wxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { defineConfig } from "wxt"
// See https://wxt.dev/api/config.html
export default defineConfig({
srcDir: "src",
// Firefox MV2 build: WXT normalizes host_permissions, web_accessible_resources,
// and action -> browser_action automatically. The `scripting` permission and
// `chrome.scripting.*` API are supported in Firefox MV2 (Firefox 102+).
manifest: {
name: "UltraBox",
description: "A Chrome extension for SchoolBox.",
Expand All @@ -29,4 +32,10 @@ export default defineConfig({
},
],
},
// UltraBox is an existing extension (currently distributed for Chrome). The
// Firefox data-collection consent requirement only applies to brand-new
// listings on AMO; suppress the build-time warning until we list there.
suppressWarnings: {
firefoxDataCollection: true,
},
})
Loading