Skip to content

Commit

Permalink
fix(oauth2): addEventListener only if document state is not 'loading' (
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-lai committed Mar 2, 2022
1 parent 824917c commit 3eb0528
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dist/oauth2-redirect.html
Expand Up @@ -67,9 +67,13 @@
window.close();
}

window.addEventListener('DOMContentLoaded', function () {
run();
});
if (document.readyState !== 'loading') {
run();
} else {
document.addEventListener('DOMContentLoaded', function () {
run();
});
}
</script>
</body>
</html>

0 comments on commit 3eb0528

Please sign in to comment.