Force open Facebook / Twitter / Google in browser

-1

I created a mobile app that is accessed via the browser (a Web app, a regular site).

On it I have a button that opens via window.open () a page on Facebook, but when I click the button, it calls the Facebook application. I need the page to open in the phone's own browser.

I have already tried it as window.open (url, '_system', 'location = yes'), but it does not work,

Is there a solution?

    
asked by anonymous 22.05.2016 / 17:23

1 answer

0

Try this,

HTML:

<div id="teste" data-href="http://www.google.com">Google</div>

JavaScript:

document.getElementById("teste").addEventListener("click", function(evt) {
    var a = document.createElement('a');
    a.setAttribute("href", this.getAttribute("data-href"));
    a.setAttribute("target", "_blank");
    var dispatch = document.createEvent("HTMLEvents");
    dispatch.initEvent("click", true, true);
    a.dispatchEvent(dispatch);
}, false);

Anything put there.

    
22.05.2016 / 21:16