In a previous article, I stated that I refuse to create any code to support Internet Explorer (IE).
It's worth your time to take a quick side trick and read the security issues in IE.
IE was notorious. Hackers exploited the vulnerabilities ... users paid the price with defaced websites, data breaches and data theft, email redirection and more. Even more notorious was Microsoft's response. Certainly not timely. This, despite the fact that many internet watchdog agencies recommended using any other browser to overcome the security issues.
To website developers, IE represents a huge extra work load. In IE, Microsoft worked tirelessly to control the browser market. It created its own "standards" that did not match other browsers. That means developers need to support two differing standards. Microsoft and the rest of the world.
In 2019, Microsoft recommended users stop using Internet Explorer. In 2020, Microsoft Teams can no longer be accessed by Internet Explorer. In 2021, Microsoft 365 no longer accesses Internet Explorer. WordPress also dropped support for Internet Explorer in 2021.
The third reason is dwindling user base. As of May 2024, Internet Explorer has about 0.1% market share. One-tenth of one percent. To put that in perspective, out of 1000 users that visit your website, MAYBE ONE uses Internet Explorer. MAYBE.
Microsoft Edge was officially released in 2015 to replace Internet Explorer. Microsoft Edge's global market share is 5.19%. The market leader is Google's Chome browser with 64.86% global market share.
As an aside, I personally prefer (and use) Librewolf. It's a custom version of Firefox with an emphasis on privacy.
There are two issues when refusing to serve pages to IE. You have to detect it. A CSS detect will only work up to IE version 10. In version 11, Microsoft removed the detect functionality. The only reliable way of detecing all versions of IE is to use Javascript. And, that's the first problem. In IE, you can disable Javascript and bypass a Javascript routine to identify IE as the browser being used.
That, then, is my second disclosure: I also refuse to serve pages to ANY browser that has Javascript disabled.
According to statistics, 97.9% of websites use Javascript in one form or another. Most CSS frameworks rely on a Javascript implementation like JQuery, React, or Vue. I (and my company) have had some form of Javascript detect in the websites we develop for most of the last 20 years. And in the past 10 years, the detect redirects to a noscript.html page with instructions on how to enable Javascript in various browsers. No Javascript and we don't display web pages – regardless of browser brand or type.
That means there is no problem in using a Javascript detect routine for Internet Explorer. It's a two part test based on inspecting the user agent. Internet Explorer up to version 10 used "MSIE" user agent, and version 10 used both "MISE" and "Trident" while version 11 used "Trident" ... check for either of those user agents and you have all the Internet Explorer browsers and all other browsers that used the IE core. Find those user agents, and the script redirects to "upgrade-browser.html".
There is no way around the test. It's worth a read through that link at the start of this article.