zlacker

[parent] [thread] 2 comments
1. mdibai+(OP)[view] [source] 2023-07-26 14:03:58
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; }
replies(2): >>return+QU >>zzo38c+Hi1
2. return+QU[view] [source] 2023-07-26 17:27:38
>>mdibai+(OP)
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.
3. zzo38c+Hi1[view] [source] 2023-07-26 18:50:16
>>mdibai+(OP)
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.

[go to top]