@stacksjs/browser-extension 0.70.161 → 0.70.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,12 +45,12 @@ buddy extension:safari:publish
|
|
|
45
45
|
buddy extension:safari:submit # submit an already-uploaded version
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
Chrome reads `
|
|
49
|
-
`
|
|
48
|
+
Chrome reads `CHROME*WEB*STORE*SERVICE*ACCOUNT*PATH` (or
|
|
49
|
+
`GOOGLE*APPLICATION*CREDENTIALS`) and the configured
|
|
50
50
|
`chromeWebStore.publisherId`/`itemId`. The API only updates existing items, so
|
|
51
51
|
create the initial Developer Dashboard item once and link the service-account
|
|
52
|
-
email to the publisher account. Firefox reads `
|
|
53
|
-
`
|
|
52
|
+
email to the publisher account. Firefox reads `AMO*JWT*ISSUER` and
|
|
53
|
+
`AMO*JWT*SECRET`; `web-ext` can create the initial listing when
|
|
54
54
|
`firefoxAddons.license` and `firefoxAddons.categories` are configured.
|
|
55
55
|
|
|
56
56
|
For tag-driven publication, call Stacks' reusable workflow from the extension
|
|
@@ -60,7 +60,7 @@ resubmitting builds to the browser stores:
|
|
|
60
60
|
|
|
61
61
|
```yaml
|
|
62
62
|
on:
|
|
63
|
-
|
|
63
|
+
workflow*dispatch:
|
|
64
64
|
inputs:
|
|
65
65
|
github-release-only:
|
|
66
66
|
description: Build packages and create or repair the GitHub Release only
|
|
@@ -78,17 +78,17 @@ jobs:
|
|
|
78
78
|
publish:
|
|
79
79
|
uses: stacksjs/stacks/.github/workflows/browser-extension-release.yml@v0.70.147
|
|
80
80
|
with:
|
|
81
|
-
chrome-publisher-id: ${{ vars.
|
|
82
|
-
safari-enabled: ${{ vars.
|
|
81
|
+
chrome-publisher-id: ${{ vars.CHROME*WEB*STORE*PUBLISHER*ID }}
|
|
82
|
+
safari-enabled: ${{ vars.ENABLE*SAFARI*PUBLISH == 'true' }}
|
|
83
83
|
publish-stores: ${{ !inputs.github-release-only }}
|
|
84
84
|
release-tag: ${{ inputs.release-tag || '' }}
|
|
85
85
|
secrets:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
CHROME*WEB*STORE*SERVICE*ACCOUNT*JSON: ${{ secrets.CHROME*WEB*STORE*SERVICE*ACCOUNT*JSON }}
|
|
87
|
+
AMO*JWT*ISSUER: ${{ secrets.AMO*JWT*ISSUER }}
|
|
88
|
+
AMO*JWT*SECRET: ${{ secrets.AMO*JWT*SECRET }}
|
|
89
|
+
APP*STORE*CONNECT*API*KEY: ${{ secrets.APP*STORE*CONNECT*API*KEY }}
|
|
90
|
+
APP*STORE*CONNECT*API*KEY*ID: ${{ secrets.APP*STORE*CONNECT*API*KEY*ID }}
|
|
91
|
+
APP*STORE*CONNECT*API*ISSUER*ID: ${{ secrets.APP*STORE*CONNECT*API*ISSUER*ID }}
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
It packages every configured target, publishes Chrome and Firefox in
|
|
@@ -104,8 +104,8 @@ Safari Web Extensions ship inside Apple container apps, so the safari target
|
|
|
104
104
|
has two halves: the web bundle (`extension:build --target safari`) and the
|
|
105
105
|
macOS/iOS apps. The build rewrites promise-style `chrome.*` to `browser.*` (Safari's
|
|
106
106
|
`chrome.*` is callback-flavoured) and pins
|
|
107
|
-
`
|
|
108
|
-
Safari with MAIN-world content scripts + `
|
|
107
|
+
`browser*specific*settings.safari.strict*min*version` (default 18.4, the first
|
|
108
|
+
Safari with MAIN-world content scripts + `match*about*blank`).
|
|
109
109
|
|
|
110
110
|
```sh
|
|
111
111
|
buddy extension:safari:init # scaffold the Xcode container app into safari/
|
|
@@ -123,8 +123,8 @@ iPhone and iPad. Stacks generates the current Apple-supported universal Xcode
|
|
|
123
123
|
project from the same built extension, archives both platforms, uploads them
|
|
124
124
|
to the same App Store Connect app record, waits for Apple processing, and
|
|
125
125
|
selects each processed build on its matching App Store version. Publishing
|
|
126
|
-
reads `
|
|
127
|
-
`
|
|
126
|
+
reads `APP*STORE*CONNECT*API*KEY*ID`, `APP*STORE*CONNECT*API*ISSUER*ID`, and
|
|
127
|
+
`APP*STORE*CONNECT*API*KEY*PATH` from the environment. Run with
|
|
128
128
|
`--validate-only` to exercise Apple's validation without uploading a build.
|
|
129
129
|
List any build output that is not part of the extension (marketing pages,
|
|
130
130
|
etc.) in `safariExclude` so it stays out of the appex. The scaffold mirrors
|
|
@@ -168,16 +168,16 @@ export default defineExtension({
|
|
|
168
168
|
supportUrl: 'https://example.com/support',
|
|
169
169
|
copyright: '2026 Example',
|
|
170
170
|
primaryCategory: 'UTILITIES',
|
|
171
|
-
contentRightsDeclaration: '
|
|
171
|
+
contentRightsDeclaration: 'DOES*NOT*USE*THIRD*PARTY*CONTENT',
|
|
172
172
|
price: '0',
|
|
173
173
|
reviewContact: {
|
|
174
174
|
firstName: 'App', lastName: 'Reviewer',
|
|
175
175
|
phone: '+1 555-555-0100', email: 'review@example.com',
|
|
176
176
|
},
|
|
177
177
|
screenshots: {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
APP*DESKTOP: ['resources/store/macos.png'],
|
|
179
|
+
APP*IPHONE*67: ['resources/store/iphone.png'],
|
|
180
|
+
APP*IPAD*PRO*3GEN*129: ['resources/store/ipad.png'],
|
|
181
181
|
},
|
|
182
182
|
submitForReview: true,
|
|
183
183
|
},
|
|
@@ -185,7 +185,7 @@ export default defineExtension({
|
|
|
185
185
|
|
|
186
186
|
background: 'src/background/index.ts',
|
|
187
187
|
content: [
|
|
188
|
-
{ entry: 'src/content/index.ts', matches: ['<
|
|
188
|
+
{ entry: 'src/content/index.ts', matches: ['<all*urls>'], runAt: 'document*start' },
|
|
189
189
|
// world: 'MAIN' runs in the page's own JS context (patch page globals)
|
|
190
190
|
{ entry: 'src/content/inpage.ts', matches: ['*://example.com/*'], world: 'MAIN' },
|
|
191
191
|
],
|
|
@@ -199,7 +199,7 @@ export default defineExtension({
|
|
|
199
199
|
|
|
200
200
|
// declarativeNetRequest — compiled from a module whose default export
|
|
201
201
|
// returns the rules array, written to rules/<id>.json:
|
|
202
|
-
rules: [{ id: '
|
|
202
|
+
rules: [{ id: 'static*rules', source: 'src/rules/static.ts' }],
|
|
203
203
|
|
|
204
204
|
manifest: {
|
|
205
205
|
permissions: ['declarativeNetRequest', 'storage', 'tabs'],
|
|
@@ -207,7 +207,7 @@ export default defineExtension({
|
|
|
207
207
|
minimumChromeVersion: '111',
|
|
208
208
|
firefoxMinVersion: '142.0',
|
|
209
209
|
safariMinVersion: '18.4',
|
|
210
|
-
webAccessibleResources: [{ resources: ['stubs/*.js'], matches: ['<
|
|
210
|
+
webAccessibleResources: [{ resources: ['stubs/*.js'], matches: ['<all*urls>'] }],
|
|
211
211
|
},
|
|
212
212
|
|
|
213
213
|
// App-specific post-processing the generic build can't express:
|
|
@@ -224,8 +224,8 @@ stx pages to HTML (**sanitized for the extension CSP** — inline scripts/styles
|
|
|
224
224
|
stripped, asset paths made relative, stx dev-chunks removed), bundles
|
|
225
225
|
content/background scripts as classic **IIFE** bundles (esm would leak
|
|
226
226
|
top-level vars as page globals), compiles each ruleset's `source` to
|
|
227
|
-
`rules/<id>.json`, writes `manifest.json` (per-target: Chrome `
|
|
228
|
-
vs Firefox event-page + `
|
|
227
|
+
`rules/<id>.json`, writes `manifest.json` (per-target: Chrome `service*worker`
|
|
228
|
+
vs Firefox event-page + `browser*specific*settings.gecko`), and runs your
|
|
229
229
|
`hooks.postBuild`.
|
|
230
230
|
|
|
231
231
|
## Programmatic API
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/browser-extension",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.70.
|
|
4
|
+
"version": "0.70.162",
|
|
5
5
|
"description": "Build MV3 browser extensions (Chrome, Firefox, Safari) the Stacks way — manifest, content/background scripts, DNR rules, packaging, Safari container app, all config-driven.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|