I recently updated my websites with some new features and I had a problem, Iam adding some animations to some pages that works with webkit only, I need to hide that website from chrome users until I finish but still visibile at the same time to firefox, ie, opera users, how can I do that ? PS: i can't use .htaccess file... any suggestions ?
Asked
Active
Viewed 45 times
1
-
Do you want to block the animations only, the pages, or the entire website from chrome users? And does your site use PHP to render your HTML or are you using other languages like NodeJS? – jrswgtr Aug 23 '18 at 17:44
-
If you want to do it with JS only you can look at this answer: https://stackoverflow.com/a/9851769/8108407 – jrswgtr Aug 23 '18 at 17:48
-
I need to block the whole website from chrome users – Aug 23 '18 at 17:54
-
1You could use the code in the link I posted to determine if chrome is the browser and then redirect to a different site. If you don't want to redirect you should be looking at a PHP (?) solution. A server side solution will be better anyway. – jrswgtr Aug 23 '18 at 17:57
1 Answers
0
You can check if the browser is Chrome to change the contents of the page.
var isChrome = !!window.chrome && !!window.chrome.webstore;
if(isChrome){
document.body.innerHTML = "<h1>Chrome is not yet supported</h1><p>Sorry for the inconvenience</p>";
}
<body>
<h1>Header Of the Website</h1>
<p>
Content...
</p>
</body>

Unmitigated
- 76,500
- 11
- 62
- 80