How to install a custom Firefox extension
I'm new to developing FF extensions. I am working on Windows OS. I am using web extensions. I started my first renewal. I created a directory in My Documents
which contains my extension files. Files are based on the following example: your first Web extent that: manifest.json
, icons/myicon.png
, myextension.js
. As in the example, everything the extension does is aroud mozilla border page. This is the js code:document.body.style.border = "5px solid red";
When I come to install the extension in my browser, I navigated to:, about:debugging
then clicked the button Load Temprary Addon
and I selected the file .js
. I get this error: There was an error during installation: Extension is invalid
. Can you point out what the problem is?
source to share
The problem was that the extensions had to be saved in a specific directory. In the winches directory: 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 added addition.
source to share
Most likely there is an error in the manifest.json file. Double check this code; if everything looks good, try temporarily removing the optional stuff from it, and then uninstall and reload the addon in the debugger until it works. Then you can narrow down what (it's hard to say for sure without seeing your code). The smallest mistake in JSON will result in the addon not loading (e.g. parenthesis out of place, etc.).
See also: Anatomy of a WebExtension
source to share