Skip to content

Commit 3eb0528

Browse files
authoredMar 2, 2022
fix(oauth2): addEventListener only if document state is not 'loading' (#7879)
1 parent 824917c commit 3eb0528

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed
 

‎dist/oauth2-redirect.html

+7-3
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,13 @@
6767
window.close();
6868
}
6969

70-
window.addEventListener('DOMContentLoaded', function () {
71-
run();
72-
});
70+
if (document.readyState !== 'loading') {
71+
run();
72+
} else {
73+
document.addEventListener('DOMContentLoaded', function () {
74+
run();
75+
});
76+
}
7377
</script>
7478
</body>
7579
</html>

0 commit comments

Comments
 (0)
Please sign in to comment.