Windows 10 / Microsoft Edge Browser - This website needs Internet Explorer...

We have a public application that will fail in Edge. We want to pop that message so the users know they can click and "Open with Internet Explorer". So, we really want the same behavior experienced if you open support.dell.com in Edge. It will throw that page to open in IE instead. How do we do that?  Thanks in advance!
RickzzzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

it_saigeDeveloperCommented:
The way Dell does it is match the UserAgent-String against "Edge\/\d+" using a regular expression.  If found redirect to a page with the following:
<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta charset="utf-8" />
    <title>Internet Explorer needed</title>
    <link rel="stylesheet" type="text/css" href="ErrorPageStyles.css">
    <script src="ms-appx-web:///Assets/ErrorPages/ErrorPageScripts.js" language="javascript" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">

        window.onload = function () {
            // Populate checkbox
            var url = getUrl();
            if (IsTopLevel())
            {
                if (IsEnterprise())
                {
                    var autoLaunch = true;
                    if (HasState(url))
                    {
                        autoLaunch = GetState(url);
                    }
                    if (autoLaunch)
                    {
                        SetState(getUrl(), true);
                        LaunchIE(true);
                    }

                    // Set the checkbox value
                    document.getElementById("autolaunch").checked = autoLaunch;

                    // Show the enterprise string
                    document.getElementById("needie_body").style.display = "none";
                    document.getElementById("needie_configured_automatic_open").style.display = "inline";
                }
                else // consumer page
                {
                    // Hide the checkbox
                    document.getElementById("checkboxTable").style.display = "none";

                    // Show Consumer string
                    document.getElementById("needie_body").style.display = "inline";
                    document.getElementById("needie_configured_automatic_open").style.display = "none";
                }
            }
            else
            {
                // Hide the checkbox, button, and "continue" link in iframes
                document.getElementById("checkboxTable").style.display = "none";
                document.getElementById("launchIE").style.display = "none";
                document.getElementById("ContinueInSpartan").style.display = "none";
            }

            // Populate ContinueInSpartan link
            document.getElementById("ContinueInSpartan").href = getFullUrl();

            goToLocalizedErrorPage();
        }

        getFullUrl = function ()
        {
            var docUrl = document.location.href;
            var beginIndex = docUrl.indexOf('#') + 1;
            return docUrl.substring(beginIndex);
        }

        // Returns the code for why we navigated to NeedIE:
        // 0 = No transition/Error
        // 1 = EMIE Site List
        // 2 = Intranet Policy is set
        // 3 = Cloud CV List
        // 4 = Keep in Spartan
        getReason = function ()
        {
            var docUrl = document.location.href;
            var reasonStr = '?reason=';
            var beginIndex = docUrl.indexOf(reasonStr) + reasonStr.length;
            var lastIndex = docUrl.indexOf('#');
            // Check that the '?reason=' comes before '#<url>', so that we aren't searching the error url
            if (beginIndex < lastIndex)
            {
                return docUrl.charAt(beginIndex);
            }
            return 0;
        }

        IsEnterprise = function ()
        {
            // If NeedIE is showing because the URL was Enterprise SiteList (1) or
            // the IntranetToIE policy is set (2), we want the Enterprise experience
            var reason = getReason();
            return (reason == 1 || reason == 2);
        }

        IsTopLevel = function ()
        {
            return (window.top == window.self);
        }

        // Returns true if we have state saved in registry for this site
        HasState = function (url)
        {
            return window.external.HasNeedIEAutoLaunchFlag(url);
        }

        // Get the auto-launch preference from registry
        GetState = function (url)
        {
            return window.external.GetNeedIEAutoLaunchFlag(url);
        }

        // Set the auto-launch preference from registry
        SetState = function (url, state)
        {
            window.external.SetNeedIEAutoLaunchFlag(url, state);
        }
        
        LaunchIE = function (automated)
        {
            window.external.LaunchIE(getFullUrl(), automated);
        }

        OnAutoLaunchClicked = function (checkbox)
        {
            SetState(getUrl(), checkbox.checked);
        }

        // Launch URL in IE
        OnLaunchIEClicked = function ()
        {
            SetState(getUrl(), document.getElementById("autolaunch").checked);
            LaunchIE(false);
        }

    </script>
</head>

<body>
    <div id="Wrapper">
        <div id="NotConnected">
            <table>
                <tr>
                    <td>
                        <img id="imageicon" alt="Internet Explorer" style="font-weight:normal" src="ielogo.svg"/>
                    </td>
                    <td>
                        <h1 id="needie_header">This website needs Internet Explorer</h1>
                        <p id="needie_body">
                            This website uses technology that will work best in Internet Explorer.
                        </p>
                        <p id="needie_configured_automatic_open" style="display:none">Your organization has set this site to automatically open in Internet Explorer.</p>
                        <br />
                        <button id="launchIE"
                                class="pushbutton"
                                type="submit"
                                onclick="OnLaunchIEClicked();">
                            <id id="needie_open_in_ie">Open with Internet Explorer</id>
                        </button>
                        <table id="checkboxTable" style="margin:16px 0px 0px 0px">
                            <tr>
                                <td class="checkboxes">
                                    <label>
                                        <input type="checkbox" id="autolaunch" onclick="OnAutoLaunchClicked(this);" />
                                        <span class="text-body">
                                            <id id="needie_automatically_open">Automatically open this site with Internet Explorer in the future</id>
                                        </span>
                                    </label>
                                </td>
                            </tr>
                        </table>
                        <br />
                        <br />
                        <br />
                        <a id="ContinueInSpartan" href=""><id id="needie_open_in_spartan">Keep going in Microsoft Edge</id></a>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</body>
</html>

Open in new window

-saige-
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JohnBusiness Consultant (Owner)Commented:
The other answer is that Edge is new and does not work with everything out there. I have Windows 10 Pro 64-bit and use IE 11 and it works with everything. Just use IE for the time being.
0
RickzzzAuthor Commented:
Thanks it_saige. I guess I'm confused though. Doesn't Edge pop that page based on a tag or script in the page initially opened that isn't compatible?

I guess I'm assuming there's something in the default page @ http://support.dell.com that's forcing the Edge browser to throw that web page stating use IE or continue in Edge.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

RickzzzAuthor Commented:
So is it something like this in the loaded page not supported?

<script type="text/javascript">
                            if (navigator.userAgent.indexOf('Edge') != -1) 
                            {
                                // Edge not supported
                                document.location = "http://www.SomeMicrosoftWebsite/page";
                            }
                        </script>

Open in new window

0
it_saigeDeveloperCommented:
Something like that.  Here is one example:
INDEX.HTML
<html>
<head>
<title>Fun with UserAgent-String</title>
<script>
	<!--
	var isEdge = { function() { return navigator.userAgent.match("Edge\/\d+"); } };
	if (isEdge)
		window.location = <redirect to some page that warns them about edge or otherwise>
	//-->
</script>
</head>
	Your browser is supported.
</html>

Open in new window

-saige-
0
RickzzzAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 10

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.