@stacksjs/browser-extension 0.70.149 → 0.70.150
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 +10 -0
- package/dist/manifest.d.ts +1 -1
- package/dist/manifest.js +6 -2
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,6 +19,16 @@ buddy extension:build --target safari # → dist-safari/ (browser.* namespace,
|
|
|
19
19
|
buddy extension:package # build + zip store-ready archives
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
Use `icons` for full-color store/app branding and `actionIcons` for separate,
|
|
23
|
+
usually neutral artwork in the browser toolbar:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
defineExtension({
|
|
27
|
+
icons: { 16: 'icons/icon-16.png', 128: 'icons/icon-128.png' },
|
|
28
|
+
actionIcons: { 16: 'icons/toolbar-16.png', 32: 'icons/toolbar-32.png' },
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
22
32
|
## Store publishing
|
|
23
33
|
|
|
24
34
|
Stacks owns the store-specific upload clients as well as the builds. Chrome
|
package/dist/manifest.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare interface GeneratedManifest {
|
|
|
17
17
|
description: string
|
|
18
18
|
version: string
|
|
19
19
|
minimum_chrome_version?: string
|
|
20
|
-
action?: { default_title?: string, default_popup?: string }
|
|
20
|
+
action?: { default_title?: string, default_popup?: string, default_icon?: Record<string, string> }
|
|
21
21
|
options_page?: string
|
|
22
22
|
background?: { service_worker: string, type?: 'module' } | { scripts: string[], type?: 'module' }
|
|
23
23
|
browser_specific_settings?: {
|
package/dist/manifest.js
CHANGED
|
@@ -11,8 +11,12 @@ export function generateManifest(config, opts) {
|
|
|
11
11
|
};
|
|
12
12
|
if (!isFirefox && !isSafari && m.minimumChromeVersion)
|
|
13
13
|
manifest.minimum_chrome_version = m.minimumChromeVersion;
|
|
14
|
-
if (config.pages?.popup)
|
|
15
|
-
manifest.action = {
|
|
14
|
+
if (config.pages?.popup || config.actionIcons)
|
|
15
|
+
manifest.action = {
|
|
16
|
+
default_title: config.name,
|
|
17
|
+
...config.pages?.popup ? { default_popup: "popup.html" } : {},
|
|
18
|
+
...config.actionIcons ? { default_icon: Object.fromEntries(Object.entries(config.actionIcons).map(([size, path]) => [String(size), path])) } : {}
|
|
19
|
+
};
|
|
16
20
|
if (config.pages?.options)
|
|
17
21
|
manifest.options_page = "options.html";
|
|
18
22
|
if (config.background)
|
package/dist/types.d.ts
CHANGED
|
@@ -144,6 +144,7 @@ export declare interface ExtensionConfig {
|
|
|
144
144
|
content?: ContentScript[]
|
|
145
145
|
pages?: ExtensionPages
|
|
146
146
|
icons?: Record<number, string>
|
|
147
|
+
actionIcons?: Record<number, string>
|
|
147
148
|
public?: string
|
|
148
149
|
assets?: Record<string, string>
|
|
149
150
|
rules?: RuleResource[]
|
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.150",
|
|
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": [
|