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

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
This commit is contained in:
Bogdan-Hasanov
2022-03-02 21:27:53 +02:00
committed by GitHub
parent 544d16da35
commit 824917c2aa

View File

@@ -66,7 +66,11 @@
window.close();
}
window.addEventListener('DOMContentLoaded', function () {
if( document.readyState !== 'loading' ) {
run();
});
} else {
document.addEventListener('DOMContentLoaded', function () {
run();
});
}
</script>