From 0fc21004c0f58e51b251d41faf3545fb04595a98 Mon Sep 17 00:00:00 2001 From: "knight.chen" Date: Tue, 28 Nov 2023 17:58:35 +0800 Subject: [PATCH] fix: iframe sandbox element scope error --- src/sandbox/iframe/document.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sandbox/iframe/document.ts b/src/sandbox/iframe/document.ts index c1c74a47..282dabe8 100644 --- a/src/sandbox/iframe/document.ts +++ b/src/sandbox/iframe/document.ts @@ -11,6 +11,7 @@ import { logWarn, isUniqueElement, isInvalidQuerySelectorKey, + throttleDeferForSetAppName, } from '../../libs/utils' import globalEnv from '../../libs/global_env' import bindFunctionToRawTarget from '../bind_function' @@ -256,7 +257,10 @@ function patchDocumentProperty ( rawDefineProperty(microDocument, tagName, { enumerable: true, configurable: true, - get: () => rawDocument[tagName], + get: () => { + throttleDeferForSetAppName(appName) + return rawDocument[tagName] + }, set: (value: unknown) => { rawDocument[tagName] = value }, }) })