Firefox extension that adds context menu option (right click on link) to open links in Chrome browser.
Works on
- Windows
- Ubuntu
- Linux distros (Not tested; Should work by following Ubuntu related steps)
Mac isn't suported because I have no way to test it, feel free to make a PR.
Firefox extensions can't open/access other browsers, so we need to use something which allow us to do it. That thing is Native Messasing which allows extension and Native Messaging Host to communicate who can open other browsers. The executable file you see in releases for your OS is that Native Messaging Host.
- Install extension from https://addons.mozilla.org/en-US/firefox/addon/open-link-in-chrome
Note: If you don't trust the executable files provided in releases, then you can generate your own excutables. See here how to do it.
-
From Ubuntu releases download
open_link_in_chrome_host.json
andopen_link_in_chrome_host
-
Move
open_link_in_chrome_host
anywhere you want, where you will not accidently delete it -
Edit "path" value in
open_link_in_chrome_host.json
and put exact path ofopen_link_in_chrome_host
-
Move
open_link_in_chrome_host.json
to/home/<your_username>/.mozilla/native-messaging-hosts/
-
From Windows releases download
open_link_in_chrome_host.json
andopen_link_in_chrome_host.exe
-
Move both files anywhere you want where you will not accidently delete them
-
Edit "path" value in
open_link_in_chrome_host.json
and put exact path ofopen_link_in_chrome_host.exe
-
Add Registry key by executing following commands in Powershell, Replace
<path to open_link_in_chrome_host.json>
with exact path ofopen_link_in_chrome_host.json
New-Item -Path "HKLM:\SOFTWARE\Mozilla\NativeMessagingHosts\open_link_in_chrome_host" -Force | Out-Null New-ItemProperty -Path "HKLM:\SOFTWARE\Mozilla\NativeMessagingHosts\open_link_in_chrome_host" -Name "(Default)" -Value "<path to open_link_in_chrome_host.json>" -PropertyType String -Force
Above commands only add registry key,which is needed by firefox. You can do it manually if you know what you are doing.
Path:
HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts
(Default) Value:<path to open_link_in_chrome_host.json>
- Open
about:debugging#/runtime/this-firefox
and select manifest.json file
You are on Ubuntu and have Python installed, then consider this:
If you have Python installed and using Ubuntu you don't need to do this. In
./Native-Messaging-Host/Ubuntu
folder open_link_in_chrome_host.py has shebang notation (first line), just put appropriate name on that linepython
orpython3
based on how you access python in your system and use that file in place of executable file (in installation where I have mentionedopen_link_in_chrome_host
just consideropen_link_in_chrome_host.py
, make sure to do the same in .json file "path" value)
Note: If you follow below steps in Windows, then generated file can only be used in Windows. If you follow below steps in Ubuntu, then generated file can only be used in Ubuntu.
- Install Python module
Pyinstaller
(I prefre this module)python3 -m pip install pyinstaller
- Open terminal and go to (replace <Your_OS> with Windows or Ubuntu)
./Native-Messaging-Host/<Your_OS>/open_link_in_chrome_host.py
- Run command
python3 -m pyinstaller open_link_in_chrome_host.py --onefile
- Generated file will be in
./Native-Messaging-Host/<Your_OS>/dist/
- Take that file instead of one provided in releases for your OS, and follow Installation instructions