I would like to block content on some specific languages whenever I open a page on my browsers (Safari and Chrome on macOS 11.4). I think the best solution is to use Google Translate API and check which language the page is written in, and according to the result show the page as it is or an error message.
However, I'm not sure if it is possible to run a custom script whenever I open a web page on my browser. If it is possible, how can I do?