extension-create 4.1.26 → 4.1.28

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.
@@ -26,6 +26,7 @@ export interface CardInput {
26
26
  }
27
27
  export declare const MAX_CARD_ROWS = 3;
28
28
  export declare function card(input?: CardInput): string;
29
+ export declare function browserDisplayName(browser: string): string;
29
30
  export declare function browserRowValue(browser: string, versionLine?: string): string;
30
31
  export declare function isCardKeyClaimed(key: string): boolean;
31
32
  export declare function claimCardKey(key: string): boolean;
package/dist/module.cjs CHANGED
@@ -641,7 +641,7 @@ const NETWORK_TIMEOUT_MS = (()=>{
641
641
  return Number.isFinite(raw) && raw > 0 ? raw : 60000;
642
642
  })();
643
643
  const CODELOAD_BASE = 'https://codeload.github.com/extension-js/examples/zip';
644
- const DEFAULT_TEMPLATES_REF = 'ed2b5c528f59500f6fd0a6a5aad9f0296aa50803';
644
+ const DEFAULT_TEMPLATES_REF = '893a06ba86125ac721ca2df71e6eec7aba123e38';
645
645
  const BUNDLED_TEMPLATES = [
646
646
  "javascript"
647
647
  ];
@@ -1,4 +1,4 @@
1
- export declare const DEFAULT_TEMPLATES_REF = "ed2b5c528f59500f6fd0a6a5aad9f0296aa50803";
1
+ export declare const DEFAULT_TEMPLATES_REF = "893a06ba86125ac721ca2df71e6eec7aba123e38";
2
2
  export declare const BUNDLED_TEMPLATES: readonly string[];
3
3
  export declare const DEFAULT_TEMPLATE_NAME = "typescript";
4
4
  export declare const OFFLINE_FALLBACK_TEMPLATE = "javascript";
@@ -1,6 +1,6 @@
1
1
  {
2
- "createdWith": "extension-create@4.1.25",
2
+ "createdWith": "extension-create@4.1.27",
3
3
  "template": "typescript",
4
- "source": "https://codeload.github.com/extension-js/examples/zip/ed2b5c528f59500f6fd0a6a5aad9f0296aa50803",
5
- "ref": "ed2b5c528f59500f6fd0a6a5aad9f0296aa50803"
4
+ "source": "https://codeload.github.com/extension-js/examples/zip/893a06ba86125ac721ca2df71e6eec7aba123e38",
5
+ "ref": "893a06ba86125ac721ca2df71e6eec7aba123e38"
6
6
  }
@@ -9,7 +9,7 @@ Packaging your extension is local and free. Submitting the result to a
9
9
  store is what [extension.dev](https://docs.extension.dev/publish/overview?utm_source=store-md)
10
10
  does, and it sponsors Extension.js.
11
11
 
12
- Last updated: 2026-09-20
12
+ Last updated: 2026-09-23
13
13
 
14
14
  ## Listing
15
15
 
@@ -8,7 +8,7 @@
8
8
  "devDependencies": {
9
9
  "@types/chrome": "^0.0.287",
10
10
  "typescript": "7.0.2",
11
- "extension": "^4.1.25"
11
+ "extension": "^4.1.27"
12
12
  },
13
13
  "scripts": {
14
14
  "dev": "extension dev",
@@ -2,8 +2,12 @@ console.log(
2
2
  '[From the background context] Hello from the background worker/script!'
3
3
  )
4
4
 
5
+ // Named one by one so the bundler can fold each build down to a single
6
+ // branch. waterfox and librewolf are gecko, and used to fall to chromium.
5
7
  const isFirefoxLike =
6
8
  import.meta.env.EXTENSION_PUBLIC_BROWSER === 'firefox' ||
9
+ import.meta.env.EXTENSION_PUBLIC_BROWSER === 'waterfox' ||
10
+ import.meta.env.EXTENSION_PUBLIC_BROWSER === 'librewolf' ||
7
11
  import.meta.env.EXTENSION_PUBLIC_BROWSER === 'gecko-based'
8
12
 
9
13
  const isSafariLike =
@@ -31,8 +35,16 @@ function openSidebarTab() {
31
35
  return
32
36
  }
33
37
 
34
- chrome.tabs.update(knownTabId, {active: true}, () => {
35
- if (chrome.runtime.lastError) openNewTab()
38
+ chrome.tabs.update(knownTabId, {active: true}, (tab) => {
39
+ if (chrome.runtime.lastError || !tab) {
40
+ openNewTab()
41
+
42
+ return
43
+ }
44
+
45
+ // Selecting a tab in another window leaves that window behind the one the
46
+ // user is looking at, so raise it too.
47
+ chrome.windows?.update(tab.windowId, {focused: true})
36
48
  })
37
49
  }
38
50
 
@@ -1,7 +1,11 @@
1
1
  import logo from '../images/icon.png'
2
2
 
3
+ // Named one by one so the bundler can fold each build down to a single
4
+ // branch. waterfox and librewolf are gecko, and used to fall to chromium.
3
5
  const isFirefoxLike =
4
6
  import.meta.env.EXTENSION_PUBLIC_BROWSER === 'firefox' ||
7
+ import.meta.env.EXTENSION_PUBLIC_BROWSER === 'waterfox' ||
8
+ import.meta.env.EXTENSION_PUBLIC_BROWSER === 'librewolf' ||
5
9
  import.meta.env.EXTENSION_PUBLIC_BROWSER === 'gecko-based'
6
10
 
7
11
  export default function createContentApp(): HTMLDivElement {
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "templates"
26
26
  ],
27
27
  "name": "extension-create",
28
- "version": "4.1.26",
28
+ "version": "4.1.28",
29
29
  "description": "The standalone extension creation engine for Extension.js",
30
30
  "author": {
31
31
  "name": "Cezar Augusto",
@@ -11,7 +11,7 @@
11
11
 
12
12
  **What you'll see**: A small UI injected into any web page, isolated in a Shadow DOM so site styles don't bleed through.
13
13
 
14
- **How it works**: A content script mounts a JavaScript UI inside a Shadow DOM and applies scoped styles so the host page can't bleed through.
14
+ **How it works**: The manifest registers a side panel (`chromium:side_panel` / `firefox:sidebar_action`) that loads a JavaScript page bundled from `src/sidebar/`. A content script mounts a JavaScript UI inside a Shadow DOM and applies scoped styles so the host page can't bleed through. On Chromium the in-page pill opens the panel. Firefox only opens a sidebar from a toolbar gesture, so the gecko build renders the pill inert with a hint to use the toolbar icon instead.
15
15
 
16
16
  Plain JavaScript starter. Useful as a baseline when you want to add framework or tooling support yourself, layer by layer.
17
17
 
@@ -35,6 +35,11 @@ src/
35
35
  │ ├── scripts.js
36
36
  │ └── styles.css
37
37
  ├── images/
38
+ │ ├── icon-128.png
39
+ │ ├── icon-16.png
40
+ │ ├── icon-32.png
41
+ │ ├── icon-48.png
42
+ │ ├── icon-64.png
38
43
  │ └── icon.png
39
44
  ├── sidebar/
40
45
  │ ├── index.html
@@ -2,8 +2,12 @@ console.log(
2
2
  '[From the background context] Hello from the background worker/script!'
3
3
  )
4
4
 
5
+ // Named one by one so the bundler can fold each build down to a single
6
+ // branch. waterfox and librewolf are gecko, and used to fall to chromium.
5
7
  const isFirefoxLike =
6
8
  import.meta.env.EXTENSION_PUBLIC_BROWSER === 'firefox' ||
9
+ import.meta.env.EXTENSION_PUBLIC_BROWSER === 'waterfox' ||
10
+ import.meta.env.EXTENSION_PUBLIC_BROWSER === 'librewolf' ||
7
11
  import.meta.env.EXTENSION_PUBLIC_BROWSER === 'gecko-based'
8
12
 
9
13
  const isSafariLike =
@@ -31,8 +35,16 @@ function openSidebarTab() {
31
35
  return
32
36
  }
33
37
 
34
- chrome.tabs.update(knownTabId, {active: true}, () => {
35
- if (chrome.runtime.lastError) openNewTab()
38
+ chrome.tabs.update(knownTabId, {active: true}, (tab) => {
39
+ if (chrome.runtime.lastError || !tab) {
40
+ openNewTab()
41
+
42
+ return
43
+ }
44
+
45
+ // Selecting a tab in another window leaves that window behind the one the
46
+ // user is looking at, so raise it too.
47
+ chrome.windows?.update(tab.windowId, {focused: true})
36
48
  })
37
49
  }
38
50
 
@@ -1,7 +1,11 @@
1
1
  import logo from '../images/icon.png'
2
2
 
3
+ // Named one by one so the bundler can fold each build down to a single
4
+ // branch. waterfox and librewolf are gecko, and used to fall to chromium.
3
5
  const isFirefoxLike =
4
6
  import.meta.env.EXTENSION_PUBLIC_BROWSER === 'firefox' ||
7
+ import.meta.env.EXTENSION_PUBLIC_BROWSER === 'waterfox' ||
8
+ import.meta.env.EXTENSION_PUBLIC_BROWSER === 'librewolf' ||
5
9
  import.meta.env.EXTENSION_PUBLIC_BROWSER === 'gecko-based'
6
10
 
7
11
  export default function createContentApp() {