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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/wxt/src/core/utils/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,17 @@ export async function generateManifest(
);
}

if (
wxt.config.browser === 'firefox' &&
!manifest.browser_specific_settings?.gecko?.id &&
!wxt.config.suppressWarnings?.firefoxId
) {
wxt.logger.warn(
'Firefox requires extension ID for MV3 and recommends it for MV2.\n' +
'For more details, see: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings#id',
);
}

addEntrypoints(manifest, entrypoints, buildOutput);

if (wxt.config.browser === 'firefox') {
Expand Down
10 changes: 9 additions & 1 deletion packages/wxt/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ export interface InlineConfig {
* https://extensionworkshop.com/documentation/develop/firefox-builtin-data-consent
*/
firefoxDataCollection?: boolean;
/**
* Suppress warnings when the Firefox extension ID is missing.
* https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings#id
*/
firefoxId?: boolean;
};
/**
* Configure browser startup. Options set here can be overridden in a
Expand Down Expand Up @@ -1514,7 +1519,10 @@ export interface ResolvedConfig {
alias: Record<string, string>;
experimental: {};
/** List of warning identifiers to suppress during the build process. */
suppressWarnings: { firefoxDataCollection?: boolean };
suppressWarnings: {
firefoxDataCollection?: boolean;
firefoxId?: boolean;
};
dev: {
/** Only defined during dev command */
server?: {
Expand Down