diff --git a/src/content.js b/src/content.js index 7aa283e..63e4334 100644 --- a/src/content.js +++ b/src/content.js @@ -17,7 +17,7 @@ import { getFabWithDefault, } from "./libs/storage"; import { Translator } from "./libs/translator"; -import { isIframe, sendIframeMsg, sendPrentMsg } from "./libs/iframe"; +import { isIframe, sendIframeMsg, sendParentMsg } from "./libs/iframe"; import { matchRule } from "./libs/rules"; import { webfix } from "./libs/webfix"; @@ -48,7 +48,7 @@ const init = async () => { default: } }); - sendPrentMsg(MSG_TRANS_GETRULE); + sendParentMsg(MSG_TRANS_GETRULE); return; } diff --git a/src/libs/iframe.js b/src/libs/iframe.js index 55108e4..0fa6a08 100644 --- a/src/libs/iframe.js +++ b/src/libs/iframe.js @@ -6,6 +6,6 @@ export const sendIframeMsg = (action, args) => { }); }; -export const sendPrentMsg = (action, args) => { +export const sendParentMsg = (action, args) => { window.parent.postMessage({ action, args }, "*"); }; diff --git a/src/userscript.js b/src/userscript.js index 407b39b..d0794a9 100644 --- a/src/userscript.js +++ b/src/userscript.js @@ -17,7 +17,7 @@ import { MSG_TRANS_PUTRULE, APP_LCNAME, } from "./config"; -import { isIframe, sendIframeMsg, sendPrentMsg } from "./libs/iframe"; +import { isIframe, sendIframeMsg, sendParentMsg } from "./libs/iframe"; import { handlePing, injectScript } from "./libs/gm"; import { matchRule } from "./libs/rules"; import { genEventName } from "./libs/utils"; @@ -75,7 +75,7 @@ const init = async () => { default: } }); - sendPrentMsg(MSG_TRANS_GETRULE); + sendParentMsg(MSG_TRANS_GETRULE); return; }