Detect Internet Explorer -> redirect to Google Chrome download

Hello,

Here is a quick javascript snipet for those who, like me, are tired to have to explain to their clients that supporting a legacy browser :skull: with advanced layout is simply not possible. Maybe our role is also to educate people, why would one still use internet explorer ? Surely not everyone aggrees but I just can’t keep up with having to justify certain module not working as expected on msie.

Codepen here

/*
 * Internet Explorer 🤡 should die, really.
*/
function searchAndDestroy() {
  var internetExplorer = navigator.userAgent.match(/Trident.*rv[ :]*11\./i);
  var userAgent = navigator.userAgent.match(
    /(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i
  );
  if (internetExplorer) {
    // shame on you
    alert(
      "Oops, you're using Internet Explorer! Consider a modern and secure browser such as Chrome, Safari, Firefox or Edge."
    );
    setTimeout(function () {
      // redirect to Chrome download page
      window.open("https://www.google.com/chrome/");
    }, 1500);
  } else {
    // good user, rock on
    console.log("Yay 🍑 your modern browser is " + userAgent[1]);
  }
}
searchAndDestroy();
2 Likes

Thank’s for sharing!
I’m not really behind this approach though, some corporate networks only allow old IE and it’s always better to be inclusive rather then exclusive. There’s a reason fallback’s are a thing, there’s always a solution to provide a fallback for modern features :slight_smile:

Corporate legacy things were a thing in 2010, name and shame them in 2020. Especially the IT staff and escalate to senior management, Who’ve most likely ignored and/or belittled the advice of their IT team, they’ve had a decade to get their act together. Whilst probably sending messages from an iPhone which is part of the problem. Rules for thee etc…

1 Like

Definitely on the same page with you (as my personal opinion & in that exact sense)!
There might be some reasons still, that one might not consider like… screen reader for people with handicaps that are still based on those legacy softwares. Those might be extreme edge-cases but still :slight_smile: It’s dangerous to only assert narrow-minded intend if you get what I’m saying

As long as Webflow and any webpage meets appropriate w3c accessibility standards if required, disabled users are and should be catered for. The issue is that they may not have…

Which is a whole can of worms that needs to be opened.

You could argue that the unrepresentative demographic of high function autistics whom are actively recruited for in tech firms have not and also do not consider themselves to have a disability which may be a major factor in the disregard in issues such as accessibility for other disabled people.

I agree, dear sir!

(must at least be 20 chars…)

Never considered that!