Add-on works when loaded from manifest, but not from zip

I have created an add-on that seems to work.
When I add it as a temporary add-on by selecting the manifest.json file, the add-on operates as expected, no problems.
When I add it by zipping its files and selecting the zip, the extension still loads successfully, but its content script doesn’t seem to do anything.
The page action works.
I am certain it’s not the zip structure, I made sure that the files are at the top level (instead of a folder with the same name as the zip).
I tried using 7-Zip to not do any compression on the files, that also didn’t change anything.
Has anyone encountered this type of behavior before?

It does sounds like the MV3 issue where host permissions are not granted upon install so the content script is silently not executed where it suppose to run :slight_smile:.

Bad zip libraries happens too, but I think that results in some validation errors.

Note that error logging is pretty buggy in Firefox, so try to look into browser console (Ctrl + Shift + J), or place your content script code into one huge try/catch block to make sure the errors are caught and logged.

I’ve tried the Browser-Console, no errors or warnings there, but it’s a good hint I’ll remember for future use.

I’ve now identified the problem, removing the css file from the content script declaration, and instead putting it into web_accessible_resources let the content script run. (I’ve also changed the manifest_version to 2).

Thank you!

1 Like