I'm trying to develop a Firefox extension. I've created a new profile, and I copy the folder of my extension to the extensions folder, with Firefox not running. When I run Firefox, I see how the folder of my extension disappears from the extensions folder, and Firefox opens without the extension. I've also tried to make a link, a text file called exactly same than the extension's em:id, with the path of the folder inside. However, the same thing happens every time - the file disappears when starting Firefox. I'm working on Firefox 14, Mac OS X 10.8 Mountain Lion.
You need to first install the extension into firefox. For that, make xpi file of your source, install it to firefox and restart it. Once the extension is installed, you can start editing source files inside the extension folder. Before making the xpi, make sure that your install.rdf have <em:unpack>true</em:unpack> to force firefox to unpack your xpi. Unpacking is not recommended and may cause performance issues.
My preferred method is to use Firefox extension proxy file where you can keep your source code anywhere and still enjoy the same benefit.
Related
It might be hard to relate to but VSCode (a code editor) saves all the installed extensions locally in Users folder with the name of .vscode/extensions. Any one can copy the folder and paste it on other system with VSCode installed to have the same extensions (on Windows).
Is there such a folder for Firefox browser add-ons?
I have found the path on windows. [User]\AppData\Roaming\Mozilla\Firefox. There should be three folders each having two extensions related folders where all the extensions are saved.
I had been using an old version of Firefox, because I have a legacy add-on which is incompatible with new versions. Now many websites have stopped working in the old version of Firefox, and this forces me to update to Firefox 56 and change the code of the legacy add-on to make it workable.
In general, the legacy add-on works in Firefox 56 but there are some problems that I have to solve.
My current problem: I change the add-on files in a text editor, save them, restart Firefox, but instead of using the new add-on files, the browser keeps using the old versions of these files. I have no idea where it keeps them.
I have disabled checking for add-on signing in the browser. The add-on code resides in a folder on a local disk (not compressed). In the Firefox profile, in the folder "extensions" there is a text file that contains the path to that folder. The browser loads add-on, the add-on works, but uses the old versions of the add-on files, even after I change the original files. I tried to disable and then enable the add-on, this did not help at all.
How can I force Firefox 56 to reload this legacy add-on after I change the add-on files?
Copy to a path the package (xpi) for installed and disabled/incompatible addon.
(...\Profiles\xxxxxxx.default\extensions)
Note that files can have names like {b9db16a4-6edc-47ec-a1f4-b86292ed211d}.xpi but using about:support you can find the name associated to this addon.
Uninstall the disabled/incompatible addon
Extract the xpi file (it is a zip file)
Edit install.rdf
(contains extension identification and compatibility checks)
to include a different version
modify max version 56.*
Edit chrome.manifest
(contains technical configuration which can be common for all browser and version or can be customized per each different web browser or version)
Modify appversion to apply to your browser version
Add all files to a file.zip
rename the file.zip to file.xpi
Install the addon file on your firefox
You have more details in:
best-practices-with-firefox-palemoon.html
How can I permanently install my (toy) WebExtension without having to publish it via Mozilla Addons (AMO), when my extension is just a small group of CSS hacks not meant to be published.
The other option, installing it only permanently would be cumbersome to do everytime I need the extension.
EDIT:
To add further input, the page I've linked to says
Zip up your extension's files Edit
At this point your extension will consist of a directory containing a
manifest.json and any other files it needs - scripts, icons, HTML
documents, and so on. You'll need to zip these into a single file for
uploading to AMO.
One trick is that the ZIP file must be a ZIP of the extension's files
themselves, not of the containing directory.
and also
Packaged extensions in Firefox are called "XPI files", which are just
ZIP files with a different extension.
You don't have to use the XPI extension when uploading to AMO.
In about:addons you can install from file, but whatever way I try to package my extension I get:
even after observing and trying the quoted passage above.
The temporary installation works fine.
You can get your extension signed by AMO but leave it unlisted or you can use one of the Firefox builds that allow signing to be disabled (Nightly or unbranded builds)
You can sign your extension by AMO without publish it.
Then just put an xpi file into
%appdata%\Mozilla\Extensions{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
the browser will accept it.
I would like to force the compatibility of FastDial for the new Firefox 4.5.0.1, and other extensions.
I did this in the past for a lot of addons, I know the procediment... the xpi is just a zip file, that when extracted their contents, you will find a file with name Install.rdf, containing this line:
<em:maxVersion>X.0</em:maxVersion>
Then the desired version is set, and recompress the Zip, and change the .zip extension to .xpi.
However, that methodology is not working for Firefox 45.0.1 (x86).
This is what always happens when trying to install a rebuilt xpi using the known methodology:
The Spanish error-message of the image above says:
This addon cannot be installed because seems damaged.
So... what changed in this damn Firefox 4.5.0.1 that does not accept our rebuilt addons?.
UPDATE
I noted that the problem is with the Install.rdf file, If I do not change the <em:maxVersion>...</em:maxVersion>, then I can recompress properlly the package and it is recognized by this new Firefox.
Then how I need to edit the Install.rdf file to avoid "corrupting" the xpi package for this new Firefox?.
I tried using Wordpard to edit the rdf file, I also tried Sublime Text, saving the file with and without BOM (UTF-8), and for re-compressing the package I used WinRar (I always used WinRar to do it), saving it as Zip, not RAR, of course.
All extensions distributed by Mozilla for Firefox are signed by Mozilla. The files containing the signatures are in the META-INF directory within the extension's top level directory. These signature files are what are used to verify that the extension has not been modified from what has been reviewed and distributed by Mozilla.
To get past the error you are seeing, you will need to remove that directory and its contents.
You will then have an issue that the extension is not signed. Firefox will then refuse to load it for that reason. The quick solution to that is to set xpinstall.signatures.required to false in about:config. However, that will only be effective in release and beta versions of Firefox until the next version update, or so. When exactly changing that option will no longer work is not clear. Turning off the availability of that option in the release and beta versions of Firefox has been a moving target, but the change is coming very soon. The option should continue to work in the Developer Edition of Firefox.
Beyond those options, you will need to have the new extension, which you created by making any changes, signed by Mozilla. You will have to treat it as a new extension (i.e. you will have to create a new ID for it). Some resources which will help in figuring extension signing out (it would be a different question) are:
Signing and distributing your add-on
Add-ons/Extension Signing
Is there a way to access the firefox directory where all the keyboard shortcuts are stored? I want to be able to delete all of them, and I don't want to rely on the keyconfig extension.
i think the file you are looking for is omni.ja that is a jar file in firfox installation directory.
inside that archive you can find at the path /chrome/toolkit/content/global/ a file named platformHTMLBindings.xml that should contain firefox key bindings, but recent firefox versions may have changed the binding system..