Forum Discussion
JanMartin444
Oct 06, 2022Copper Contributor
Edge closes window earlier than Chrome when calling window.close() after triggering ms-word scheme
Hoping this gets the eye of a developer or someone who can log a ticket.
I have a page whose sole job is to launch a word document using the ms-word: custom URI scheme.
To avoid annoying the user with many open windows it also calls window.close() after 5 seconds.
If the user takes longer than 5 seconds to click on the "Allow this page to launch an external application" prompt, the window closes and the word document is not launched.
Google Chrome does not have this issue, if the user takes too long, the window is closed, but the word document is always launched. I am guessing there is some order of operations issue in Edge.
Here is a sample:
<html>
<head>
<title>Launching...</title>
</head>
<body>
<p>
This web page was used to launch a document and should automatically close in 5 seconds, feel free to close it.
</p>
<script>
const link = "ms-word:https://myworddocument/";
window.location.assign(linkDecoded);
setTimeout(function () {
window.close();
}, 5000);
}
</script>
</body>
</html>No RepliesBe the first to reply