-1

I have a use case where i should target a link to be opened in firefox instead of internet explorer. I can't change the default browser settings since it is handled in an organisation level and i don't have any kinda admin rights. The only option left infront of me was trying something in javascript and finally I have read somewhere that we can target edge by prefixing it's name as part of url as shown here

Window.open('microsoft-edge:http://www.google.com')

It is working well and good in all the browsers. But unfortunately i couldn't figure out how to open firefox. Does anyone know how to target firefox ?

Thanks in advance.

Shekar
  • 41
  • 3
  • if you have control of the system running the browser, you can add a new protocol handler like this: https://stackoverflow.com/questions/80650/how-do-i-register-a-custom-url-protocol-in-windows – Adder Feb 27 '20 at 10:33

1 Answers1

0

You Can Use This Trick.

$(function () {
    $('#btn').click(function () {
        openNewTab("http://stackoverflow.com")
        return false;
    });
});

function openNewTab(link) {
    var frm = $('<form   method="get" action="' + link + '" target="_blank"></form>')
    $("body").append(frm);
    frm.submit().remove();
}
Tushar
  • 54
  • 4
  • It's not the answer i have been expecting. Here nowhere it is mentioned about firefox. My question is different, try to read it once again if still not clear i will try to frame the question in other words. – Shekar Feb 27 '20 at 09:55