+
-
- {{ extension.weeklyActiveUsers.toLocaleString() }} users,
- {{ extension.rating }} stars
-
-
@@ -198,7 +696,7 @@ function getStoreUrl(extension: ChromeExtension) {
diff --git a/docs/.vitepress/composables/useListExtensionDetails.ts b/docs/.vitepress/composables/useListExtensionDetails.ts
index 119236c07..65a73790c 100644
--- a/docs/.vitepress/composables/useListExtensionDetails.ts
+++ b/docs/.vitepress/composables/useListExtensionDetails.ts
@@ -1,39 +1,58 @@
import { ref } from 'vue';
-export interface ChromeExtension {
+export interface Extension {
id: string;
name: string;
iconUrl: string;
- weeklyActiveUsers: number;
shortDescription: string;
storeUrl: string;
rating: number | undefined;
+ users: number;
+}
+
+export interface ExtensionResults {
+ chrome: Extension[];
+ firefox: Extension[];
}
const operationName = 'WxtDocsUsedBy';
-const query = `query ${operationName}($ids:[String!]!) {
- chromeExtensions(ids: $ids) {
+const query = `query ${operationName}($chromeIds: [String!]!, $firefoxIds: [String!]!) {
+ chromeExtensions(ids: $chromeIds) {
id
- name
- iconUrl
- weeklyActiveUsers
- shortDescription
- storeUrl
- rating
+ ...ExtensionData
}
+ firefoxAddons(ids: $firefoxIds) {
+ id: slug
+ ...ExtensionData
+ }
+}
+
+fragment ExtensionData on Extension {
+ name
+ iconUrl
+ shortDescription
+ storeUrl
+ rating
+ users
}`;
-export default function (ids: string[]) {
- const data = ref();
+export default function (chromeIds: string[], firefoxSlugs: string[]) {
+ const data = ref();
const err = ref();
const isLoading = ref(true);
+ if (chromeIds.length === 0 && firefoxSlugs.length === 0) {
+ data.value = { chrome: [], firefox: [] };
+ isLoading.value = false;
+ return { data, err, isLoading };
+ }
+
fetch('https://queue.wxt.dev/api', {
method: 'POST',
body: JSON.stringify({
operationName,
query,
- variables: { ids },
+ variables: { chromeIds, firefoxIds: firefoxSlugs },
}),
headers: {
'Content-Type': 'application/json',
@@ -41,10 +60,11 @@ export default function (ids: string[]) {
})
.then(async (res) => {
isLoading.value = false;
- const {
- data: { chromeExtensions },
- } = await res.json();
- data.value = chromeExtensions;
+ const { data: responseData } = await res.json();
+ data.value = {
+ chrome: responseData.chromeExtensions ?? [],
+ firefox: responseData.firefoxAddons ?? [],
+ };
err.value = undefined;
})
.catch((error) => {
@@ -54,9 +74,5 @@ export default function (ids: string[]) {
err.value = error;
});
- return {
- data,
- err,
- isLoading,
- };
+ return { data, err, isLoading };
}
From 42c8a02ef9429dedc4ca498f9790170be3b18008 Mon Sep 17 00:00:00 2001
From: Skylar Bolton
Date: Mon, 13 Apr 2026 00:33:50 -0400
Subject: [PATCH 105/227] docs: Add 5 Whiteboard Works extensions to the
homepage (#2207)
Co-authored-by: Claude Opus 4.6 (1M context)
Co-authored-by: Aaron
---
.../.vitepress/components/UsingWxtSection.vue | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/docs/.vitepress/components/UsingWxtSection.vue b/docs/.vitepress/components/UsingWxtSection.vue
index 2a0832384..9ffba2599 100644
--- a/docs/.vitepress/components/UsingWxtSection.vue
+++ b/docs/.vitepress/components/UsingWxtSection.vue
@@ -552,6 +552,31 @@ const extensionEntries: ExtensionEntry[] = [
chromeId: 'pmgehhllikbjmadpenhabejhpemplhmd',
firefoxSlug: 'rank-checker',
},
+ {
+ // PlayFaster - Enhanced playback speed control for online videos and audio
+ chromeId: 'fppcbkhpahkbgijkdcpjgjmhpfbmfiih',
+ firefoxSlug: 'playfaster',
+ },
+ {
+ // LatTab - Learn Latin With Every New Tab
+ chromeId: 'eiocjaocpmackhbaffoejkcmnfbdpgpj',
+ firefoxSlug: 'lattab-learn-latin-new-tabs',
+ },
+ {
+ // Vim What? - Interactive Vim command reference
+ chromeId: 'ngbehgnlcdjkbnihgpkgdangbhemidge',
+ firefoxSlug: 'vim-what',
+ },
+ {
+ // FRED - Fraud Recognition Easy Detection
+ chromeId: 'bjdbcabacnlmbpcmiapcdfancfgcakfn',
+ firefoxSlug: 'fred',
+ },
+ {
+ // Clear Wisdom - Gems of wisdom from James Clear's 3-2-1 newsletter
+ chromeId: 'jijfmgoijddfmlcdghopbkdpelbpmjdm',
+ firefoxSlug: 'clear-wisdom',
+ },
];
const chromeIds = extensionEntries.flatMap((e) =>
From b2a099689f986dd2d5cc7b395320c186220a37c0 Mon Sep 17 00:00:00 2001
From: Sullivan <38718448+Epic-R-R@users.noreply.github.com>
Date: Mon, 13 Apr 2026 08:09:21 +0330
Subject: [PATCH 106/227] docs: Added "SoundCloud Enhanced Pro" to the homepage
(#2238)
Co-authored-by: Aaron
---
docs/.vitepress/components/UsingWxtSection.vue | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/.vitepress/components/UsingWxtSection.vue b/docs/.vitepress/components/UsingWxtSection.vue
index 9ffba2599..c93215d7f 100644
--- a/docs/.vitepress/components/UsingWxtSection.vue
+++ b/docs/.vitepress/components/UsingWxtSection.vue
@@ -577,6 +577,10 @@ const extensionEntries: ExtensionEntry[] = [
chromeId: 'jijfmgoijddfmlcdghopbkdpelbpmjdm',
firefoxSlug: 'clear-wisdom',
},
+ {
+ // Soundcloud Enhanced Pro
+ chromeId: 'ggplcohodggmdfpopelnpplhgfjclomi',
+ },
];
const chromeIds = extensionEntries.flatMap((e) =>
From de2b38217ab614aa45979a265eddd5fec5c08da0 Mon Sep 17 00:00:00 2001
From: Kamer DINC
Date: Mon, 13 Apr 2026 07:42:59 +0300
Subject: [PATCH 107/227] docs: Add AlarmBot extension to the list of
extensions (#2251)
Co-authored-by: Aaron
---
docs/.vitepress/components/UsingWxtSection.vue | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/.vitepress/components/UsingWxtSection.vue b/docs/.vitepress/components/UsingWxtSection.vue
index c93215d7f..986d76d1f 100644
--- a/docs/.vitepress/components/UsingWxtSection.vue
+++ b/docs/.vitepress/components/UsingWxtSection.vue
@@ -581,6 +581,10 @@ const extensionEntries: ExtensionEntry[] = [
// Soundcloud Enhanced Pro
chromeId: 'ggplcohodggmdfpopelnpplhgfjclomi',
},
+ {
+ // AlarmBot: ULTIMATE Web Monitoring & Smart Price Alerts
+ chromeId: 'mpckalcodookackleecihhnngdibelif',
+ },
];
const chromeIds = extensionEntries.flatMap((e) =>
From e16052cdc9dcd298386e487bb4cbade03d5110b2 Mon Sep 17 00:00:00 2001
From: Aaron
Date: Mon, 13 Apr 2026 00:12:22 -0500
Subject: [PATCH 108/227] docs: Move homepage extensions to separate YAML file
(#2255)
---
cspell.yml | 1 +
.../.vitepress/components/UsingWxtSection.vue | 576 +-----------------
docs/.vitepress/config.ts | 13 +-
docs/assets/extension-showcase.yml | 435 +++++++++++++
package.json | 6 +-
5 files changed, 457 insertions(+), 574 deletions(-)
create mode 100644 docs/assets/extension-showcase.yml
diff --git a/cspell.yml b/cspell.yml
index 66c463a71..1ff8f06eb 100644
--- a/cspell.yml
+++ b/cspell.yml
@@ -10,6 +10,7 @@ ignorePaths:
- packages/browser/src/gen/**
- patches/**
- '**/*.snap'
+ - docs/assets/extension-showcase.yml
words:
- Aabid
- aabidk
diff --git a/docs/.vitepress/components/UsingWxtSection.vue b/docs/.vitepress/components/UsingWxtSection.vue
index 986d76d1f..8de415fb9 100644
--- a/docs/.vitepress/components/UsingWxtSection.vue
+++ b/docs/.vitepress/components/UsingWxtSection.vue
@@ -1,11 +1,7 @@
-
+
{{ author.name }}
diff --git a/docs/.vitepress/components/ExampleSearch.vue b/docs/.vitepress/components/ExampleSearch.vue
index 03b319c2d..a7e8dac0f 100644
--- a/docs/.vitepress/components/ExampleSearch.vue
+++ b/docs/.vitepress/components/ExampleSearch.vue
@@ -1,5 +1,5 @@
diff --git a/docs/.vitepress/components/ExampleSearch.vue b/docs/.vitepress/components/ExampleSearch.vue
index a7e8dac0f..98f79269d 100644
--- a/docs/.vitepress/components/ExampleSearch.vue
+++ b/docs/.vitepress/components/ExampleSearch.vue
@@ -4,7 +4,7 @@ import ExampleSearchFilterByItem from './ExampleSearchFilterByItem.vue';
import ExampleSearchResult from './ExampleSearchResult.vue';
import { ExamplesMetadata, KeySelectedObject } from '../utils/types';
-const props = defineProps<{
+defineProps<{
tag?: string;
}>();
diff --git a/docs/.vitepress/components/ExampleSearchFilterByItem.vue b/docs/.vitepress/components/ExampleSearchFilterByItem.vue
index 23b387bec..a7752fe09 100644
--- a/docs/.vitepress/components/ExampleSearchFilterByItem.vue
+++ b/docs/.vitepress/components/ExampleSearchFilterByItem.vue
@@ -2,7 +2,7 @@
import { computed, toRaw } from 'vue';
import { KeySelectedObject } from '../utils/types';
-const props = defineProps<{
+defineProps<{
label: string;
items?: string[];
}>();
diff --git a/docs/.vitepress/components/ExampleSearchResult.vue b/docs/.vitepress/components/ExampleSearchResult.vue
index b46c6d1ea..ef25b7da4 100644
--- a/docs/.vitepress/components/ExampleSearchResult.vue
+++ b/docs/.vitepress/components/ExampleSearchResult.vue
@@ -1,7 +1,7 @@
diff --git a/docs/.vitepress/loaders/cli.data.ts b/docs/.vitepress/loaders/cli.data.ts
index ad685b3e3..1362d1f11 100644
--- a/docs/.vitepress/loaders/cli.data.ts
+++ b/docs/.vitepress/loaders/cli.data.ts
@@ -56,8 +56,3 @@ async function getPublishExtensionHelp(command: string): Promise {
);
return res.replace(/\$ publish-extension/g, '$ wxt submit');
}
-
-export interface Command {
- name: string;
- docs: string;
-}
diff --git a/docs/.vitepress/utils/menus.ts b/docs/.vitepress/utils/menus.ts
index 31ec4044d..50160e306 100644
--- a/docs/.vitepress/utils/menus.ts
+++ b/docs/.vitepress/utils/menus.ts
@@ -1,8 +1,6 @@
import { DefaultTheme } from 'vitepress';
type SidebarItem = DefaultTheme.SidebarItem;
-type NavItem = DefaultTheme.NavItem;
-type NavItemWithLink = DefaultTheme.NavItemWithLink;
type NavItemWithChildren = DefaultTheme.NavItemWithChildren;
type NavItemChildren = DefaultTheme.NavItemChildren;
@@ -19,7 +17,7 @@ export function navItem(text: string, arg2?: unknown): any {
}
export function menuRoot(items: SidebarItem[]) {
- return items.map((item, index) => {
+ return items.map((item) => {
// item.collapsed = false; // uncomment to expand all level-0 items
return item;
});
@@ -60,12 +58,6 @@ export function menuGroup(
throw Error('Unknown overload');
}
-export function menuItems(items: SidebarItem[]) {
- return {
- items,
- };
-}
-
export function menuItem(
text: string,
link: string,
@@ -97,9 +89,7 @@ export function prepareTypedocSidebar(items: SidebarItem[]) {
}
};
- // process
prepareItems(filtered);
- // return
return filtered;
}
From e613b54d9491e009acfd009b7ffbec7821c5f87a Mon Sep 17 00:00:00 2001
From: kairi
Date: Mon, 27 Apr 2026 07:01:59 +0900
Subject: [PATCH 150/227] feat: add `default_state` option to popup actions
(#2010)
Co-authored-by: Aaron
---
.../src/core/utils/__tests__/manifest.test.ts | 69 +++++++++++++++++++
packages/wxt/src/core/utils/manifest.ts | 3 +
packages/wxt/src/types.ts | 6 ++
3 files changed, 78 insertions(+)
diff --git a/packages/wxt/src/core/utils/__tests__/manifest.test.ts b/packages/wxt/src/core/utils/__tests__/manifest.test.ts
index 250c8b45d..a629f26d4 100644
--- a/packages/wxt/src/core/utils/__tests__/manifest.test.ts
+++ b/packages/wxt/src/core/utils/__tests__/manifest.test.ts
@@ -18,6 +18,7 @@ import {
ContentScriptEntrypoint,
Entrypoint,
OutputAsset,
+ TargetManifestVersion,
} from '../../../types';
import { wxt } from '../../wxt';
import { mock } from 'vitest-mock-extended';
@@ -198,6 +199,74 @@ describe('Manifest Utils', () => {
expect((actual.action as any).theme_icons).toEqual(themeIcons);
});
+ describe('default_state', () => {
+ it.each<{
+ browser: string;
+ manifestVersion: TargetManifestVersion;
+ type: 'browser_action' | 'action' | 'page_action';
+ shouldExist: boolean;
+ }>([
+ {
+ browser: 'chrome',
+ manifestVersion: 2,
+ type: 'browser_action',
+ shouldExist: false,
+ },
+ {
+ browser: 'chrome',
+ manifestVersion: 3,
+ type: 'action',
+ shouldExist: true,
+ },
+ {
+ browser: 'firefox',
+ manifestVersion: 2,
+ type: 'browser_action',
+ shouldExist: false,
+ },
+ {
+ browser: 'firefox',
+ manifestVersion: 3,
+ type: 'action',
+ shouldExist: true,
+ },
+ ])(
+ 'should configure default_state: $defaultState based on the $browser and mv$manifestVersion',
+ async ({ browser, manifestVersion, type, shouldExist }) => {
+ const popup = fakePopupEntrypoint({
+ options: {
+ // @ts-expect-error: Force this to be undefined when null
+ actionType: manifestVersion === 3 ? null : type,
+ defaultState: 'enabled',
+ },
+ outputDir: outDir,
+ skipped: false,
+ });
+ const buildOutput = fakeBuildOutput();
+ setFakeWxt({
+ config: {
+ browser,
+ manifestVersion,
+ outDir,
+ },
+ });
+
+ const { manifest: actual } = await generateManifest(
+ [popup],
+ buildOutput,
+ );
+
+ if (shouldExist) {
+ expect(actual[type]).toMatchObject({
+ default_state: 'enabled',
+ });
+ } else {
+ expect(actual[type].default_state).toBeUndefined();
+ }
+ },
+ );
+ });
+
it('should include default_area for Firefox in mv2', async () => {
const popup = fakePopupEntrypoint({
options: {
diff --git a/packages/wxt/src/core/utils/manifest.ts b/packages/wxt/src/core/utils/manifest.ts
index 134c36c13..a36a164f5 100644
--- a/packages/wxt/src/core/utils/manifest.ts
+++ b/packages/wxt/src/core/utils/manifest.ts
@@ -294,6 +294,9 @@ function addEntrypoints(
options.default_icon = popup.options.defaultIcon;
if (popup.options.defaultTitle)
options.default_title = popup.options.defaultTitle;
+ if (popup.options.defaultState && wxt.config.manifestVersion === 3)
+ // @ts-expect-error: Not typed by @wxt-dev/browser, but supported by Chrome
+ options.default_state = popup.options.defaultState;
if (popup.options.browserStyle)
// @ts-expect-error: Not typed by @wxt-dev/browser, but supported by Firefox
options.browser_style = popup.options.browserStyle;
diff --git a/packages/wxt/src/types.ts b/packages/wxt/src/types.ts
index 051a2ad63..06282c570 100644
--- a/packages/wxt/src/types.ts
+++ b/packages/wxt/src/types.ts
@@ -758,6 +758,12 @@ export interface PopupEntrypointOptions extends BaseEntrypointOptions {
mv2Key?: PerBrowserOption<'browser_action' | 'page_action'>;
defaultIcon?: Record;
defaultTitle?: PerBrowserOption;
+ /**
+ * Chrome only. Controls the initial enabled/disabled state of the action.
+ *
+ * @see https://developer.chrome.com/docs/extensions/reference/api/action#enabled_state
+ */
+ defaultState?: PerBrowserOption<'enabled' | 'disabled'>;
browserStyle?: PerBrowserOption;
/**
* Firefox only. Defines the part of the browser in which the button is
From a2212f7a89d8c4ce8bda6e729e5b22f47bd10049 Mon Sep 17 00:00:00 2001
From: Aaron
Date: Sun, 26 Apr 2026 20:53:11 -0500
Subject: [PATCH 151/227] chore: Update lockfile
---
bun.lock | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bun.lock b/bun.lock
index e13d5128a..db7d3d711 100644
--- a/bun.lock
+++ b/bun.lock
@@ -91,7 +91,7 @@
"@types/har-format": "*",
},
"devDependencies": {
- "@types/chrome": "^0.1.40",
+ "@types/chrome": "0.1.40",
"@types/node": "^20.0.0",
"nano-spawn": "^2.0.0",
"typescript": "^5.9.3",
From 8b530bc1c94b562574437fef613245a4d71a2bea Mon Sep 17 00:00:00 2001
From: Aaron
Date: Sun, 26 Apr 2026 18:58:58 -0700
Subject: [PATCH 152/227] fix: Use `manifestVersion` from CLI during manifest
generation (#2306)
---
packages/wxt/src/core/utils/manifest.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/wxt/src/core/utils/manifest.ts b/packages/wxt/src/core/utils/manifest.ts
index a36a164f5..fef39fea6 100644
--- a/packages/wxt/src/core/utils/manifest.ts
+++ b/packages/wxt/src/core/utils/manifest.ts
@@ -308,7 +308,7 @@ function addEntrypoints(
options.theme_icons = popup.options.themeIcons;
const actionKey =
- manifest.manifest_version === 2
+ wxt.config.manifestVersion === 2
? (popup.options.actionType ?? 'browser_action')
: wxt.config.browser === 'firefox' &&
popup.options.actionType === 'page_action'
@@ -493,7 +493,7 @@ function addDevModeCsp(manifest: Browser.runtime.Manifest): void {
const permission = `${permissionUrl}*`;
const allowedCsp = wxt.server?.origin ?? 'http://localhost:*';
- if (manifest.manifest_version === 3) {
+ if (wxt.config.manifestVersion === 3) {
addHostPermission(manifest, permission);
} else {
addPermission(manifest, permission);
@@ -502,7 +502,7 @@ function addDevModeCsp(manifest: Browser.runtime.Manifest): void {
const extensionPagesCsp = new ContentSecurityPolicy(
// @ts-expect-error: extension_pages exists, we convert MV2 CSPs to this earlier in the process
manifest.content_security_policy?.extension_pages ??
- (manifest.manifest_version === 3
+ (wxt.config.manifestVersion === 3
? DEFAULT_MV3_EXTENSION_PAGES_CSP
: DEFAULT_MV2_CSP),
);
From 0b3c3ab39d7b1706bfab6f033d232e5e152e2d0c Mon Sep 17 00:00:00 2001
From: Aaron
Date: Sun, 26 Apr 2026 21:34:10 -0500
Subject: [PATCH 153/227] ci: Remove unnecessary `--frozen-lockfile`
---
.github/actions/setup/action.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml
index 1b91d6715..c16783036 100644
--- a/.github/actions/setup/action.yml
+++ b/.github/actions/setup/action.yml
@@ -18,4 +18,4 @@ runs:
- name: 📦 Install Dependencies
if: ${{ inputs.install == 'true' }}
shell: bash
- run: bun ci ${{ inputs.installArgs }} --frozen-lockfile
+ run: bun ci ${{ inputs.installArgs }}
From e45b1fb8df436f898e395fda43363d2eef937262 Mon Sep 17 00:00:00 2001
From: Aaron
Date: Sun, 26 Apr 2026 19:46:00 -0700
Subject: [PATCH 154/227] chore: Move `createFileReloader` into it's own file
(#2307)
---
packages/wxt/src/core/create-server.ts | 181 +-----------------
.../src/core/utils/create-file-reloader.ts | 166 ++++++++++++++++
2 files changed, 172 insertions(+), 175 deletions(-)
create mode 100644 packages/wxt/src/core/utils/create-file-reloader.ts
diff --git a/packages/wxt/src/core/create-server.ts b/packages/wxt/src/core/create-server.ts
index 8cebff66d..da748345f 100644
--- a/packages/wxt/src/core/create-server.ts
+++ b/packages/wxt/src/core/create-server.ts
@@ -1,35 +1,15 @@
-import { debounce } from 'perfect-debounce';
import chokidar from 'chokidar';
-import {
- BuildStepOutput,
- EntrypointGroup,
- InlineConfig,
- ServerInfo,
- WxtDevServer,
-} from '../types';
-import { getEntrypointBundlePath, isHtmlEntrypoint } from './utils/entrypoints';
-import {
- getContentScriptCssFiles,
- getContentScriptsCssMap,
-} from './utils/manifest';
-import {
- internalBuild,
- detectDevChanges,
- rebuild,
- findEntrypoints,
-} from './utils/building';
+import { InlineConfig, ServerInfo, WxtDevServer } from '../types';
+import { internalBuild } from './utils/building';
import { createExtensionRunner } from './runners';
-import { Mutex } from 'async-mutex';
-import { relative } from 'node:path';
import { deinitWxtModules, initWxtModules, registerWxt, wxt } from './wxt';
import { unnormalizePath } from './utils/paths';
-import {
- getContentScriptJs,
- mapWxtOptionsToRegisteredContentScript,
-} from './utils/content-scripts';
import { createKeyboardShortcuts } from './keyboard-shortcuts';
import { isBabelSyntaxError, logBabelSyntaxError } from './utils/syntax-errors';
-import { styleText } from 'node:util';
+import {
+ createFileReloader,
+ reloadContentScripts,
+} from './utils/create-file-reloader';
/**
* Creates a dev server and pre-builds all the files that need to exist before
@@ -199,155 +179,6 @@ async function createServerInternal(): Promise {
return server;
}
-/**
- * Returns a function responsible for reloading different parts of the extension
- * when a file changes.
- */
-function createFileReloader(server: WxtDevServer) {
- const fileChangedMutex = new Mutex();
- const changeQueue: Array<[string, string]> = [];
-
- const cb = async (event: string, path: string) => {
- changeQueue.push([event, path]);
-
- const reloading = fileChangedMutex.runExclusive(async () => {
- if (server.currentOutput == null) return;
-
- const fileChanges = changeQueue
- .splice(0, changeQueue.length)
- .map(([_, file]) => file);
- if (fileChanges.length === 0) return;
-
- await wxt.reloadConfig();
-
- const changes = detectDevChanges(fileChanges, server.currentOutput);
- if (changes.type === 'no-change') return;
-
- if (changes.type === 'full-restart') {
- wxt.logger.info('Config changed, restarting server...');
- server.restart();
- return;
- }
-
- if (changes.type === 'browser-restart') {
- wxt.logger.info('Runner config changed, restarting browser...');
- server.restartBrowser();
- return;
- }
-
- // Log the entrypoints that were effected
- wxt.logger.info(
- `Changed: ${Array.from(new Set(fileChanges))
- .map((file) => styleText('dim', relative(wxt.config.root, file)))
- .join(', ')}`,
- );
-
- // Rebuild entrypoints on change
- const allEntrypoints = await findEntrypoints();
- try {
- const { output: newOutput } = await rebuild(
- allEntrypoints,
- // TODO: this excludes new entrypoints, so they're not built until the dev command is restarted
- changes.rebuildGroups,
- changes.cachedOutput,
- );
- server.currentOutput = newOutput;
-
- // Perform reloads
- switch (changes.type) {
- case 'extension-reload':
- server.reloadExtension();
- wxt.logger.success(`Reloaded extension`);
- break;
- case 'html-reload':
- const { reloadedNames } = reloadHtmlPages(
- changes.rebuildGroups,
- server,
- );
- wxt.logger.success(`Reloaded: ${getFilenameList(reloadedNames)}`);
- break;
- case 'content-script-reload':
- reloadContentScripts(changes.changedSteps, server);
-
- const rebuiltNames = changes.rebuildGroups
- .flat()
- .map((entry) => entry.name);
- wxt.logger.success(`Reloaded: ${getFilenameList(rebuiltNames)}`);
- break;
- }
- } catch {
- // Catch build errors instead of crashing. Don't log error either, builder should have already logged it
- }
- });
-
- await reloading.catch((error) => {
- if (!isBabelSyntaxError(error)) {
- throw error;
- }
- // Log syntax errors without crashing the server.
- logBabelSyntaxError(error);
- });
- };
-
- return debounce(cb, wxt.config.dev.server!.watchDebounce, {
- leading: true,
- trailing: false,
- });
-}
-
-/**
- * From the server, tell the client to reload content scripts from the provided
- * build step outputs.
- */
-function reloadContentScripts(steps: BuildStepOutput[], server: WxtDevServer) {
- if (wxt.config.manifestVersion === 3) {
- steps.forEach((step) => {
- if (server.currentOutput == null) return;
-
- const entry = step.entrypoints;
- if (Array.isArray(entry) || entry.type !== 'content-script') return;
-
- const js = getContentScriptJs(wxt.config, entry);
- const cssMap = getContentScriptsCssMap(server.currentOutput, [entry]);
- const css = getContentScriptCssFiles([entry], cssMap);
-
- server.reloadContentScript({
- registration: entry.options.registration,
- contentScript: mapWxtOptionsToRegisteredContentScript(
- entry.options,
- js,
- css,
- ),
- });
- });
- } else {
- server.reloadExtension();
- }
-}
-
-function reloadHtmlPages(
- groups: EntrypointGroup[],
- server: WxtDevServer,
-): { reloadedNames: string[] } {
- // groups might contain other files like background/content scripts, and we only care about the HTMl pages
- const htmlEntries = groups.flat().filter(isHtmlEntrypoint);
-
- htmlEntries.forEach((entry) => {
- const path = getEntrypointBundlePath(entry, wxt.config.outDir, '.html');
- server.reloadPage(path);
- });
-
- return {
- reloadedNames: htmlEntries.map((entry) => entry.name),
- };
-}
-
-function getFilenameList(names: string[]): string {
- return names
- .map((name) => styleText('cyan', name))
- .join(styleText('dim', ', '));
-}
-
/**
* Based on the current build output, return a list of files that are:
*
diff --git a/packages/wxt/src/core/utils/create-file-reloader.ts b/packages/wxt/src/core/utils/create-file-reloader.ts
new file mode 100644
index 000000000..e12ae09e3
--- /dev/null
+++ b/packages/wxt/src/core/utils/create-file-reloader.ts
@@ -0,0 +1,166 @@
+import { debounce } from 'perfect-debounce';
+import { Mutex } from 'async-mutex';
+import { relative } from 'node:path';
+import { BuildStepOutput, EntrypointGroup, WxtDevServer } from '../../types';
+import { wxt } from '../wxt';
+import { detectDevChanges, findEntrypoints, rebuild } from './building';
+import { getEntrypointBundlePath, isHtmlEntrypoint } from './entrypoints';
+import { getContentScriptCssFiles, getContentScriptsCssMap } from './manifest';
+import {
+ getContentScriptJs,
+ mapWxtOptionsToRegisteredContentScript,
+} from './content-scripts';
+import { isBabelSyntaxError, logBabelSyntaxError } from './syntax-errors';
+import { styleText } from 'node:util';
+
+/**
+ * Returns a function responsible for reloading different parts of the extension
+ * when a file changes.
+ */
+export function createFileReloader(server: WxtDevServer) {
+ const fileChangedMutex = new Mutex();
+ const changeQueue: Array<[string, string]> = [];
+
+ const cb = async (event: string, path: string) => {
+ changeQueue.push([event, path]);
+
+ const reloading = fileChangedMutex.runExclusive(async () => {
+ if (server.currentOutput == null) return;
+
+ const fileChanges = changeQueue
+ .splice(0, changeQueue.length)
+ .map(([_, file]) => file);
+ if (fileChanges.length === 0) return;
+
+ await wxt.reloadConfig();
+
+ const changes = detectDevChanges(fileChanges, server.currentOutput);
+ if (changes.type === 'no-change') return;
+
+ if (changes.type === 'full-restart') {
+ wxt.logger.info('Config changed, restarting server...');
+ server.restart();
+ return;
+ }
+
+ if (changes.type === 'browser-restart') {
+ wxt.logger.info('Runner config changed, restarting browser...');
+ server.restartBrowser();
+ return;
+ }
+
+ // Log the entrypoints that were effected
+ wxt.logger.info(
+ `Changed: ${Array.from(new Set(fileChanges))
+ .map((file) => styleText('dim', relative(wxt.config.root, file)))
+ .join(', ')}`,
+ );
+
+ // Rebuild entrypoints on change
+ const allEntrypoints = await findEntrypoints();
+ try {
+ const { output: newOutput } = await rebuild(
+ allEntrypoints,
+ // TODO: this excludes new entrypoints, so they're not built until the dev command is restarted
+ changes.rebuildGroups,
+ changes.cachedOutput,
+ );
+ server.currentOutput = newOutput;
+
+ // Perform reloads
+ switch (changes.type) {
+ case 'extension-reload':
+ server.reloadExtension();
+ wxt.logger.success(`Reloaded extension`);
+ break;
+ case 'html-reload':
+ const { reloadedNames } = reloadHtmlPages(
+ changes.rebuildGroups,
+ server,
+ );
+ wxt.logger.success(`Reloaded: ${getFilenameList(reloadedNames)}`);
+ break;
+ case 'content-script-reload':
+ reloadContentScripts(changes.changedSteps, server);
+
+ const rebuiltNames = changes.rebuildGroups
+ .flat()
+ .map((entry) => entry.name);
+ wxt.logger.success(`Reloaded: ${getFilenameList(rebuiltNames)}`);
+ break;
+ }
+ } catch {
+ // Catch build errors instead of crashing. Don't log error either, builder should have already logged it
+ }
+ });
+
+ await reloading.catch((error) => {
+ if (!isBabelSyntaxError(error)) {
+ throw error;
+ }
+ // Log syntax errors without crashing the server.
+ logBabelSyntaxError(error);
+ });
+ };
+
+ return debounce(cb, wxt.config.dev.server!.watchDebounce, {
+ leading: true,
+ trailing: false,
+ });
+}
+
+/**
+ * From the server, tell the client to reload content scripts from the provided
+ * build step outputs.
+ */
+export function reloadContentScripts(
+ steps: BuildStepOutput[],
+ server: WxtDevServer,
+) {
+ if (wxt.config.manifestVersion === 3) {
+ steps.forEach((step) => {
+ if (server.currentOutput == null) return;
+
+ const entry = step.entrypoints;
+ if (Array.isArray(entry) || entry.type !== 'content-script') return;
+
+ const js = getContentScriptJs(wxt.config, entry);
+ const cssMap = getContentScriptsCssMap(server.currentOutput, [entry]);
+ const css = getContentScriptCssFiles([entry], cssMap);
+
+ server.reloadContentScript({
+ registration: entry.options.registration,
+ contentScript: mapWxtOptionsToRegisteredContentScript(
+ entry.options,
+ js,
+ css,
+ ),
+ });
+ });
+ } else {
+ server.reloadExtension();
+ }
+}
+
+function reloadHtmlPages(
+ groups: EntrypointGroup[],
+ server: WxtDevServer,
+): { reloadedNames: string[] } {
+ // groups might contain other files like background/content scripts, and we only care about the HTMl pages
+ const htmlEntries = groups.flat().filter(isHtmlEntrypoint);
+
+ htmlEntries.forEach((entry) => {
+ const path = getEntrypointBundlePath(entry, wxt.config.outDir, '.html');
+ server.reloadPage(path);
+ });
+
+ return {
+ reloadedNames: htmlEntries.map((entry) => entry.name),
+ };
+}
+
+function getFilenameList(names: string[]): string {
+ return names
+ .map((name) => styleText('cyan', name))
+ .join(styleText('dim', ', '));
+}
From b21ec34a655e157ccd88586ca39c82c17d4a12ee Mon Sep 17 00:00:00 2001
From: Aaron
Date: Sun, 26 Apr 2026 20:11:04 -0700
Subject: [PATCH 155/227] chore: Upgrade bun to 1.3.13 (#2309)
---
.tool-versions | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.tool-versions b/.tool-versions
index 066a07c57..94220262e 100644
--- a/.tool-versions
+++ b/.tool-versions
@@ -1,2 +1,2 @@
-bun 1.3.12
+bun 1.3.13
nodejs 24.14.1
From e75e534882963a6a145bac37b38df90a68e155c1 Mon Sep 17 00:00:00 2001
From: Aaron
Date: Sun, 26 Apr 2026 20:26:24 -0700
Subject: [PATCH 156/227] chore: Keep lockfile in sync when generating
`@wxt-dev/browser` (#2310)
---
packages/browser/scripts/generate.ts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/packages/browser/scripts/generate.ts b/packages/browser/scripts/generate.ts
index acd4ea16a..26f914718 100644
--- a/packages/browser/scripts/generate.ts
+++ b/packages/browser/scripts/generate.ts
@@ -58,6 +58,8 @@ for (const { file, srcPath, destPath } of declarationFileMapping) {
console.log(` ${styleText('dim', '-')} ${styleText('cyan', file)}`);
}
+await Bun.$`bun install --ignore-scripts`;
+
// Done!
console.log(
From c15167ca86ac954d03bdd70be14515379f237072 Mon Sep 17 00:00:00 2001
From: laplace-anon <150580554+laplace-anon@users.noreply.github.com>
Date: Fri, 1 May 2026 06:27:12 +0800
Subject: [PATCH 157/227] fix: Modify command to support variadic positional
args (#2317)
---
cspell.yml | 2 ++
packages/wxt/src/cli/cli-utils.ts | 6 +++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/cspell.yml b/cspell.yml
index c390c372a..92fa18b5e 100644
--- a/cspell.yml
+++ b/cspell.yml
@@ -11,6 +11,7 @@ ignorePaths:
- patches/**
- '**/*.snap'
- docs/assets/extension-showcase.yml
+ - packages/*/stats.html
words:
- Aabid
- aabidk
@@ -21,6 +22,7 @@ words:
- buildc
- bunx
- cachable
+ - cacjs
- charmbracelet
- chromedriver
- Cira
diff --git a/packages/wxt/src/cli/cli-utils.ts b/packages/wxt/src/cli/cli-utils.ts
index 015652735..f7c849ffe 100644
--- a/packages/wxt/src/cli/cli-utils.ts
+++ b/packages/wxt/src/cli/cli-utils.ts
@@ -82,8 +82,12 @@ export function createAliasedCommand(
bin: string,
docsUrl: string,
) {
+ // Declare a variadic positional arg so cac forwards subcommands like `wxt
+ // submit init` instead of rejecting them as unused args. `.allowUnknownOptions`
+ // only relaxes flag checks, not positional args. Required since cac@7, which
+ // throws on unused positional args (see cacjs/cac#135).
const aliasedCommand = base
- .command(name, `Alias for ${alias} (${docsUrl})`)
+ .command(`${name} [...args]`, `Alias for ${alias} (${docsUrl})`)
.allowUnknownOptions()
.action(async () => {
try {
From a7976d2e63365db66db2bc99afeb065cf5335d01 Mon Sep 17 00:00:00 2001
From: aklinker1 <10101283+aklinker1@users.noreply.github.com>
Date: Fri, 8 May 2026 00:57:25 +0000
Subject: [PATCH 158/227] fix: Upgrade `@wxt-dev/browser` to latest
`@types/chrome` version
---
bun.lock | 6 +-
packages/browser/package.json | 4 +-
.../browser/src/gen/chrome-cast/index.d.ts | 1 +
.../browser/src/gen/har-format/index.d.ts | 4 +-
packages/browser/src/gen/index.d.ts | 3363 +++++++++--------
5 files changed, 1690 insertions(+), 1688 deletions(-)
diff --git a/bun.lock b/bun.lock
index db7d3d711..0f9609350 100644
--- a/bun.lock
+++ b/bun.lock
@@ -85,13 +85,13 @@
},
"packages/browser": {
"name": "@wxt-dev/browser",
- "version": "0.1.40",
+ "version": "0.1.42",
"dependencies": {
"@types/filesystem": "*",
"@types/har-format": "*",
},
"devDependencies": {
- "@types/chrome": "0.1.40",
+ "@types/chrome": "0.1.42",
"@types/node": "^20.0.0",
"nano-spawn": "^2.0.0",
"typescript": "^5.9.3",
@@ -1039,7 +1039,7 @@
"@types/chai": ["@types/chai@5.2.3", "", { "dependencies": { "@types/deep-eql": "*", "assertion-error": "^2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="],
- "@types/chrome": ["@types/chrome@0.1.40", "", { "dependencies": { "@types/filesystem": "*", "@types/har-format": "*" } }, "sha512-UnfyRAe8ORu9HSuTH0EqyOEUin3JrWW9Nl/gDXezNfTUrfIoxw+WRZgKOxGz0t5BnjbfXBnS2eCYfW2PxH1wcA=="],
+ "@types/chrome": ["@types/chrome@0.1.42", "", { "dependencies": { "@types/filesystem": "*", "@types/har-format": "*" } }, "sha512-tdT2roFqGecZZDjA9fUEAINb2STxSPifHMDvY6EfRjNRCjdrs/0FwKt5RCIA9MKMd1arAYZZL3nwEkp6ZLZu2w=="],
"@types/debug": ["@types/debug@4.1.12", "", { "dependencies": { "@types/ms": "*" } }, "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ=="],
diff --git a/packages/browser/package.json b/packages/browser/package.json
index b3d27acac..b70b31b96 100644
--- a/packages/browser/package.json
+++ b/packages/browser/package.json
@@ -1,7 +1,7 @@
{
"name": "@wxt-dev/browser",
"description": "Provides a cross-browser API for using extension APIs and types based on @types/chrome",
- "version": "0.1.40",
+ "version": "0.1.42",
"type": "module",
"main": "src/index.mjs",
"types": "src/index.d.ts",
@@ -25,7 +25,7 @@
"src"
],
"devDependencies": {
- "@types/chrome": "0.1.40",
+ "@types/chrome": "0.1.42",
"@types/node": "^20.0.0",
"nano-spawn": "^2.0.0",
"typescript": "^5.9.3",
diff --git a/packages/browser/src/gen/chrome-cast/index.d.ts b/packages/browser/src/gen/chrome-cast/index.d.ts
index 2b4ded948..1f8236bf4 100644
--- a/packages/browser/src/gen/chrome-cast/index.d.ts
+++ b/packages/browser/src/gen/chrome-cast/index.d.ts
@@ -1,5 +1,6 @@
/* DO NOT EDIT - generated by scripts/generate.ts */
+/* eslint-disable @definitelytyped/strict-export-declare-modifiers */
/* eslint-disable @typescript-eslint/no-wrapper-object-types */
export namespace Browser {
////////////////////
diff --git a/packages/browser/src/gen/har-format/index.d.ts b/packages/browser/src/gen/har-format/index.d.ts
index 9827a59f1..3592a3044 100644
--- a/packages/browser/src/gen/har-format/index.d.ts
+++ b/packages/browser/src/gen/har-format/index.d.ts
@@ -3,7 +3,7 @@
import { Entry, Log } from "har-format";
declare global {
- export type HARFormatEntry = Entry;
- export type HARFormatLog = Log;
+ type HARFormatEntry = Entry;
+ type HARFormatLog = Log;
}
diff --git a/packages/browser/src/gen/index.d.ts b/packages/browser/src/gen/index.d.ts
index f9fe80174..94b998504 100644
--- a/packages/browser/src/gen/index.d.ts
+++ b/packages/browser/src/gen/index.d.ts
@@ -26,14 +26,14 @@ export namespace Browser {
*/
export namespace accessibilityFeatures {
/** `get()` requires `accessibilityFeatures.read` permission. `set()` and `clear()` require `accessibilityFeatures.modify` permission. */
- export const animationPolicy: Browser.types.ChromeSetting<"allowed" | "once" | "none">;
+ const animationPolicy: Browser.types.ChromeSetting<"allowed" | "once" | "none">;
/**
* Auto mouse click after mouse stops moving. The value indicates whether the feature is enabled or not.
* `get()` requires `accessibilityFeatures.read` permission. `set()` and `clear()` require `accessibilityFeatures.modify` permission.
* @platform ChromeOS only
*/
- export const autoclick: Browser.types.ChromeSetting;
+ const autoclick: Browser.types.ChromeSetting;
/**
* Caret highlighting. The value indicates whether the feature is enabled or not.
@@ -41,7 +41,7 @@ export namespace Browser {
* @platform ChromeOS only
* @since Chrome 51
*/
- export const caretHighlight: Browser.types.ChromeSetting;
+ const caretHighlight: Browser.types.ChromeSetting;
/**
* Cursor color. The value indicates whether the feature is enabled or not, doesn't indicate the color of it.
@@ -49,7 +49,7 @@ export namespace Browser {
* @platform ChromeOS only
* @since Chrome 85
*/
- export const cursorColor: Browser.types.ChromeSetting;
+ const cursorColor: Browser.types.ChromeSetting;
/**
* Cursor highlighting. The value indicates whether the feature is enabled or not.
@@ -57,7 +57,7 @@ export namespace Browser {
* @platform ChromeOS only
* @since Chrome 51
*/
- export const cursorHighlight: Browser.types.ChromeSetting;
+ const cursorHighlight: Browser.types.ChromeSetting;
/**
* Dictation. The value indicates whether the feature is enabled or not.
@@ -65,7 +65,7 @@ export namespace Browser {
* @platform ChromeOS only
* @since Chrome 90
*/
- export const dictation: Browser.types.ChromeSetting;
+ const dictation: Browser.types.ChromeSetting;
/**
* Docked magnifier. The value indicates whether docked magnifier feature is enabled or not.
@@ -73,7 +73,7 @@ export namespace Browser {
* @platform ChromeOS only
* @since Chrome 87
*/
- export const dockedMagnifier: Browser.types.ChromeSetting;
+ const dockedMagnifier: Browser.types.ChromeSetting;
/**
* Focus highlighting. The value indicates whether the feature is enabled or not.
@@ -81,28 +81,28 @@ export namespace Browser {
* @platform ChromeOS only
* @since Chrome 51
*/
- export const focusHighlight: Browser.types.ChromeSetting;
+ const focusHighlight: Browser.types.ChromeSetting;
/**
* High contrast rendering mode. The value indicates whether the feature is enabled or not.
* `get()` requires `accessibilityFeatures.read` permission. `set()` and `clear()` require `accessibilityFeatures.modify` permission.
* @platform ChromeOS only
*/
- export const highContrast: Browser.types.ChromeSetting;
+ const highContrast: Browser.types.ChromeSetting;
/**
* Enlarged cursor. The value indicates whether the feature is enabled or not.
* `get()` requires `accessibilityFeatures.read` permission. `set()` and `clear()` require `accessibilityFeatures.modify` permission.
* @platform ChromeOS only
*/
- export const largeCursor: Browser.types.ChromeSetting;
+ const largeCursor: Browser.types.ChromeSetting;
/**
* Full screen magnification. The value indicates whether the feature is enabled or not.
* `get()` requires `accessibilityFeatures.read` permission. `set()` and `clear()` require `accessibilityFeatures.modify` permission.
* @platform ChromeOS only
*/
- export const screenMagnifier: Browser.types.ChromeSetting;
+ const screenMagnifier: Browser.types.ChromeSetting;
/**
* Select-to-speak. The value indicates whether the feature is enabled or not.
@@ -110,21 +110,21 @@ export namespace Browser {
* @platform ChromeOS only
* @since Chrome 51
*/
- export const selectToSpeak: Browser.types.ChromeSetting;
+ const selectToSpeak: Browser.types.ChromeSetting;
/**
* Spoken feedback (text-to-speech). The value indicates whether the feature is enabled or not.
* `get()` requires `accessibilityFeatures.read` permission. `set()` and `clear()` require `accessibilityFeatures.modify` permission.
* @platform ChromeOS only
*/
- export const spokenFeedback: Browser.types.ChromeSetting;
+ const spokenFeedback: Browser.types.ChromeSetting;
/**
* Sticky modifier keys (like shift or alt). The value indicates whether the feature is enabled or not.
* `get()` requires `accessibilityFeatures.read` permission. `set()` and `clear()` require `accessibilityFeatures.modify` permission.
* @platform ChromeOS only
*/
- export const stickyKeys: Browser.types.ChromeSetting;
+ const stickyKeys: Browser.types.ChromeSetting;
/**
* Switch Access. The value indicates whether the feature is enabled or not.
@@ -132,14 +132,14 @@ export namespace Browser {
* @platform ChromeOS only
* @since Chrome 51
*/
- export const switchAccess: Browser.types.ChromeSetting;
+ const switchAccess: Browser.types.ChromeSetting;
/**
* Virtual on-screen keyboard. The value indicates whether the feature is enabled or not.
* `get()` requires `accessibilityFeatures.read` permission. `set()` and `clear()` require `accessibilityFeatures.modify` permission.
* @platform ChromeOS only
*/
- export const virtualKeyboard: Browser.types.ChromeSetting;
+ const virtualKeyboard: Browser.types.ChromeSetting;
}
////////////////////
@@ -153,35 +153,35 @@ export namespace Browser {
* @since Chrome 88, MV3
*/
export namespace action {
- export interface BadgeColorDetails {
+ interface BadgeColorDetails {
/** An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is `[255, 0, 0, 255]`. Can also be a string with a CSS value, with opaque red being `#FF0000` or `#F00`. */
color: string | extensionTypes.ColorArray;
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
tabId?: number | undefined;
}
- export interface BadgeTextDetails {
+ interface BadgeTextDetails {
/** Any number of characters can be passed, but only about four can fit in the space. If an empty string (`''`) is passed, the badge text is cleared. If `tabId` is specified and `text` is null, the text for the specified tab is cleared and defaults to the global badge text. */
text?: string | undefined;
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
tabId?: number | undefined;
}
- export interface TitleDetails {
+ interface TitleDetails {
/** The string the action should display when moused over. */
title: string;
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
tabId?: number | undefined;
}
- export interface PopupDetails {
+ interface PopupDetails {
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
tabId?: number | undefined;
/** The html file to show in a popup. If set to the empty string (`''`), no popup is shown. */
popup: string;
}
- export interface TabIconDetails {
+ interface TabIconDetails {
/** Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` \* n will be selected, where n is the size of the icon in the UI. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.path = {'16': foo}' */
path?: string | { [index: number]: string } | undefined;
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
@@ -191,12 +191,12 @@ export namespace Browser {
}
/** @since Chrome 99 */
- export interface OpenPopupOptions {
+ interface OpenPopupOptions {
/** The id of the window to open the action popup in. Defaults to the currently-active window if unspecified. */
windowId?: number | undefined;
}
- export interface TabDetails {
+ interface TabDetails {
/** The ID of the tab to query state for. If no tab is specified, the non-tab-specific state is returned. */
tabId?: number | undefined;
}
@@ -205,13 +205,13 @@ export namespace Browser {
* The collection of user-specified settings relating to an extension's action.
* @since Chrome 91
*/
- export interface UserSettings {
+ interface UserSettings {
/** Whether the extension's action icon is visible on browser windows' top-level toolbar (i.e., whether the extension has been 'pinned' by the user). */
isOnToolbar: boolean;
}
/** @since Chrome 130 */
- export interface UserSettingsChange {
+ interface UserSettingsChange {
/** Whether the extension's action icon is visible on browser windows' top-level toolbar (i.e., whether the extension has been 'pinned' by the user). */
isOnToolbar?: boolean;
}
@@ -222,9 +222,9 @@ export namespace Browser {
*
* Can return its result via Promise.
*/
- export function disable(tabId?: number): Promise;
- export function disable(callback: () => void): void;
- export function disable(tabId: number | undefined, callback: () => void): void;
+ function disable(tabId?: number): Promise;
+ function disable(callback: () => void): void;
+ function disable(tabId: number | undefined, callback: () => void): void;
/**
* Enables the action for a tab. By default, actions are enabled.
@@ -232,17 +232,17 @@ export namespace Browser {
*
* Can return its result via Promise.
*/
- export function enable(tabId?: number): Promise;
- export function enable(callback: () => void): void;
- export function enable(tabId: number | undefined, callback: () => void): void;
+ function enable(tabId?: number): Promise;
+ function enable(callback: () => void): void;
+ function enable(tabId: number | undefined, callback: () => void): void;
/**
* Gets the background color of the action.
*
* Can return its result via Promise.
*/
- export function getBadgeBackgroundColor(details: TabDetails): Promise;
- export function getBadgeBackgroundColor(
+ function getBadgeBackgroundColor(details: TabDetails): Promise;
+ function getBadgeBackgroundColor(
details: TabDetails,
callback: (result: extensionTypes.ColorArray) => void,
): void;
@@ -252,8 +252,8 @@ export namespace Browser {
*
* Can return its result via Promise.
*/
- export function getBadgeText(details: TabDetails): Promise;
- export function getBadgeText(details: TabDetails, callback: (result: string) => void): void;
+ function getBadgeText(details: TabDetails): Promise;
+ function getBadgeText(details: TabDetails, callback: (result: string) => void): void;
/**
* Gets the text color of the action.
@@ -261,8 +261,8 @@ export namespace Browser {
* Can return its result via Promise.
* @since Chrome 110
*/
- export function getBadgeTextColor(details: TabDetails): Promise;
- export function getBadgeTextColor(
+ function getBadgeTextColor(details: TabDetails): Promise;
+ function getBadgeTextColor(
details: TabDetails,
callback: (result: extensionTypes.ColorArray) => void,
): void;
@@ -272,16 +272,16 @@ export namespace Browser {
*
* Can return its result via Promise.
*/
- export function getPopup(details: TabDetails): Promise;
- export function getPopup(details: TabDetails, callback: (result: string) => void): void;
+ function getPopup(details: TabDetails): Promise;
+ function getPopup(details: TabDetails, callback: (result: string) => void): void;
/**
* Gets the title of the action.
*
* Can return its result via Promise.
*/
- export function getTitle(details: TabDetails): Promise;
- export function getTitle(details: TabDetails, callback: (result: string) => void): void;
+ function getTitle(details: TabDetails): Promise;
+ function getTitle(details: TabDetails, callback: (result: string) => void): void;
/**
* Returns the user-specified settings relating to an extension's action.
@@ -289,8 +289,8 @@ export namespace Browser {
* Can return its result via Promise.
* @since Chrome 91
*/
- export function getUserSettings(): Promise;
- export function getUserSettings(callback: (userSettings: UserSettings) => void): void;
+ function getUserSettings(): Promise;
+ function getUserSettings(callback: (userSettings: UserSettings) => void): void;
/**
* Indicates whether the extension action is enabled for a tab (or globally if no `tabId` is provided). Actions enabled using only {@link declarativeContent} always return false.
@@ -298,9 +298,9 @@ export namespace Browser {
* Can return its result via Promise.
* @since Chrome 110
*/
- export function isEnabled(tabId?: number): Promise;
- export function isEnabled(callback: (isEnabled: boolean) => void): void;
- export function isEnabled(tabId: number | undefined, callback: (isEnabled: boolean) => void): void;
+ function isEnabled(tabId?: number): Promise;
+ function isEnabled(callback: (isEnabled: boolean) => void): void;
+ function isEnabled(tabId: number | undefined, callback: (isEnabled: boolean) => void): void;
/**
* Opens the extension's popup. Between Chrome 118 and Chrome 126, this is only available to policy installed extensions.
@@ -310,25 +310,25 @@ export namespace Browser {
* Can return its result via Promise.
* @since Chrome 127
*/
- export function openPopup(options?: OpenPopupOptions): Promise;
- export function openPopup(callback: () => void): void;
- export function openPopup(options: OpenPopupOptions | undefined, callback: () => void): void;
+ function openPopup(options?: OpenPopupOptions): Promise;
+ function openPopup(callback: () => void): void;
+ function openPopup(options: OpenPopupOptions | undefined, callback: () => void): void;
/**
* Sets the background color for the badge.
*
* Can return its result via Promise.
*/
- export function setBadgeBackgroundColor(details: BadgeColorDetails): Promise;
- export function setBadgeBackgroundColor(details: BadgeColorDetails, callback: () => void): void;
+ function setBadgeBackgroundColor(details: BadgeColorDetails): Promise;
+ function setBadgeBackgroundColor(details: BadgeColorDetails, callback: () => void): void;
/**
* Sets the badge text for the action. The badge is displayed on top of the icon.
*
* Can return its result via Promise.
*/
- export function setBadgeText(details: BadgeTextDetails): Promise;
- export function setBadgeText(details: BadgeTextDetails, callback: () => void): void;
+ function setBadgeText(details: BadgeTextDetails): Promise;
+ function setBadgeText(details: BadgeTextDetails, callback: () => void): void;
/**
* Sets the text color for the badge.
@@ -336,16 +336,16 @@ export namespace Browser {
* Can return its result via Promise.
* @since Chrome 110
*/
- export function setBadgeTextColor(details: BadgeColorDetails): Promise;
- export function setBadgeTextColor(details: BadgeColorDetails, callback: () => void): void;
+ function setBadgeTextColor(details: BadgeColorDetails): Promise;
+ function setBadgeTextColor(details: BadgeColorDetails, callback: () => void): void;
/**
* Sets the icon for the action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
*
* Can return its result via Promise.
*/
- export function setIcon(details: TabIconDetails): Promise;
- export function setIcon(details: TabIconDetails, callback: () => void): void;
+ function setIcon(details: TabIconDetails): Promise;
+ function setIcon(details: TabIconDetails, callback: () => void): void;
/**
* Sets the HTML document to be opened as a popup when the user clicks on the action's icon.
@@ -353,25 +353,25 @@ export namespace Browser {
* Can return its result via Promise.
* @since Chrome 96
*/
- export function setPopup(details: PopupDetails): Promise;
- export function setPopup(details: PopupDetails, callback: () => void): void;
+ function setPopup(details: PopupDetails): Promise;
+ function setPopup(details: PopupDetails, callback: () => void): void;
/**
* Sets the title of the action. This shows up in the tooltip.
*
* Can return its result via Promise.
*/
- export function setTitle(details: TitleDetails): Promise;
- export function setTitle(details: TitleDetails, callback: () => void): void;
+ function setTitle(details: TitleDetails): Promise;
+ function setTitle(details: TitleDetails, callback: () => void): void;
/** Fired when an action icon is clicked. This event will not fire if the action has a popup. */
- export const onClicked: events.Event<(tab: Browser.tabs.Tab) => void>;
+ const onClicked: events.Event<(tab: Browser.tabs.Tab) => void>;
/**
* Fired when user-specified settings relating to an extension's action change.
* @since Chrome 130
*/
- export const onUserSettingsChanged: events.Event<(change: UserSettingsChange) => void>;
+ const onUserSettingsChanged: events.Event<(change: UserSettingsChange) => void>;
}
////////////////////
@@ -383,7 +383,7 @@ export namespace Browser {
* Permissions: "alarms"
*/
export namespace alarms {
- export interface AlarmCreateInfo {
+ interface AlarmCreateInfo {
/** Length of time in minutes after which the {@link onAlarm} event should fire. */
delayInMinutes?: number | undefined;
/** If set, the onAlarm event should fire every `periodInMinutes` minutes after the initial event specified by `when` or `delayInMinutes`. If not set, the alarm will only fire once. */
@@ -392,7 +392,7 @@ export namespace Browser {
when?: number | undefined;
}
- export interface Alarm {
+ interface Alarm {
/** If not null, the alarm is a repeating alarm and will fire again in `periodInMinutes` minutes. */
periodInMinutes?: number;
/** Time at which this alarm was scheduled to fire, in milliseconds past the epoch (e.g. `Date.now() + n`). For performance reasons, the alarm may have been delayed an arbitrary amount beyond this. */
@@ -412,35 +412,35 @@ export namespace Browser {
*
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
*/
- export function create(alarmInfo: AlarmCreateInfo): Promise;
- export function create(name: string | undefined, alarmInfo: AlarmCreateInfo): Promise;
- export function create(alarmInfo: AlarmCreateInfo, callback: () => void): void;
- export function create(name: string | undefined, alarmInfo: AlarmCreateInfo, callback: () => void): void;
+ function create(alarmInfo: AlarmCreateInfo): Promise;
+ function create(name: string | undefined, alarmInfo: AlarmCreateInfo): Promise;
+ function create(alarmInfo: AlarmCreateInfo, callback: () => void): void;
+ function create(name: string | undefined, alarmInfo: AlarmCreateInfo, callback: () => void): void;
/**
* Gets an array of all the alarms.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 91.
*/
- export function getAll(): Promise;
- export function getAll(callback: (alarms: Alarm[]) => void): void;
+ function getAll(): Promise;
+ function getAll(callback: (alarms: Alarm[]) => void): void;
/**
* Clears all alarms.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 91.
*/
- export function clearAll(): Promise;
- export function clearAll(callback: (wasCleared: boolean) => void): void;
+ function clearAll(): Promise;
+ function clearAll(callback: (wasCleared: boolean) => void): void;
/**
* Clears the alarm with the given name.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 91.
*/
- export function clear(name?: string): Promise;
- export function clear(callback: (wasCleared: boolean) => void): void;
- export function clear(name: string | undefined, callback: (wasCleared: boolean) => void): void;
+ function clear(name?: string): Promise;
+ function clear(callback: (wasCleared: boolean) => void): void;
+ function clear(name: string | undefined, callback: (wasCleared: boolean) => void): void;
/**
* Retrieves details about the specified alarm.
@@ -448,12 +448,12 @@ export namespace Browser {
*
* Can return its result via Promise in Manifest V3 or later since Chrome 91.
*/
- export function get(name?: string): Promise;
- export function get(callback: (alarm?: Alarm) => void): void;
- export function get(name: string | undefined, callback: (alarm?: Alarm) => void): void;
+ function get(name?: string): Promise;
+ function get(callback: (alarm?: Alarm) => void): void;
+ function get(name: string | undefined, callback: (alarm?: Alarm) => void): void;
/** Fired when an alarm has elapsed. Useful for event pages. */
- export const onAlarm: events.Event<(alarm: Alarm) => void>;
+ const onAlarm: events.Event<(alarm: Alarm) => void>;
}
////////////////////
@@ -467,7 +467,7 @@ export namespace Browser {
* @since Chrome 59
*/
export namespace audio {
- export interface AudioDeviceInfo {
+ interface AudioDeviceInfo {
/** Device name */
deviceName: string;
/** Type of the device */
@@ -486,14 +486,14 @@ export namespace Browser {
streamType: StreamType;
}
- export interface DeviceFilter {
+ interface DeviceFilter {
/** If set, only audio devices whose active state matches this value will satisfy the filter. */
isActive?: boolean;
/** If set, only audio devices whose stream type is included in this list will satisfy the filter. */
streamTypes?: StreamType[];
}
- export interface DeviceIdLists {
+ interface DeviceIdLists {
/**
* List of input devices specified by their ID.
* To indicate input devices should be unaffected, leave this property unset.
@@ -506,7 +506,7 @@ export namespace Browser {
output?: string[];
}
- export interface DeviceProperties {
+ interface DeviceProperties {
/**
* The audio device's desired sound level. Defaults to the device's current sound level.
* If used with audio input device, represents audio device gain.
@@ -516,7 +516,7 @@ export namespace Browser {
}
/** Available audio device types. */
- export enum DeviceType {
+ enum DeviceType {
ALSA_LOOPBACK = "ALSA_LOOPBACK",
BLUETOOTH = "BLUETOOTH",
FRONT_MIC = "FRONT_MIC",
@@ -535,14 +535,14 @@ export namespace Browser {
USB = "USB",
}
- export interface LevelChangedEvent {
+ interface LevelChangedEvent {
/** ID of device whose sound level has changed. */
deviceId: string;
/** The device's new sound level. */
level: number;
}
- export interface MuteChangedEvent {
+ interface MuteChangedEvent {
/** Whether or not the stream is now muted. */
isMuted: boolean;
/** The type of the stream for which the mute value changed. The updated mute value applies to all devices with this stream type. */
@@ -550,7 +550,7 @@ export namespace Browser {
}
/** Type of stream an audio device provides. */
- export enum StreamType {
+ enum StreamType {
INPUT = "INPUT",
OUTPUT = "OUTPUT",
}
@@ -559,53 +559,53 @@ export namespace Browser {
* Gets a list of audio devices filtered based on filter.
* Can return its result via Promise in Manifest V3 or later since Chrome 116.
*/
- export function getDevices(filter?: DeviceFilter): Promise;
- export function getDevices(filter: DeviceFilter, callback: (devices: AudioDeviceInfo[]) => void): void;
- export function getDevices(callback: (devices: AudioDeviceInfo[]) => void): void;
+ function getDevices(filter?: DeviceFilter): Promise;
+ function getDevices(filter: DeviceFilter, callback: (devices: AudioDeviceInfo[]) => void): void;
+ function getDevices(callback: (devices: AudioDeviceInfo[]) => void): void;
/**
* Gets the system-wide mute state for the specified stream type.
* Can return its result via Promise in Manifest V3 or later since Chrome 116.
*/
- export function getMute(streamType: `${StreamType}`): Promise;
- export function getMute(streamType: `${StreamType}`, callback: (value: boolean) => void): void;
+ function getMute(streamType: `${StreamType}`): Promise;
+ function getMute(streamType: `${StreamType}`, callback: (value: boolean) => void): void;
/**
* Sets lists of active input and/or output devices.
* Can return its result via Promise in Manifest V3 or later since Chrome 116.
*/
- export function setActiveDevices(ids: DeviceIdLists): Promise;
- export function setActiveDevices(ids: DeviceIdLists, callback: () => void): void;
+ function setActiveDevices(ids: DeviceIdLists): Promise;
+ function setActiveDevices(ids: DeviceIdLists, callback: () => void): void;
/**
* Sets mute state for a stream type. The mute state will apply to all audio devices with the specified audio stream type.
* Can return its result via Promise in Manifest V3 or later since Chrome 116.
*/
- export function setMute(streamType: `${StreamType}`, isMuted: boolean): Promise;
- export function setMute(streamType: `${StreamType}`, isMuted: boolean, callback: () => void): void;
+ function setMute(streamType: `${StreamType}`, isMuted: boolean): Promise;
+ function setMute(streamType: `${StreamType}`, isMuted: boolean, callback: () => void): void;
/**
* Sets the properties for the input or output device.
* Can return its result via Promise in Manifest V3 or later since Chrome 116.
*/
- export function setProperties(id: string, properties: DeviceProperties): Promise;
- export function setProperties(id: string, properties: DeviceProperties, callback: () => void): void;
+ function setProperties(id: string, properties: DeviceProperties): Promise;
+ function setProperties(id: string, properties: DeviceProperties, callback: () => void): void;
/**
* Fired when audio devices change, either new devices being added, or existing devices being removed.
*/
- export const onDeviceListChanged: Browser.events.Event<(devices: AudioDeviceInfo[]) => void>;
+ const onDeviceListChanged: Browser.events.Event<(devices: AudioDeviceInfo[]) => void>;
/**
* Fired when sound level changes for an active audio device.
*/
- export const onLevelChanged: Browser.events.Event<(event: LevelChangedEvent) => void>;
+ const onLevelChanged: Browser.events.Event<(event: LevelChangedEvent) => void>;
/**
* Fired when the mute state of the audio input or output changes.
* Note that mute state is system-wide and the new value applies to every audio device with specified stream type.
*/
- export const onMuteChanged: Browser.events.Event<(event: MuteChangedEvent) => void>;
+ const onMuteChanged: Browser.events.Event<(event: MuteChangedEvent) => void>;
}
////////////////////
@@ -618,7 +618,7 @@ export namespace Browser {
*/
export namespace bookmarks {
/** A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder. */
- export interface BookmarkTreeNode {
+ interface BookmarkTreeNode {
/** An ordered list of children of this node. */
children?: BookmarkTreeNode[];
/** When this node was created, in milliseconds since the epoch (`new Date(dateAdded)`). */
@@ -664,12 +664,12 @@ export namespace Browser {
* Indicates the reason why this node is unmodifiable. The `managed` value indicates that this node was configured by the system administrator. Omitted if the node can be modified by the user and the extension (default).
* @since Chrome 44
*/
- export enum BookmarkTreeNodeUnmodifiable {
+ enum BookmarkTreeNodeUnmodifiable {
MANAGED = "managed",
}
/** Object passed to the create() function. */
- export interface CreateDetails {
+ interface CreateDetails {
index?: number;
/** Defaults to the Other Bookmarks folder. */
parentId?: string;
@@ -682,7 +682,7 @@ export namespace Browser {
* @since Chrome 134
*/
- export enum FolderType {
+ enum FolderType {
/** The folder whose contents is displayed at the top of the browser window. */
BOOKMARKS_BAR = "bookmarks-bar",
/** Bookmarks which are displayed in the full list of bookmarks on all platforms. */
@@ -694,24 +694,24 @@ export namespace Browser {
}
/** @deprecated Bookmark write operations are no longer limited by Chrome. */
- export const MAX_WRITE_OPERATIONS_PER_HOUR: 1000000;
+ const MAX_WRITE_OPERATIONS_PER_HOUR: 1000000;
/** @deprecated Bookmark write operations are no longer limited by Chrome. */
- export const MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: 1000000;
+ const MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: 1000000;
/**
* The `id` associated with the root level node.
* @since Chrome 145
*/
- export const ROOT_NODE_ID = "0";
+ const ROOT_NODE_ID = "0";
/**
* Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.
*
* Can return its result via Promise since Chrome 90.
*/
- export function create(bookmark: CreateDetails): Promise;
- export function create(bookmark: CreateDetails, callback: (result: BookmarkTreeNode) => void): void;
+ function create(bookmark: CreateDetails): Promise;
+ function create(bookmark: CreateDetails, callback: (result: BookmarkTreeNode) => void): void;
/**
* Retrieves the specified BookmarkTreeNode(s).
@@ -719,8 +719,8 @@ export namespace Browser {
*
* Can return its result via Promise since Chrome 90.
*/
- export function get(idOrIdList: string | [string, ...string[]]): Promise;
- export function get(
+ function get(idOrIdList: string | [string, ...string[]]): Promise;
+ function get(
idOrIdList: string | [string, ...string[]],
callback: (results: BookmarkTreeNode[]) => void,
): void;
@@ -730,8 +730,8 @@ export namespace Browser {
*
* Can return its result via Promise since Chrome Chrome 90
*/
- export function getChildren(id: string): Promise;
- export function getChildren(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
+ function getChildren(id: string): Promise;
+ function getChildren(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
/**
* Retrieves the recently added bookmarks.
@@ -739,8 +739,8 @@ export namespace Browser {
*
* Can return its result via Promise since Chrome Chrome 90
*/
- export function getRecent(numberOfItems: number): Promise;
- export function getRecent(numberOfItems: number, callback: (results: BookmarkTreeNode[]) => void): void;
+ function getRecent(numberOfItems: number): Promise;
+ function getRecent(numberOfItems: number, callback: (results: BookmarkTreeNode[]) => void): void;
/**
* Retrieves part of the Bookmarks hierarchy, starting at the specified node.
@@ -748,16 +748,16 @@ export namespace Browser {
*
* Can return its result via Promise since Chrome Chrome 90
*/
- export function getSubTree(id: string): Promise;
- export function getSubTree(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
+ function getSubTree(id: string): Promise;
+ function getSubTree(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
/**
* Retrieves the entire Bookmarks hierarchy.
*
* Can return its result via Promise since Chrome Chrome 90
*/
- export function getTree(): Promise;
- export function getTree(callback: (results: BookmarkTreeNode[]) => void): void;
+ function getTree(): Promise;
+ function getTree(callback: (results: BookmarkTreeNode[]) => void): void;
interface MoveDestination {
parentId?: string;
@@ -769,8 +769,8 @@ export namespace Browser {
*
* Can return its result via Promise since Chrome Chrome 90
*/
- export function move(id: string, destination: MoveDestination): Promise;
- export function move(
+ function move(id: string, destination: MoveDestination): Promise;
+ function move(
id: string,
destination: MoveDestination,
callback: (result: BookmarkTreeNode) => void,
@@ -781,16 +781,16 @@ export namespace Browser {
*
* Can return its result via Promise since Chrome Chrome 90
*/
- export function remove(id: string): Promise;
- export function remove(id: string, callback: () => void): void;
+ function remove(id: string): Promise;
+ function remove(id: string, callback: () => void): void;
/**
* Recursively removes a bookmark folder.
*
* Can return its result via Promise since Chrome Chrome 90
*/
- export function removeTree(id: string): Promise;
- export function removeTree(id: string, callback: () => void): void;
+ function removeTree(id: string): Promise;
+ function removeTree(id: string, callback: () => void): void;
interface SearchQuery {
/** A string of words and quoted phrases that are matched against bookmark URLs and titles.*/
@@ -807,8 +807,8 @@ export namespace Browser {
*
* Can return its result via Promise since Chrome Chrome 90
*/
- export function search(query: string | SearchQuery): Promise;
- export function search(query: string | SearchQuery, callback: (results: BookmarkTreeNode[]) => void): void;
+ function search(query: string | SearchQuery): Promise;
+ function search(query: string | SearchQuery, callback: (results: BookmarkTreeNode[]) => void): void;
interface UpdateChanges {
title?: string;
@@ -820,26 +820,26 @@ export namespace Browser {
*
* Can return its result via Promise since Chrome Chrome 90
*/
- export function update(id: string, changes: UpdateChanges): Promise;
- export function update(id: string, changes: UpdateChanges, callback: (result: BookmarkTreeNode) => void): void;
+ function update(id: string, changes: UpdateChanges): Promise;
+ function update(id: string, changes: UpdateChanges, callback: (result: BookmarkTreeNode) => void): void;
/** Fired when a bookmark or folder changes. **Note:** Currently, only title and url changes trigger this.*/
- export const onChanged: events.Event<(id: string, changeInfo: { title: string; url?: string }) => void>;
+ const onChanged: events.Event<(id: string, changeInfo: { title: string; url?: string }) => void>;
/** Fired when the children of a folder have changed their order due to the order being sorted in the UI. This is not called as a result of a move(). */
- export const onChildrenReordered: events.Event<(id: string, reorderInfo: { childIds: string[] }) => void>;
+ const onChildrenReordered: events.Event<(id: string, reorderInfo: { childIds: string[] }) => void>;
/** Fired when a bookmark or folder is created. */
- export const onCreated: events.Event<(id: string, bookmark: BookmarkTreeNode) => void>;
+ const onCreated: events.Event<(id: string, bookmark: BookmarkTreeNode) => void>;
/** Fired when a bookmark import session is begun. Expensive observers should ignore onCreated updates until onImportEnded is fired. Observers should still handle other notifications immediately. */
- export const onImportBegan: events.Event<() => void>;
+ const onImportBegan: events.Event<() => void>;
/** Fired when a bookmark import session is ended. */
- export const onImportEnded: events.Event<() => void>;
+ const onImportEnded: events.Event<() => void>;
/** Fired when a bookmark or folder is moved to a different parent folder. */
- export const onMoved: events.Event<
+ const onMoved: events.Event<
(
id: string,
moveInfo: {
@@ -852,7 +852,7 @@ export namespace Browser {
>;
/** Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents. */
- export const onRemoved: events.Event<
+ const onRemoved: events.Event<
(
id: string,
removeInfo: {
@@ -876,33 +876,33 @@ export namespace Browser {
* MV2 only
*/
export namespace browserAction {
- export interface BadgeBackgroundColorDetails {
+ interface BadgeBackgroundColorDetails {
/** An array of four integers in the range 0-255 that make up the RGBA color of the badge. Can also be a string with a CSS hex color value; for example, `#FF0000` or `#F00` (red). Renders colors at full opacity. */
color: string | extensionTypes.ColorArray;
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
tabId?: number | null | undefined;
}
- export interface BadgeTextDetails {
+ interface BadgeTextDetails {
/** Any number of characters can be passed, but only about four can fit into the space. If an empty string (`''`) is passed, the badge text is cleared. If `tabId` is specified and `text` is null, the text for the specified tab is cleared and defaults to the global badge text. */
text?: string | null | undefined;
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
tabId?: number | null | undefined;
}
- export interface TitleDetails {
+ interface TitleDetails {
/** The string the browser action should display when moused over. */
title: string;
/** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
tabId?: number | null | undefined;
}
- export interface TabDetails {
+ interface TabDetails {
/** The ID of the tab to query state for. If no tab is specified, the non-tab-specific state is returned. */
tabId?: number | null | undefined;
}
- export type TabIconDetails =
+ type TabIconDetails =
& {
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
tabId?: number | null | undefined;
@@ -922,7 +922,7 @@ export namespace Browser {
}
);
- export interface PopupDetails {
+ interface PopupDetails {
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
tabId?: number | null | undefined;
/** The relative path to the HTML file to show in a popup. If set to the empty string (`''`), no popup is shown.*/
@@ -934,63 +934,63 @@ export namespace Browser {
* @param tabId The ID of the tab for which to modify the browser action.
* @param callback Since Chrome 67
*/
- export function enable(callback?: () => void): void;
- export function enable(tabId: number | null | undefined, callback?: () => void): void;
+ function enable(callback?: () => void): void;
+ function enable(tabId: number | null | undefined, callback?: () => void): void;
/**
* Sets the background color for the badge.
* @param callback Since Chrome 67
*/
- export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails, callback?: () => void): void;
+ function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails, callback?: () => void): void;
/**
* Sets the badge text for the browser action. The badge is displayed on top of the icon.
* @param callback Since Chrome 67
*/
- export function setBadgeText(details: BadgeTextDetails, callback?: () => void): void;
+ function setBadgeText(details: BadgeTextDetails, callback?: () => void): void;
/**
* Sets the title of the browser action. This title appears in the tooltip.
* @param callback Since Chrome 67
*/
- export function setTitle(details: TitleDetails, callback?: () => void): void;
+ function setTitle(details: TitleDetails, callback?: () => void): void;
/** Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned. */
- export function getBadgeText(details: TabDetails, callback: (result: string) => void): void;
+ function getBadgeText(details: TabDetails, callback: (result: string) => void): void;
/**
* Sets the HTML document to be opened as a popup when the user clicks the browser action icon.
* @param callback Since Chrome 67
*/
- export function setPopup(details: PopupDetails, callback?: () => void): void;
+ function setPopup(details: PopupDetails, callback?: () => void): void;
/**
* Disables the browser action for a tab.
* @param tabId The ID of the tab for which to modify the browser action.
* @param callback since Chrome 67
*/
- export function disable(callback?: () => void): void;
- export function disable(tabId: number | null | undefined, callback?: () => void): void;
+ function disable(callback?: () => void): void;
+ function disable(tabId: number | null | undefined, callback?: () => void): void;
/** Gets the title of the browser action. */
- export function getTitle(details: TabDetails, callback: (result: string) => void): void;
+ function getTitle(details: TabDetails, callback: (result: string) => void): void;
/** Gets the background color of the browser action. */
- export function getBadgeBackgroundColor(
+ function getBadgeBackgroundColor(
details: TabDetails,
callback: (result: extensionTypes.ColorArray) => void,
): void;
/** Gets the HTML document that is set as the popup for this browser action. */
- export function getPopup(details: TabDetails, callback: (result: string) => void): void;
+ function getPopup(details: TabDetails, callback: (result: string) => void): void;
/**
* Sets the icon for the browser action. The icon can be specified as the path to an image file, as the pixel data from a canvas element, or as a dictionary of one of those. Either the `path` or the `imageData` property must be specified.
*/
- export function setIcon(details: TabIconDetails, callback?: () => void): void;
+ function setIcon(details: TabIconDetails, callback?: () => void): void;
/** Fired when a browser action icon is clicked. Does not fire if the browser action has a popup. */
- export const onClicked: events.Event<(tab: Browser.tabs.Tab) => void>;
+ const onClicked: events.Event<(tab: Browser.tabs.Tab) => void>;
}
////////////////////
@@ -1002,7 +1002,7 @@ export namespace Browser {
* Permissions: "browsingData"
*/
export namespace browsingData {
- export interface OriginTypes {
+ interface OriginTypes {
/** Extensions and packaged applications a user has installed (be _really_ careful!). */
extension?: boolean | undefined;
/** Websites that have been installed as hosted applications (be careful!). */
@@ -1012,7 +1012,7 @@ export namespace Browser {
}
/** Options that determine exactly what data will be removed. */
- export interface RemovalOptions {
+ interface RemovalOptions {
/**
* When present, data for origins in this list is excluded from deletion. Can't be used together with `origins`. Only supported for cookies, storage and cache. Cookies are excluded for the whole registrable domain.
* @since Chrome 74
@@ -1030,7 +1030,7 @@ export namespace Browser {
}
/** A set of data types. Missing data types are interpreted as `false`. */
- export interface DataTypeSet {
+ interface DataTypeSet {
/** Websites' WebSQL data. */
webSQL?: boolean | undefined;
/** Websites' IndexedDB data. */
@@ -1072,7 +1072,7 @@ export namespace Browser {
serviceWorkers?: boolean | undefined;
}
- export interface SettingsResult {
+ interface SettingsResult {
options: RemovalOptions;
/** All of the types will be present in the result, with values of `true` if they are both selected to be removed and permitted to be removed, otherwise `false`. */
dataToRemove: DataTypeSet;
@@ -1085,8 +1085,8 @@ export namespace Browser {
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
- export function settings(): Promise;
- export function settings(callback: (result: SettingsResult) => void): void;
+ function settings(): Promise;
+ function settings(callback: (result: SettingsResult) => void): void;
/**
* Clears plugins' data.
@@ -1094,8 +1094,8 @@ export namespace Browser {
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
* @deprecated since Chrome 88. Support for Flash has been removed. This function has no effect
*/
- export function removePluginData(options: RemovalOptions): Promise;
- export function removePluginData(options: RemovalOptions, callback: () => void): void;
+ function removePluginData(options: RemovalOptions): Promise;
+ function removePluginData(options: RemovalOptions, callback: () => void): void;
/**
* Clears websites' service workers.
@@ -1103,24 +1103,24 @@ export namespace Browser {
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
* @since Chrome 72
*/
- export function removeServiceWorkers(options: RemovalOptions): Promise;
- export function removeServiceWorkers(options: RemovalOptions, callback: () => void): void;
+ function removeServiceWorkers(options: RemovalOptions): Promise;
+ function removeServiceWorkers(options: RemovalOptions, callback: () => void): void;
/**
* Clears the browser's stored form data (autofill).
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
- export function removeFormData(options: RemovalOptions): Promise;
- export function removeFormData(options: RemovalOptions, callback: () => void): void;
+ function removeFormData(options: RemovalOptions): Promise;
+ function removeFormData(options: RemovalOptions, callback: () => void): void;
/**
* Clears websites' file system data.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
- export function removeFileSystems(options: RemovalOptions): Promise;
- export function removeFileSystems(options: RemovalOptions, callback: () => void): void;
+ function removeFileSystems(options: RemovalOptions): Promise;
+ function removeFileSystems(options: RemovalOptions, callback: () => void): void;
/**
* Clears various types of browsing data stored in a user's profile.
@@ -1128,8 +1128,8 @@ export namespace Browser {
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
* @param dataToRemove The set of data types to remove.
*/
- export function remove(options: RemovalOptions, dataToRemove: DataTypeSet): Promise;
- export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback: () => void): void;
+ function remove(options: RemovalOptions, dataToRemove: DataTypeSet): Promise;
+ function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback: () => void): void;
/**
* Clears the browser's stored passwords.
@@ -1137,32 +1137,32 @@ export namespace Browser {
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
* @deprecated since Chrome 144. Support for password deletion through extensions has been removed. This function has no effect.
*/
- export function removePasswords(options: RemovalOptions): Promise;
- export function removePasswords(options: RemovalOptions, callback: () => void): void;
+ function removePasswords(options: RemovalOptions): Promise;
+ function removePasswords(options: RemovalOptions, callback: () => void): void;
/**
* Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
- export function removeCookies(options: RemovalOptions): Promise;
- export function removeCookies(options: RemovalOptions, callback: () => void): void;
+ function removeCookies(options: RemovalOptions): Promise;
+ function removeCookies(options: RemovalOptions, callback: () => void): void;
/**
* Clears websites' WebSQL data.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
- export function removeWebSQL(options: RemovalOptions): Promise;
- export function removeWebSQL(options: RemovalOptions, callback: () => void): void;
+ function removeWebSQL(options: RemovalOptions): Promise;
+ function removeWebSQL(options: RemovalOptions, callback: () => void): void;
/**
* Clears websites' appcache data.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
- export function removeAppcache(options: RemovalOptions): Promise;
- export function removeAppcache(options: RemovalOptions, callback: () => void): void;
+ function removeAppcache(options: RemovalOptions): Promise;
+ function removeAppcache(options: RemovalOptions, callback: () => void): void;
/**
* Clears websites' cache storage data.
@@ -1170,48 +1170,48 @@ export namespace Browser {
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
* @since Chrome 72
*/
- export function removeCacheStorage(options: RemovalOptions): Promise;
- export function removeCacheStorage(options: RemovalOptions, callback: () => void): void;
+ function removeCacheStorage(options: RemovalOptions): Promise;
+ function removeCacheStorage(options: RemovalOptions, callback: () => void): void;
/**
* Clears the browser's list of downloaded files (not the downloaded files themselves).
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
- export function removeDownloads(options: RemovalOptions): Promise;
- export function removeDownloads(options: RemovalOptions, callback: () => void): void;
+ function removeDownloads(options: RemovalOptions): Promise;
+ function removeDownloads(options: RemovalOptions, callback: () => void): void;
/**
* Clears websites' local storage data.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
- export function removeLocalStorage(options: RemovalOptions): Promise;
- export function removeLocalStorage(options: RemovalOptions, callback: () => void): void;
+ function removeLocalStorage(options: RemovalOptions): Promise;
+ function removeLocalStorage(options: RemovalOptions, callback: () => void): void;
/**
* Clears the browser's cache.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
- export function removeCache(options: RemovalOptions): Promise