feat: add support for Firefox data collection permissions#1976
feat: add support for Firefox data collection permissions#1976suveshmoza wants to merge 2 commits intowxt-dev:mainfrom
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
I'm concerned that devs will see the warning and get mad that the only way to silence it is to add the option. I'd be nervous to do that because I'm not sure if adding, even a blank object, could result in the extension being disabled since the manifest changed in a way that the prompt also changed. I'd like to add a config option to silence this if the dev doesn't want to address it yet.
Thoughts?
I agree with your concerns. The warning could frustrate developers, especially those maintaining existing extensions, who are currently exempt but will eventually need to specify these permissions. Yes, a config option would be nice and could be extended for future warnings. Something like export default defineConfig({
suppressWarnings: {
firefoxDataCollection: true,
},
// ... rest of config
});
if (
wxt.config.browser === 'firefox' &&
!userManifest.browser_specific_settings?.gecko?.data_collection_permissions &&
!wxt.config.suppressWarnings?.firefoxDataCollection //using config option here to silence warning
) |
54a2c71 to
feed267
Compare
aklinker1
left a comment
There was a problem hiding this comment.
suppressWarnings - I like that naming, lets add it!
Needs to be added in 2 places:
-
User facing config type:
Lines 12 to 377 in 223cf86
Everything needs to be optional
-
Internal config type:
Lines 1288 to 1403 in 223cf86
Everything is required.
-
Map the user config to the resolved config:
You should see a type error in this file after changing the types.
Then we can also a message to the warning about how to set the config to suppress the warning.
3a474cb to
12da160
Compare
|
Done. I've added the suppressWarnings config option as specified. export default defineConfig({
suppressWarnings: {
firefoxDataCollection: true,
},
// ... rest of config
}); |
12da160 to
1e98210
Compare
1e98210 to
e6f8d68
Compare
aklinker1
left a comment
There was a problem hiding this comment.
Sorry for the delay, this looks good now! Just a few small changes then we can merge.
| 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', |
There was a problem hiding this comment.
| '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', |
| suppressWarnings?: { firefoxDataCollection?: boolean } & Record< | ||
| string, | ||
| boolean | ||
| >; |
There was a problem hiding this comment.
Why make this a union with a record? We should show a type error if there's a typo, right?
| suppressWarnings?: { firefoxDataCollection?: boolean } & Record< | |
| string, | |
| boolean | |
| >; | |
| suppressWarnings?: { firefoxDataCollection?: boolean }; |
| suppressWarnings: { firefoxDataCollection?: boolean } & Record< | ||
| string, | ||
| boolean | ||
| >; |
There was a problem hiding this comment.
If we don't need the record, it can be removed here as well.
| suppressWarnings: { firefoxDataCollection?: boolean } & Record< | |
| string, | |
| boolean | |
| >; | |
| suppressWarnings: { firefoxDataCollection?: boolean }; |
Overview
Adds support for Firefox's required
data_collection_permissionsfield inbrowser_specific_settings.gecko. As of November 3rd, 2025, all new Firefox extensions must declare their data collection practices.Changes
FirefoxDataCollectionTypeandFirefoxDataCollectionPermissionsTypeScript typesUserManifestto includedata_collection_permissionsinbrowser_specific_settings.geckodata_collection_permissions#specifiedManual Testing
Building the wxt-demo for Firefox will show a warning to add
data_collection_permissionsto manifest config.Related Issue
This PR closes #1975