From ee66c74259dc80e0f477e46f6689e76305e9fbd2 Mon Sep 17 00:00:00 2001 From: Teages Date: Thu, 3 Aug 2023 00:13:12 +0800 Subject: [PATCH] fix: legacy way to check isLoaded --- src/script-manager/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script-manager/common.ts b/src/script-manager/common.ts index 4426a5b8dd..6160246425 100644 --- a/src/script-manager/common.ts +++ b/src/script-manager/common.ts @@ -140,7 +140,7 @@ export function checkRecaptchaLoad() { return false } - const isLoaded = Object.hasOwn(window, 'grecaptcha') && Object.hasOwn(window.grecaptcha, 'execute') + const isLoaded = window.grecaptcha && window.grecaptcha.execute instanceof Function if (isLoaded) { recaptchaLoaded.resolve() }