Installing Extensions from the store via the windows registry - firefox

I want to add some keys into the windows registry and let firefox to install my extension from the store. Is it possible?
After reading this article I can create my extension key here: HKEY_CURRENT_USER\Software\Mozilla\Firefox\Extensions in the following format:
MyExtensionId = LocalPath. It works pretty well, Firefox installs my extension during the next launch.
However, now I am interested how to install an extension the same way but from the store (https://addons.mozilla.org/).
If I just write URL to the registry instead LocalPath, it doesn't work.
What is the exact format of registry keys which I have to write to achieve my goal?

As far as I learned this question it's impossible to install an extension from the store using the windows registry. Fortunately, it's possible to sign your extension in the mozzila store, download the signed extension, include it to your installer, then distribute this signed extension with your installer and then install your extension as usually through the registry.

I know that now it is impossible. I tried to solve this problem. For example, installing an extension "uBlock Origin" via CMD script. It works:
reg add HKLM\SOFTWARE\Mozilla\Firefox\Extensions /v uBlock0#raymondhill.net /d D:\Download\ublock_origin-1.18.6-an+fx.xpi
But, it isn't:
reg add HKLM\SOFTWARE\Mozilla\Firefox\Extensions /v uBlock0#raymondhill.net /d https://addons.mozilla.org/firefox/downloads/file/1709472/ublock_origin-1.18.6-an+fx.xpi /f
In Chrome browser, the installation from the URL works! We'll wait until Firefox browser developers come to this too.

Related

Best way to install a firefox extension on the shell

I want to create a new profile with an addon preinstalled.
What works:
run firefox a first time.
add the addon.xpi to profile/extensions/addon.xpi.
edit profile profile/extensions.ini and add Extension0=/full/path/to/extension.xpi.
start firefox again.
What i need:
add the addon to profile/extensions/addon.xpi.
edit extensions.ini or something similiar.
use only relative paths, if possible (seems not to be implemented for extensions.ini)
Finally i want to create a zip file with some firefox preferences/addons, which can be unziped into a profilefolder to create a fresh profile with some preinstalled stuff. For this, it would be important, that everything works with relative paths. If it is definitely not possible, i can add some script to it. But i would prefer some "just unzip" solution.
I think it may be a bit harder, because mozilla wanted to prevent other software from adding toolbars and similiar to firefox by making external addon installation harder. What i already found is the key extensions.autoDisableScopes=0.
What you can do is open firefox with command line options. And pass the file path to your xpi file, so you don't have to mess with all this internals you are over there.
So do this:
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "C:\my.xpi"
and on launch it will open a tab and prompt to install your addon.
In the prefs.js:
pref("extensions.autoDisableScopes", 14); // 0x1 not set
See https://developer.mozilla.org/en-US/Add-ons/Installing_extensions#Disabling_install_locations
Then put the addons into extensions/myaddonid.xpi, making sure the filename is the id given in the install.rdf file inside the addon.xpi (zip-)file as <em:id>addon_id</em:id> tag.
On the next start the addons will be silently installed. Some addons needed one restart to work, at least the toolbar buttons were not added on the first start.
Not sure, if this will still work, when firefox decides to allow only addons signed by addons.mozilla.org. On the other hand, they will allow self-hosting addons, as soon as they are signed by AMO, so preinstalling addons downloaded from there will have a good chance.

How to install unpacked extension in firefox & chrome?

i have created extension by using crossrider they gave me xpi & crx file which i extracted and want to install manually by copying data to the browser's extension path.
I've read & tried many posts regarding this but they are not helpful because i think some posts are old & not able to find target paths & registry.
like in many posts they say create the following key in the registry here
32-bit Windows: HKEY_LOCAL_MACHINE\Software\Google\Chrome\Extensions
but i couldn't find that on my windows registry & i am using 32bit.
i want something like i copy my extension data to the browser's extension directory & inject some registry value thats all. if it possible then How?
For firefox just add the xpi or unpacked folder to the profile folder. No need for registry so its cross platform.
It can't be automatic as spyware would be all over that. After placing xpi in the extensions folder of the profile, on next startup of Firefox it will prompt saying it found an unauthorized by user add-on, and gives user a chance to enable it, or keep it disabled.
If you want to do it without startup, just launch the file path to the xpi or unpacked folder (if unpacked folder doesnt work, then point it to the install.rdf) in the browser, user will be prompted if they want to install.
There are some registry options though: Install Firefox extension using Windows registry
In Chrome, it's no longer possible to add an extension programmatically on Windows unless the extension is actually published in the Store.
This is for security reasons: previous registry-based (and otherwise) methods were open to malware abuse.
If your extension is published in the store, you can add it semi-automatically via registry. The user will still be asked whether to enable it on the next load.
You can also install extensions silently using Enterprise policy (only if the machine is part of a Windows domain and you have admin rights on the domain policy), on other OSes, or load it unpacked for testing with the --load-extension command line switch (will not persist after Chrome is restarted).
In Chrome go to
chrome://extensions
Enable Developer Mode at the top and click on the button to load an extracted extension.

Prevent users from disabling or uninstalling a Firefox addon

I'm building a Firefox add-on for children where I need to prevent them from disabling/uninstalling it.
I don't want them to be able to either remove or disable the add-on once it's installed.
How can I do this?
You can disable the access to add-on manager after you install the extension and then hide the shortcut in the bar. this works for me
Create a txt (windows) with this:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Software\Policies\Mozilla\Firefox]
"DisablePrivateBrowsing"=dword:00000000
"DisableFirefoxAccounts"=dword:00000000
"BlockAboutAddons"=dword:00000001
then change the .txt into .reg and execute
This one works for me:
Windows Registry extension
Installing or updating certain software on Windows can register an extension for Firefox or Thunderbird. For example, a Windows Registry entry to install a Firefox extension can be added under one of these keys:
HKEY_CURRENT_USER\Software\Mozilla\Firefox\Extensions\
HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions\
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Mozilla\Firefox\Extensions (Only on 64-bit versions of Windows)
The Registry entry name will be the ID name or GUID of the add-on and the value data will be the path to the folder containing the extension (see Adding Extensions using the Windows Registry - MDC for details). When Firefox or Thunderbird next starts, it will notice the entry and install the extension.
source
You need a supplemental program to do the work.
This mozillazine article has information:
In a few cases, an extension may be installed globally into the Mozilla installation directory. Installing a global extension is something an administrator might do so that the add-on can be used by any user on the machine. It is also possible that another software installation may have included a global extension (for example, the Java JRE installer adds a global extension to Firefox, for the Java Console). To manually uninstall a global extension, open the "extensions" directory in your Mozilla application's installation directory and remove the directory that corresponds to the extension you want to uninstall.
And here:
Extensions that are installed this way include the Java Quick Starter extension for Firefox (see above), the Microsoft .NET Framework Assistant the RealPlayer Browser Record Plugin extension, and the Lenovo ThinkVantage Password Manager extension for Firefox. Although you can disable the extension in the Add-ons manager, the Uninstall option may not be functional (it will be "greyed out). In such cases, experienced users can uninstall the extension by removing the associated Registry entry and/or the contents of the folder containing the extension; otherwise, simply disable it.

Cant re-install Chrome extension through registry after uninstall in manually

If I install and then uninstall our extension through the registry everything works fine.
But if I install it through the registry and then uninstall it through the browser extensions page the browser remembers it and i can't reinstall it through the registry even if I remove it and then try to reinstall it through the registry.
The only way I can have the extension reinstalled is to add it manually to the extensions page. But, I don't want my users to have to do it manually. Is there a way to force install it again?
Thanks,
Ben
I found a solution to the problem. But, I decided not to use it because I decided it is a good idea not to force installation after the user removed the extension.
Just thought that you will want to know the solution:
Turn off your Google Chrome browser go to the 'Preferences' file under:
c:\users\\AppData\Local\Google\Chrome\User Data\Default
there find your extension under "{Guid}" then delete everything from "{guid}" (included) to the close '}' and then save and start your browser. this hack will force chrome to check again for extensions and your extension will be on again.
I respect the Chrome policy to make the extension blacklisted in this case until the user manually adds it back through Chrome Extensions page UI. However there is another tweak available:
If you are using windows, open the 'Preferences' file in: "C:\users\AppData\Local\Google\Chrome\User Data\Default".
This is a JSON file. Look for your extension id (Guid) key with object value section. Changing the value of 'state' property from 2 to 1 in your extension Guid values section will force chrome to bring back your extension once you start chrome browser.
Note: The chrome browser must be closed completely before modifying this file.

How to launch an application from a browser?

Is it possible to launch an application from a browser? I am not talking about opening a file from a browser (like open a PDF with Adobe Reader), but rather opening a new (blank) instance of an application that is installed on the user's machine.
Hypothetical situation: User browses a website that lists computers that can be managed via RDP. He clicks on a link to 192.168.1.10, that link opens Microsoft RDP client (mstsc.exe) with that ip address already filled out.
I am talking strictly about Windows universe.
Is that thing even doable outside of ActiveX and IE?
Is it wise to attempt this in IE with ActiveX?
The correct method is to register your custom URL Protocol in windows registry as follows:
[HKEY_CLASSES_ROOT\customurl]
#="Description here"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\customurl\shell]
[HKEY_CLASSES_ROOT\customurl\shell\open]
[HKEY_CLASSES_ROOT\customurl\shell\open\command]
#="\"C:\\Path To Your EXE\\ExeName.exe\" \"%1\""
Once the above keys and values are added, from the web page, just call "customurl:\\parameter1=xxx&parameter2=xxx" . You will receive the entire url as the argument in exe, which you need to process inside your exe. Change 'customurl' with the text of your choice.
You can't really "launch an application" in the true sense. You can as you indicated ask the user to open a document (ie a PDF) and windows will attempt to use the default app for that file type. Many applications have a way to do this.
For example you can save RDP connections as a .rdp file. Putting a link on your site to something like this should allow the user to launch right into an RDP session:
Server 1
#AbhijithCR 's reply works well. To register the protocol via a .bat file, do something like this
set key=customurl
reg add HKCR\%key% /ve /d "URL:Description"
reg add HKCR\%key% /v "URL Protocol" /d ""
reg add HKCR\%key%\shell
reg add HKCR\%key%\shell\open
reg add HKCR\%key%\shell\open\command /ve /d ""c:\path to\your.exe" ""%%1"""
For me getting all the quotes and the double percent signs right was the tricky part.
Some applications launches themselves by protocols. like itunes with "itms://" links. I don't know however how you can register that with windows.
We use a sonicwall vpn. It launches a java applet that launches mstc with all the credentials setup. You really can't do this without a java applet or activex plugin.
Microsoft uses this technique itself on their small business server for getting inside the network. I wouldn't say it is a terrible idea, as long as platform independence isn't important.
You can use SilverLight to launch an application from the browser (this will work only on IE and Firefox, newer versions of chrome don't support this)
Example code here
I achieved the same thing using a local web server and PHP. I used a script containing shell_exec to launch an application locally.
Alternatively, you could do something like this:
Notepad

Resources