Skip to content

Commit

Permalink
fix: iframe sandbox element scope error
Browse files Browse the repository at this point in the history
  • Loading branch information
knight.chen committed Nov 28, 2023
1 parent 3fd755c commit 0fc2100
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sandbox/iframe/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
logWarn,
isUniqueElement,
isInvalidQuerySelectorKey,
throttleDeferForSetAppName,
} from '../../libs/utils'
import globalEnv from '../../libs/global_env'
import bindFunctionToRawTarget from '../bind_function'
Expand Down Expand Up @@ -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 },
})
})
Expand Down

0 comments on commit 0fc2100

Please sign in to comment.