News for hackers. Stuff that matters.
Re:Google is already pushing WEI (web DRM) into Chromium by mdibaiee on Wednesday July 26, 2023 @10:03AM (#36877913)
For people who want to put something like this, here is the code snippet:

  <span id='browser' class='hidden'>
    This website is designed for <a target="_blank" rel="noopener noreferrer" href="https://firefox.com/">Firefox</a>, a web browser that respects your privacy.
  </span>

  <script>
    if (window.chrome) {
      document.getElementById('browser').className = '';
    }
  </script>
Class .hidden must hide the element somehow, in this case I do:

  .hidden { display: none; }
Re:Google is already pushing WEI (web DRM) into Chromium by returningfory2 on Wednesday July 26, 2023 @01:27PM (#36881437)
Thanks for the code! I would slightly change the phrasing. "This website is designed for X" is traditionally, in my opinion, a user-hostile statement which indicates the user has to do something to accommodate the website. "We recommend you use Firefox, a web browser that respects your privacy" or something doesn't have this vibe IMO.
Re:Google is already pushing WEI (web DRM) into Chromium by zzo38computer on Wednesday July 26, 2023 @02:50PM (#36882916)
I would make a few changes:

1. Instead of using CSS to hide it by default, make the script to only add it (perhaps by document.write, or alternatively by adding text to an empty <div> or <span>) if Chrome is detected. (This way it will be compatible even if CSS is disabled (or not implemented).)

2. Instead of Firefox, mention something else such as Line Mode Browser (it has some features I had not seen in other web browsers, but which I think are good and would like to have), or some other uncommon one which doesn't have Google and Mozilla etc, or more than one.