0

Is it possible to open a link in another browser using Javascript?

I basically want to open Firefox from Google Chrome. I'm (attempting to) write an extension for chrome, but I can't find anything pointing to be able to do this.

I think I could use NPAPI plugins for Chrome, but they are being deprecated and are very insecure, so are there any alternate options?

downloader
  • 303
  • 5
  • 13

2 Answers2

1

You can use Native Messaging, paired with a native program which will launch the browser. I would write the native application in something like Python.

Scott
  • 604
  • 3
  • 7
  • 2
    Native Messaging is programming-language agnostic: You can write the native host in any language as long as it runs on the host. Read the documentation about it in the wiki. – FuzzyAmi Jul 19 '14 at 15:34
1

You did not provide enough info so I can't asses the utility of what I'm about to offer, but here's an option:

  1. Basically, use URL schemes to launch your application of choice from the browser. Start reading this SO question - How do I register a custom URL protocol in Windows?. You'll need to register some prefix - like "firefox://" for it to work. Should also be possible on other platforms.

  2. Of course, this assumes that your user has firefox installed and that you can register on their machine. If this application is meant for a the general public, you'll need to perform those by some other means (installer?)

Yet another way to go is (as mentioned above) to run some native code via the extension. Not a simple choice: once again you need to somehow install the native code on the host machine (and you cannot do that via Chrome extensions, for security reasons).

Community
  • 1
  • 1
FuzzyAmi
  • 7,543
  • 6
  • 45
  • 79