feat: Add warning for missing Firefox extension ID in manifest#2293
feat: Add warning for missing Firefox extension ID in manifest#2293Sbrjt wants to merge 7 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. |
@wxt-dev/analytics
@wxt-dev/auto-icons
@wxt-dev/browser
@wxt-dev/i18n
@wxt-dev/is-background
@wxt-dev/module-react
@wxt-dev/module-solid
@wxt-dev/module-svelte
@wxt-dev/module-vue
@wxt-dev/runner
@wxt-dev/storage
@wxt-dev/unocss
@wxt-dev/webextension-polyfill
wxt
commit: |
|
Do you think we can add some default like |
This would be terrible, as it would clobber extension settings without the user knowing it. Additionally, this field is not required for development, only for installing/signing/publishing. It is also publicity visible and permanent once published. It can never be changed without deleting the extension and publishing an new one. I would prefer publishing to fail if I have not set my permanent, public, extension ID yet, so that I can set a proper ID; vs having a random one published. You can easily define browser specific settings in the config ...(isFirefox
? {
browser_specific_settings: {
gecko: {
id: 'auto-auth@cssnr.com',
strict_min_version: '128.0', // webRequest.onAuthRequired asyncBlocking
data_collection_permissions: { required: ['none'] },
},
gecko_android: { strict_min_version: '128.0' }, // webRequest.onAuthRequired asyncBlocking
},
}
: { minimum_chrome_version: '127' }), // chrome.action.openPopupBut I support a warning. |
|
@smashedr Good catch, in that case we shouldn't add any default data. Let's leave only warn |
Co-authored-by: Copilot <copilot@github.com>
|
@Sbrjt tests are failing, I have a fix, but can't push to your PR. Can you apply this patch? diff --git a/packages/wxt/src/core/utils/__tests__/manifest.test.ts b/packages/wxt/src/core/utils/__tests__/manifest.test.ts
index a629f26d..341f767d 100644
--- a/packages/wxt/src/core/utils/__tests__/manifest.test.ts
+++ b/packages/wxt/src/core/utils/__tests__/manifest.test.ts
@@ -1671,7 +1671,6 @@ describe('Manifest Utils', () => {
expect(actual.version).toBe('0.0.0');
expect(actual.version_name).toBeUndefined();
- expect(wxt.logger.warn).toBeCalledTimes(1);
expect(wxt.logger.warn).toBeCalledWith(
expect.stringContaining('Extension version not found'),
);
@@ -2103,7 +2102,6 @@ describe('Manifest Utils', () => {
const { manifest } = await generateManifest([], buildOutput);
expect(manifest.manifest_version).toBe(expectedVersion);
- expect(wxt.logger.warn).toBeCalledTimes(1);
expect(wxt.logger.warn).toBeCalledWith(
expect.stringContaining(
'`manifest.manifest_version` config was set, but ignored',Just delete the two lines calling |
Overview
This PR adds a warning when the Firefox extension ID is missing from the manifest to help prevent invalid builds.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings#description
Manual Testing
Not sure
Related Issue
None