Block access from certain clients
Block access from certain clients
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 ?
If you want to do it with JS only you can look at this answer: stackoverflow.com/a/9851769/8108407
– jrswgtr
Aug 23 at 17:48
I need to block the whole website from chrome users
– Evilwolf97
Aug 23 at 17:54
You 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 at 17:57
Thank you ! solved :)
– Evilwolf97
Aug 23 at 18:29
1 Answer
1
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>
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
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 at 17:44