I am trying to make a website with features only available on browsers with WebKit engines, So I wanted the website to be displayed only on WebKit browsers and redirect to an alternative website if the host's browser doesn't use Webkit, Is it possible? If yes, How can it be done?
Asked
Active
Viewed 37 times
0
-
1Take a look: https://stackoverflow.com/questions/5916900/how-can-you-detect-the-version-of-a-browser – dazed-and-confused Dec 30 '20 at 13:34
-
The best approach would be to use feature detection rather than browser sniffing. Can your browser do X, Y and Z? Then go ahead, I don't need to see your ID. – Álvaro González Dec 30 '20 at 16:15
2 Answers
1
document.onload=function() {
if(navigator.userAgent.indexOf("Chrome") === -1 )
{
window.location.replace("http://www.stackoverflow.com");
}}
![](../../users/profiles/10466897.webp)
Nader Hashemi
- 26
- 3
0
You can redirect the traffic based on user agent to different endpoints before it arrives to your origin. It depends on your InfraStructure. for Ex you can use Big-IP or Stingray with TrafficScript or also with AWS-cloudfront and Lambda functions.
![](../../users/profiles/9339587.webp)
Pedram Rastegar
- 71
- 1
- 3