Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Both success and failure callbacks are executed in IE #20

Open
40rn05lyv opened this issue Feb 15, 2017 · 0 comments
Open

Both success and failure callbacks are executed in IE #20

40rn05lyv opened this issue Feb 15, 2017 · 0 comments

Comments

@40rn05lyv
Copy link

Steps:

  1. Create and open in IE following index.html file:
<html>
<head>
<script src="protocolcheck.js"></script>
</head>
<body>
<script>
function test() {
	protocolCheck('blablabla', function() { alert("Failure!"); }, function() { alert("Success!"); } );
}
</script>
<button onclick="test()">Test</button>
</body>
</html>
  1. Open file in IE11 (Windows 7)

Expected result:
Failure callback is executed.
Actual result:
Failure and Success callbacks are executed.

Solution:
In openUriWithHiddenFrame function change order of lines in timeout function.
From:

        var timeout = setTimeout(function () {
            failCb();
            handler.remove();
        }, 1000);

to

        var timeout = setTimeout(function () {
            handler.remove();
            failCb();
        }, 1000);

Also, it's better to do the same in detection code for Chrome (openUriWithTimeoutHack function).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant