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
1 change: 1 addition & 0 deletions packages/wxt/src/core/resolve-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export async function resolveConfig(
userConfigMetadata: userConfigMetadata ?? {},
alias,
experimental: defu(mergedConfig.experimental, {}),
suppressWarnings: mergedConfig.suppressWarnings ?? {},
dev: {
server: devServerConfig,
reloadCommand,
Expand Down
14 changes: 14 additions & 0 deletions packages/wxt/src/core/utils/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ export async function generateManifest(
? undefined
: versionName;

// Warn if building for Firefox without data_collection_permissions
if (
wxt.config.browser === 'firefox' &&
!userManifest.browser_specific_settings?.gecko
?.data_collection_permissions &&
!wxt.config.suppressWarnings?.firefoxDataCollection
) {
wxt.logger.warn(
'Firefox requires `data_collection_permissions` for new extensions from November 3, 2025. Existing extensions are exempt for now.\n' +
'For more details, see: https://extensionworkshop.com/documentation/develop/firefox-builtin-data-consent/\n' +
'To suppress this warning, add `firefoxDataCollection: true` to `suppressWarnings` in your wxt config.\n',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'To suppress this warning, add `firefoxDataCollection: true` to `suppressWarnings` in your wxt config.\n',
'To suppress this warning, set `suppressWarnings.firefoxDataCollection` to `true` in your wxt config.\n',

);
}

addEntrypoints(manifest, entrypoints, buildOutput);

if (wxt.config.command === 'serve') addDevModeCsp(manifest);
Expand Down
1 change: 1 addition & 0 deletions packages/wxt/src/core/utils/testing/fake-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ export const fakeResolvedConfig = fakeObjectCreator<ResolvedConfig>(() => {
hooks: {},
vite: () => ({}),
plugins: [],
suppressWarnings: {},
};
});

Expand Down
61 changes: 61 additions & 0 deletions packages/wxt/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,22 @@ export interface InlineConfig {
* object or promise.
*/
manifest?: UserManifest | Promise<UserManifest> | UserManifestFn;
/**
* Suppress specific warnings during the build process.
*
* @example
* ```ts
* export default defineConfig({
* suppressWarnings: {
* firefoxDataCollection: true,
* },
* })
* ```
*/
suppressWarnings?: { firefoxDataCollection?: boolean } & Record<
string,
boolean
>;
Comment on lines +146 to +149
Copy link
Member

@aklinker1 aklinker1 Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why make this a union with a record? We should show a type error if there's a typo, right?

Suggested change
suppressWarnings?: { firefoxDataCollection?: boolean } & Record<
string,
boolean
>;
suppressWarnings?: { firefoxDataCollection?: boolean };

/**
* Configure browser startup. Options set here can be overridden in a `web-ext.config.ts` file.
*/
Expand Down Expand Up @@ -838,6 +854,39 @@ export type ResolvedPerBrowserOptions<T, TOmitted extends keyof T = never> = {
: T[key];
} & { [key in TOmitted]: T[key] };

/**
* Firefox data collection permission types for personal data.
* See: https://extensionworkshop.com/documentation/develop/firefox-builtin-data-consent/#specifying-data-types
*/
export type FirefoxDataCollectionType =
| 'locationInfo'
| 'browsingActivity'
| 'websiteContent'
| 'websiteActivity'
| 'searchTerms'
| 'bookmarksInfo'
| 'healthInfo'
| 'contactInfo'
| 'socialInfo'
| (string & {});

/**
* Firefox data collection permissions configuration.
* See: https://extensionworkshop.com/documentation/develop/firefox-builtin-data-consent/#specifying-data-types
*/
export interface FirefoxDataCollectionPermissions {
/**
* Required data collection permissions. Users must opt in to use the extension.
* Can include personal data types or "none" to explicitly indicate no data collection.
*/
required?: Array<FirefoxDataCollectionType | 'none'>;
/**
* Optional data collection permissions. Users can opt in after installation.
* Can include personal data types or "technicalAndInteraction" (which can only be optional).
*/
optional?: Array<FirefoxDataCollectionType | 'technicalAndInteraction'>;
}

/**
* Manifest customization available in the `wxt.config.ts` file. You cannot configure entrypoints
* here, they are configured inline.
Expand Down Expand Up @@ -873,6 +922,11 @@ export type UserManifest = {
strict_min_version?: string;
strict_max_version?: string;
update_url?: string;
/**
* Firefox data collection permissions configuration.
* See: https://extensionworkshop.com/documentation/develop/firefox-builtin-data-consent/#specifying-data-types
*/
data_collection_permissions?: FirefoxDataCollectionPermissions;
};
gecko_android?: {
strict_min_version?: string;
Expand Down Expand Up @@ -1355,6 +1409,13 @@ export interface ResolvedConfig {
*/
alias: Record<string, string>;
experimental: {};
/**
* List of warning identifiers to suppress during the build process.
*/
suppressWarnings: { firefoxDataCollection?: boolean } & Record<
string,
boolean
>;
Comment on lines +1415 to +1418
Copy link
Member

@aklinker1 aklinker1 Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't need the record, it can be removed here as well.

Suggested change
suppressWarnings: { firefoxDataCollection?: boolean } & Record<
string,
boolean
>;
suppressWarnings: { firefoxDataCollection?: boolean };

dev: {
/** Only defined during dev command */
server?: {
Expand Down