I am new to FF extensions development. I work on Windows OS. I am using web extensions. I started my first extension. I created a directory in My Documents
which contains my extension files. The files are based on the example in: Your First WebExtension which are: manifest.json
, icons/myicon.png
, myextension.js
. Like the example, all what the extension does is a border aroud mozilla page. This is the js code: document.body.style.border = "5px solid red";
When I come to installing the extension in my browser, I navigated to:about:debugging
then I clicked in the Load Temprary Addon
button and I selected the the .js
file. I get this error: There was an error during installation: Extension is invalid
. Can you point what the problem is?
Press Alt + f > o > browse to the extension > double click the extension (or select Open) > Install Now. Method: Drag the extension to the instance of Firefox on the taskbar > wait for Firefox to appear > drop onto the browser window > Install Now.
Drag that XPI into the Firefox browser to install it. Or use File > Open File to install it. Windows doesn't recognize that file type, but Firefox does. Drag that XPI into the Firefox browser to install it.
Most add-on data is stored in a folder in the Firefox user profile. However, some information is stored in the profile folder also. It's possible that there is a problem with the file(s) that store the extensions registry. Type about:support in the address bar and press enter.
Most likely an error in the manifest.json file. Double-check that code; if it all looks good, try temporarily removing optional things from it, then removing-and-reloading your addon in the debugger until it works. Then you can narrow down what's up (hard to say exactly, without seeing your code). The most minor error in the JSON will result in the addon failing to load (such as an out-of-place bracket, etc).
See also: Anatomy of a WebExtension
Problem with my setup was incorrect use of content_scripts.matches
, correct solution for a "match-all" is
"matches": ["*://*/"],
Attribution : https://discourse.mozilla.org/t/web-extensions-noob-getting-there-was-an-error-during-installation-extension-is-invalid/12828/3
The problem was that extensions must be saved in specific directory. In winows, the directory is: C:\Users\"YourUser"\AppData\Roaming\Mozilla\Firefox\Profiles\"YourFireFoxProfile"\extensions
After that, try the steps I mentioned in the original post and you should find the extension added.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With