Hi, so I am a first time extension developer and currently making an extension for both chrome and firefox. Unfortunately, I have been running into the issue of firefox simply not accepting my manifest file. I’ve literally been trying for the better part of 30 minutes to get it working, with no success. Whenever I try to temporarily load the extension using the debugging tool, I get this error: File C:\Users\Max\Documents\extension-projects\YTAdBlockerBypass-firefox.zip does not contain a valid manifest
Web-ext is a NodeJS console program for addon development, more info here:
In any case, there is one other way to find the exact issue - open browser console (Ctrl + Shift + J), clear the errors you see there and then click “Reload” button in the “about:debugging#/runtime/this-firefox” page to reload your addon.
That should print the exact issue with your manifest file.
For example:
1697286918904 addons.webextension.ytadblockerbypass@hauber ERROR Loading extension ‘ytadblockerbypass@hauber’: Reading manifest: The “default_locale” property is required when a “_locales/” directory is present.
I just did exactly that, but it still saying the same thing. Weirdly enough if I run it with web-ext run, the extensions seems to load, but I don’t know if it works
I wasn’t able to reproduce the issue you described, @Hauber. I took the manifest you provided, created some empty files for the images and content script, zipped them up, and loaded the zip as a temporary add-on in about:debugging#/runtime/this-firefox. I don’t see the error you described, but I do see warning messages. Here’s what I see:
That said, I should mention that you don’t need to zip extensions when you’re developing an extension. You can load the extension on your file system directly by selecting one of the extension files in the extension’s root directory as described here: Your first extension - Mozilla | MDN
Ah! As you said, Firefox expects the extension files to be at the top level, not inside a directory. This is called out in one of the yellow info boxes on Package your extension | Firefox Extension Workshop
The ZIP file must be a ZIP of the extension’s files themselves, not of the directory containing them.