Skip to content

Commit

Permalink
fix: 修复属性获取问题导致代码运行报错
Browse files Browse the repository at this point in the history
chore: 去除iframe部分代码
  • Loading branch information
yiludege committed Mar 28, 2023
1 parent b7e2600 commit 09419fd
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions packages/wujie-core/src/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,6 @@ function rewriteAppendOrInsertChild(opts: {
return rawAppendChild.call(rawDocumentQuerySelector.call(this.ownerDocument, "html"), element);
}
const res = rawDOMAppendOrInsertBefore.call(this, element, refChild);
try {
// 降级的dom-iframe无需处理
if (!element.getAttribute(WUJIE_APP_ID)) {
const patchScript = (element as HTMLIFrameElement).contentDocument.createElement("script");
patchScript.type = "text/javascript";
patchScript.innerHTML = `Array.prototype.slice.call(window.parent.frames).some(function(iframe){if(iframe.name === '${wujieId}'){window.parent = iframe;return true};return false})`;
element.contentDocument.head.insertBefore(patchScript, element.contentDocument.head.firstChild);
}
} catch (e) {
error(e);
}
execHooks(plugins, "appendOrInsertElementHook", element, iframe.contentWindow);
return res;
}
Expand Down

0 comments on commit 09419fd

Please sign in to comment.