Method to install multiple Firefox extensions or addons in with least user intervention? - firefox

The Question:
How do I install multiple Firefox extensions into a fresh Firefox v11+ profile, with the least amount of user wasted motion (reduced mouse clicks and keyboard presses) other than the bare minimum for verifying security constraints (e.g., a single "scare" prompt)?
The Constraints:
The methodology should be exactly the same on both Linux and Windows installations of Firefox, and not require administrators rights (exceptions made for Windows, maybe) or root privileges (Firefox installed locally in the users home directory, not under /bin).
Any extensions that are automatically updated via whatever mechanism is currently used should continue to update those extensions. (Exception maybe for keyconfig extension (see below) if it doesn't automatically update itself upon new revisions, but I don't know if that is the case or not).
The methodology should work for extensions that do not show up in the "Get Addons" search under Tools/Add-ons (e.g., keyconfig mentioned below in the "almost" solutions section).
The "Almost" Solutions:
Below are various things I've tried but that do not do exactly what is needed. The key constraint here is reducing the amount of wasted motion I spend when installing Firefox extensions.
The command-line way:
I can get almost what I want via invoking Firefox with the fully-qualified paths to .xpi files stored locally on my filesystem (tested only on Linux 64-bit machines; not on Windows yet but may work there too) via this type of command-line:
firefox some_extension1.xpi \
some_extension2.xpi \
some_extension3.xpi \
... \
some_extensionN.xpi
where some_extensionN.xpi are fully-qualified paths to specific extensions I desire to be installed. But that is not workable because Firefox prompts multiple times, once per each extension to be installed, when only one security prompt is necessary. Multiple promptings are a show-stopper.
The Massive Extender Way:
Massive Extender extension kept me mostly happy, but was rendered inoperable because of the dropping of support for the AddOn Collections extension. Waiting for someone to get around to supporting extensions in Firefox Sync is probably not an option: I believe that they will disallow syncing of extensions that are not registered through some official channel such as the one that shows up in searches from the Tools>Addons menu entry in Firefox. An example of a extremely useful extension that does not seem to be managed via the official channel is the keyconfig extension.
The FEBE Extension way:
The FEBE extension comes close, but is not workable either because, well, it crashes Firefox when trying to restore from Box.net (as of 2014-04-05).

You should create a multi-item package. You basically ZIP up an install.rdf file and several XPI files and rename the archive into something.xpi. The install.rdf file should look like this:
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>foobar#example.com</em:id>
<em:type>32</em:type>
<em:targetApplication>
<Description>
<!-- Firefox -->
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>10.0</em:minVersion>
<em:maxVersion>11.*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
You probably want to choose some ID for your bundle that is different from foobar#example.com and adjust the compatible Firefox versions. Then you can simply trigger the installation of this bundle and it will install all the extensions inside.
Important note: install.rdf has to be located at the top level of the ZIP archive, not inside a subdirectory.

Related

How to install and enable Firefox extensions using bash script

I need to install & enable a series of Firefox add-ons, for a singe profile, without user input, using a bash script. It is a matter of editing a config file in the user's profile folder, as copying an entire, manually installed folder worked.
Any online resources I could find are extremely outdated.
Just downloading the .xpi files into ~/.mozilla/firefox/*123abc.profilename/extensions does install the add-ons, but requires user input to enable.
user_pref("extensions.webextensions.ExtensionStorageIDB.migrated.*extensionid*", true); is inserted into prefs.js by manual enabling, but doesn't enable the addon itseld
extenstions.json [1] & extension-settings.json also have no effect.
extension-preferences.json is only observed to be affected by allowing addons to run in private windows.
Thank you in advance.
Corrections:
[1] My Testing indicates that extenstion.json is what i'm looking for, but I am not yet sure what needs to be modified as it has no white space, making it hard to read. Will edit with any updates.

How to download a Firefox add-on without Firefox

I am in a corporate network and wanted to install some developer tools for Firefox. Unfortunately policies forbid that Firefox can access the internet directly, but there are other browsers available to go there. Now: how can I download an xpi-file directly without Firefox?
The problem when I access the addons-page for Firefox: the Download-Button is replaced with something similar to "only available in Firefox - download Firefox". Unfortunately I don't have other developer tools available yet, so I can not even inspect the site and look whether an actual link is available. But maybe there is some pattern, how the link could be derived? Or another site where the add-ons are listed?
I found two (and a half) ways overcoming that problem for now. One is simply using another device, that has firefox on it and copy the link from there (as also stated in the comment).
Another variant was to look in the source code of the add-on-page. Hidden within some json-data is the actual download-url, e.g.:
"url":"https:\u002F\u002Faddons.mozilla.org\u002Ffirefox\u002Fdownloads\u002Ffile\u002F<plugin- or download-id>\u002F<plugin-file-name>.xpi?src="
After transforming that url back (basically only replacing the \u002F to / (and any other special symbol)), I could download the xpi without problem.
I also found a page where you could copy&paste the add-on-page into it and it started a plugin download. However I do not know anything about that site otherwise (so use at your own risk). It's name was "XPI Downloader". A pity it doesn't just list the actual url to the add-on itself :-/

Redirect Firefox extension updates to official add-ons site?

Now that Mozilla requires Firefox extensions to be signed, I've decided to only host my personal extensions at the official Add-ons for Firefox (AMO) site. Previously, I hosted my extensions at my personal website, using the requisite update manifest machinery.
I'd like to redirect users who installed my extensions directly from my personal website to the new versions at AMO. I was under the impression that if I released an update of my extension without the custom updateURL in the extension's manifest, that it would check AMO by default. That doesn't seem to be the case, however.
How can I make it so that users who installed my extension via my personal site can get updates going forward from the official add-ons site? Are they essentially forced to uninstall / reinstall to pick up this change? Or can I trigger it somehow?
I should point out that the extension ID for my extension is the same, regardless of my distribution point. This is one reason I thought that simply removing the updateURL from the installer manifest would do the right thing.
Update: Here's further details on the scenario I'm trying to solve:
User installed version 2.6.5 of my extension from my personal website some time in the past.
I released version 2.6.6 of the extension on my personal website, removing the updateURL node from that version's installer manifest in the process.
I release version 2.6.7 of the extension on AMO only. I expect that the user from step 1 should be able to automatically upgrade their install to 2.6.7, but this isn't the case. It's as if Firefox doesn't know to check AMO for that given extension, even though the extension ID is the same.
Update 2: My installer manifest for version 2.6.6 contained the updateKey node, but not the updateURL node. When I remove the updateKey from the installer manifest, repackage the extension, and install it, the updates available at AMO are then found successfully. This shifts the problem, however, to the update manifest on my website. In order for an extension update to be found via my website, it needs the updateKey (unless I'm missing something obvious). How can I automatically push an update to an extension that (a) isn't hosted on AMO and (b) has neither an updateKey or an updateURL present in its installer manifest?
If you have your extension hosted on AMO, it will be automatically updated for the user (unless the user has 'Automatic updates' turned off for your particular add-on via Tools > Add-ons > Extensions > (your extension) > More.
And yes, you should remove the updateURL tag from your install.rdf file.
You can find more information at the MDM site.

FireFox API install extension

How do I install, update, uninstall FireFox extensions on Windows?
The article (https://developer.mozilla.org/en/Adding_Extensions_using_the_Windows_Registry) seems like a legacy information...
I have installed FireFox 3.6.3.
However, I don't see "HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions" in my registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.6.3 (en-GB)]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.6.3 (en-GB)\Main]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.6.3 (en-GB)\Uninstall]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 3.6.3]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 3.6.3\bin]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 3.6.3\extensions]
For example, I want to install my_ext.xpi (ID: my_ext#my_site.com, Path: c:\myapp\ff_addons\my_ext.xpi).
Could you talk me how can I install my extension ?
Which firefox's versions support this method ?
The extension registry key (HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions) doesn't exist by default - simply create it and register your extension there as detailed in Mozilla's instructions (which you linked to).
This method has been working fine for me for over a year now.
You also have another option (which also works on non-Windows machines): Installing Extensions
The windows registry method is not a legacy method, and it's the supported way of installing an add-on for all users on a machine (and all Firefox profiles).
I'm curious as to why you felt it was a legacy method.
Are you talking about an extension or a plug-in?
Extensions are generally installed by having Firefox open an .xpi file. And .xpi files are just .zip files with a manifest (.rdf) and your various scripts and libraries. You can install it manually by creating the right directory structure. On my machine extensions live here: C:\Users\[username]\AppData\Roaming\Mozilla\Firefox\Profiles\[random-number].default\extensions. You create a subdirectory there called yourextension#yourcompany.com and then unzip the contents of your XPI inside the subdirectory. The next time the user re-starts firefox, your extension will be installed. There are a few gotcha's though:
Users have to manually restart Firefox.
You don't know which profile to use if there is more than one. The profile is identified by the [random-number] above. Many users have more than one profile.
On Mac and Linux this is a different directory, though the same basic idea applies.
Plugins are things like Flash that run inside a webpage. You can install those by setting a registry key, but I think in general there is a well-known folder where Firefox looks and loads anything that starts with NP (e.g. NPSWF32.dll). Seriously, it looks for NP. And each plugin must export certain NPAPI functions that Firefox uses to negotiate... stuff.

TYPO3 extensions and symlinks

Can I create a symlink to the local extension from aonther project folder? I have a common local-server and i need to implement same extension on all local project-installations. I tried to put the symlink, but some times i do not get expected output. I get it only after clearing the cache of that perticular project.
Your scenario is a common one I guess. But as Omar said, linking to the same code base of the extension through several typo3 instances is not a good practice.
But we have the same structure as yours, we realize this through SVN. All of our projects got a SVN repository and common extensions have their own repository. Through svn:externals the extensions are linked into the concrete project. This has the advantage that you can change the extension in the concrete project and after committing all other projects (that do have to update from svn though) contribute from it. I Think this would fit your needs, too.
If I understand your question correctly you have several Typo3 sites on the same server and want to share an extension between them using a symlink. I don't think that is a very great idea because many extensions use tables and every site normally has it's own database so you would have to do a lot of tinkering to get that to work.
Instead you could make all the modifications to the extension files in the typo3conf/ext/extension_name folder and then export the extension to a t3x file (Ext Manager in the Backend). This t3x file can be installed as a extension (Import extension) on all your other sites.
If you extension does not use a database and you are planning to make frequent changes then I guess you should be able to make that work (the symlink). Otherwise I recommend you use the first approach I described.
I have not tried this, but you should be able to install extensions globally in Typo3. What this means is that the given extension is placed inside '(typo3_src/)typo3/ext/' instead of 'typo3conf/ext/', presuming both sites use the same Typo3 Core/Source (and thus typo3_src is a symlink to the location of the core).
You can enable installing global extensions via the Install Tool. Once inside the tool, click on 'All Configuration', then search for allowGlobalInstall. Or put the following line into your localconf.php:
$TYPO3_CONF_VARS['EXT']['allowGlobalInstall'] = '1';
At last, but not least, you need to make sure the 'typo3/ext/' directory is writeable.
Hope this will be to some help. If you have any further questions, let me know :)
As Björn mentioned, I'd sugegst to install them globally. Mind you, updating the source will require to move the extensions accordingly..
As for "expected output": be aware that the code in these folders is cached in various ways (mainly page content and config settings), and hence not always run. This is the reason a change done from "outside" the current installation is likely not to propagate to your output without clearing these caches (as you have observed).
When you actually install an extension via the extension manager, the cache should (if correctly configured) be cleared (interested parties may search for clearCacheOnLoad in class.em_index.php to reveal a clear_cacheCmd('all')). There is a small checkbox, which is normally checked, during the installation process to accomplish this.
Omar's first approach is therefore, as I see it, the more easy way to get "expected output" and less jumbling around with global extensions.

Resources