fix(oauth2): addEventListener only if document state is not 'loading' (#7879)

This commit is contained in:
Tim Lai
2022-03-02 11:38:19 -08:00
committed by GitHub
parent 824917c2aa
commit 3eb05287ef

View File

@@ -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>