+1
-5
@@ -56,7 +56,5 @@ function response(id, data, error = "") { | ||
| export function excute(frameID, actionName, ...params) { | ||
| console.log(frameID); | ||
| return new Promise((resolve, reject) => { | ||
| var _a; | ||
| const frame = window.frames[frameID]; | ||
| console.log(frame); | ||
| if (!frame) { | ||
@@ -69,3 +67,2 @@ reject(`iframe not found: ${frameID}`); | ||
| function listener(e) { | ||
| console.log(e); | ||
| window.removeEventListener("message", listener); | ||
@@ -95,5 +92,4 @@ let resp = {}; | ||
| const requestData = { id, actionName, params }; | ||
| console.log(requestData); | ||
| (_a = frame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(JSON.stringify(requestData), "*"); | ||
| (_a = frame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(JSON.stringify(requestData), frame.src); | ||
| }); | ||
| } |
+2
-2
| { | ||
| "name": "ifapi", | ||
| "version": "1.2.2", | ||
| "version": "1.2.3", | ||
| "type": "module", | ||
@@ -24,2 +24,2 @@ "main": "main.js", | ||
| "license": "MIT" | ||
| } | ||
| } |
8211
-2.46%180
-2.17%