From 3eb05287efec9300ae612092e44f5378113179a3 Mon Sep 17 00:00:00 2001 From: Tim Lai Date: Wed, 2 Mar 2022 11:38:19 -0800 Subject: [PATCH] fix(oauth2): addEventListener only if document state is not 'loading' (#7879) --- dist/oauth2-redirect.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/oauth2-redirect.html b/dist/oauth2-redirect.html index 64b171f7..b662eed4 100644 --- a/dist/oauth2-redirect.html +++ b/dist/oauth2-redirect.html @@ -67,9 +67,13 @@ window.close(); } - window.addEventListener('DOMContentLoaded', function () { - run(); - }); + if (document.readyState !== 'loading') { + run(); + } else { + document.addEventListener('DOMContentLoaded', function () { + run(); + }); + }