@zzdadelu/schema-builder 1.0.0-alpha.74 → 1.0.0-alpha.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/createIframe.js +3 -0
- package/lib/createIframe.js +3 -0
- package/package.json +1 -1
package/es/createIframe.js
CHANGED
|
@@ -17,12 +17,14 @@ export default (function () {
|
|
|
17
17
|
|
|
18
18
|
// 监听iframe加载完成
|
|
19
19
|
iframe.onload = function () {
|
|
20
|
+
console.log('1', iframe.contentWindow);
|
|
20
21
|
var win = iframe.contentWindow;
|
|
21
22
|
if (!win) return;
|
|
22
23
|
|
|
23
24
|
// 拦截低代码引擎的createSimulator函数
|
|
24
25
|
patchCreateSimulatorInIframe(win);
|
|
25
26
|
};
|
|
27
|
+
console.log('2', iframe.contentWindow);
|
|
26
28
|
return iframe;
|
|
27
29
|
});
|
|
28
30
|
|
|
@@ -30,6 +32,7 @@ export default (function () {
|
|
|
30
32
|
function patchCreateSimulatorInIframe(iframeWindow) {
|
|
31
33
|
// 保存原始的createSimulator函数
|
|
32
34
|
var originalCreateSimulator = iframeWindow.createSimulator;
|
|
35
|
+
console.log('3', originalCreateSimulator);
|
|
33
36
|
if (originalCreateSimulator) {
|
|
34
37
|
iframeWindow.createSimulator = function (host, iframe, vendors) {
|
|
35
38
|
// 处理vendors,给JS URL添加时间戳
|
package/lib/createIframe.js
CHANGED
|
@@ -23,17 +23,20 @@ var _default = exports.default = function _default() {
|
|
|
23
23
|
|
|
24
24
|
// 监听iframe加载完成
|
|
25
25
|
iframe.onload = function () {
|
|
26
|
+
console.log('1', iframe.contentWindow);
|
|
26
27
|
var win = iframe.contentWindow;
|
|
27
28
|
if (!win) return;
|
|
28
29
|
|
|
29
30
|
// 拦截低代码引擎的createSimulator函数
|
|
30
31
|
patchCreateSimulatorInIframe(win);
|
|
31
32
|
};
|
|
33
|
+
console.log('2', iframe.contentWindow);
|
|
32
34
|
return iframe;
|
|
33
35
|
}; // 在iframe内部修补createSimulator函数
|
|
34
36
|
function patchCreateSimulatorInIframe(iframeWindow) {
|
|
35
37
|
// 保存原始的createSimulator函数
|
|
36
38
|
var originalCreateSimulator = iframeWindow.createSimulator;
|
|
39
|
+
console.log('3', originalCreateSimulator);
|
|
37
40
|
if (originalCreateSimulator) {
|
|
38
41
|
iframeWindow.createSimulator = function (host, iframe, vendors) {
|
|
39
42
|
// 处理vendors,给JS URL添加时间戳
|