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 ?





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






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.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)