fix: 修复设计器嵌入到 iframe 时产生跨域异常

This commit is contained in:
力皓 2021-01-27 16:34:35 +08:00
parent 158b6a699f
commit 46dce7a1f1
3 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ function makeEventsHandler(
boostEvent: MouseEvent | DragEvent,
sensors: ISimulatorHost[],
): (fn: (sdoc: Document) => void) => void {
const topDoc = window.top.document;
const topDoc = window.document;
const sourceDoc = boostEvent.view?.document || topDoc;
// TODO: optimize this logic, reduce listener
// const boostPrevented = boostEvent.defaultPrevented;

View File

@ -160,7 +160,7 @@ function makeEventsHandler(
boostEvent: MouseEvent | DragEvent,
sensors: ISimulatorHost[],
): (fn: (sdoc: Document) => void) => void {
const topDoc = window.top.document;
const topDoc = window.document;
const sourceDoc = boostEvent.view?.document || topDoc;
// TODO: optimize this logic, reduce listener
const docs = new Set<Document>();

View File

@ -57,5 +57,5 @@
"publishConfig": {
"registry": "https://registry.npm.alibaba-inc.com"
},
"homepage": "https://unpkg.alibaba-inc.com/@ali/lowcode-rax-simulator-renderer@1.0.31/build/index.html"
"homepage": "https://unpkg.alibaba-inc.com/@ali/lowcode-rax-simulator-renderer@1.0.32/build/index.html"
}