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

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...




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

Search: