0

I want that javascript detects which browser I am using, and if it isn't safari redirect it to safari. My website is mostly build on Safari. So if someone is opening my website on another browser they will be redericted to the page on safari. ANYONE HAVE AN ANSWER?! (btw my english isn't the best)

1 Answers1

0

There is no way to change the browser from inside the client. You can request that they open it, but not force them.

Your best bet would be to render the site correctly to Safari users and redirect users not using Safari to a page that asks them to instead install it.

How to detect the browser: http://www.quirksmode.org/js/detect.html

Example:

window.addEventListener("onload", function() {
    if(BrowserDetect.browser === "safari") {
        window.location.replace("usesafari.html");
    }
});
Dan Prince
  • 27,111
  • 12
  • 81
  • 112