Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I think I will just block Chrome users from my websites


I looked into this, and it's way harder than you think. Several browsers report themselves as Chrome, Chrome itself is about to get rid of its user agent, and all the javascript feature detection methods I could find no longer work.


A whitelist would work better than a blacklist, as with most other cases in dev ;)


I don't see how that helps at all. I couldn't find any reliable method for distinguishing between Brave (or Vivaldi?) and Chrome. A any whitelist would exclude other Chrome-based browsers.


That's interesting and ethical by providing suggestions as alternatives! I'd be interested too, but I can't find much on the web... do you guys have any instructions/link?


You mean blocking the agent or do you mean other browsers?


Blocking on my site the access from the Chrome browser only, or displaying a banner page – e.g. "You are using Chrome, thou shall not pass"


You have to capture the agent that is visiting and doAction() when it finds it.

Here is adecent article: https://geekflare.com/block-unwanted-requests/


Thank you, I hoped it could be done from the website code. Currently I have a Hugo blog hosted on ahem Firebase – not the best de-Googled solution. :)


I can definitely recommend Vercel as a good alternative. Very open source community around them and a great product.


There are many solutions, from client side JS, serverside coding to your server settings themselves.

There is a nice thing in there, banning a google browser on a google product ;)


In the end, I managed to add a banner on my Hugo blog[1] that should appear with all the browsers (for now) except for Firefox and Brave. I did it in two steps:

1- CSS "supports" feature to identify Mozilla Firefox[2]

2- A simple JS script to identify Brave[3]

[1]: https://crooked.ink

[2]: https://stackoverflow.com/questions/12625876/how-to-detect-c...

[3]: https://stackoverflow.com/questions/36523448/how-do-i-tell-i...


Absolutely. Block page with instructions on how to gain access.


What browser do you recommend?


Firefox is the best option.

I think browser diversity is important to ensure that web platform features are thoroughly planned. While FLoC shows that chromium-based browser will oppose the worst features that Google attempts to push through Google has already been know to implement web features that all other browsers have expressed no interest in implementing, often due to privacy concerns. So while I think many other Chromium based browsers are better than Chrome giving market share to an alternate browser engine is a huge benefit for the open web.

An example where Firefox felt that the privacy concerns of a feature were not sufficiently addressed is https://chromestatus.com/feature/4733392803332096. There are many more examples, especially around many of the APIs to expose local devices.

Another option is Safari which I consider a better option than Chrome but they also seem to prefer pushing native apps over the open web and Safari seems to purposely lag behind on implementing some critical web features (especially on mobile).


Block based on feature detection instead of browser sniffing.

if (document.interestCohort) {...


This!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: