Advertisement
Guest User

Reopen in Chrome if a page is loaded in Facebook

a guest
May 22nd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     var ua = navigator.userAgent || navigator.vendor || window.opera;
  2.     // if Facebook in app browser
  3.     if (ua.indexOf("FBAN") > -1 || ua.indexOf("FBAV") > -1) {
  4.         // if Android OS
  5.         if (ua.match(/Android/i)) {
  6.             // redirect to URL that opens the current URL on Chrome.
  7.             window.location.replace("googlechrome://navigate?url=" + encodeURI(window.location));
  8.         }
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement