2023-08-26 11:43:00 +08:00
|
|
|
export const isIframe = window.self !== window.top;
|
|
|
|
|
|
|
|
|
|
export const sendIframeMsg = (action, args) => {
|
2023-11-05 16:20:44 +08:00
|
|
|
document.querySelectorAll("iframe").forEach((iframe) => {
|
2023-08-26 11:43:00 +08:00
|
|
|
iframe.contentWindow.postMessage({ action, args }, "*");
|
|
|
|
|
});
|
|
|
|
|
};
|
2023-09-17 20:45:05 +08:00
|
|
|
|
2023-10-12 17:00:18 +08:00
|
|
|
export const sendParentMsg = (action, args) => {
|
2023-09-17 20:45:05 +08:00
|
|
|
window.parent.postMessage({ action, args }, "*");
|
|
|
|
|
};
|