-3

I have got a popup for IE users. There's a download link to chrome and firefox. Is it possible to create two buttons?

Open this site in "Chrome" (then the site will open chrome on the computer).

Open this site in "Firefox" (then the site will open chrome on the computer).

I've tried this, with no luck: enter image description here

M3ghana
  • 1,231
  • 1
  • 9
  • 19
Keviin Cosmos
  • 177
  • 14
  • 2
    Post your code please.. – sparkhead95 Sep 10 '18 at 10:13
  • I've tried with the above script.. I don't know where to start, i'm new to jQuery and only very little with pure JS. – Keviin Cosmos Sep 10 '18 at 10:17
  • Possible duplicate of https://stackoverflow.com/questions/10070744/open-ie-browser-in-firefox-chrome-page – sparkhead95 Sep 10 '18 at 10:21
  • Refer these - https://stackoverflow.com/questions/26918255/how-to-open-a-link-in-chrome-browser-even-though-the-default-computer-browser-i https://stackoverflow.com/questions/5881383/can-i-force-a-link-to-open-in-a-specific-browser – M3ghana Sep 10 '18 at 10:23

1 Answers1

1

In general, you can't use JavaScript to tell the user's device to open an application (or run any other arbitrary operating system command).

Why?

  1. It's a massive security hole - what if you told it to execute a malicious script, or to delete all the files on disk?
  2. You can't assume that the user's device actually has the program in question available.
  3. You can't assume what operating system the device runs, so you have no way to know exactly how to issue the command anyway.

Point 3 doesn't apply so much to your IE-specific idea, but that's the principle being applied. You'll also find that ActiveX (which you're using to work around point 1) is disabled or blocked in many installations, and will at the very least require the user to confirm that they wish to allow its use on your page, assuming they have the privileges to enable it at all. You would then also have to specify the correct path to the executable, which may differ on different machines.

ADyson
  • 57,178
  • 14
  • 51
  • 63