12 lines
337 B
JavaScript
12 lines
337 B
JavaScript
export const isIframe = window.self !== window.top;
|
|
|
|
export const sendIframeMsg = (action, args) => {
|
|
document.querySelectorAll("iframe").forEach((iframe) => {
|
|
iframe.contentWindow.postMessage({ action, args }, "*");
|
|
});
|
|
};
|
|
|
|
export const sendParentMsg = (action, args) => {
|
|
window.parent.postMessage({ action, args }, "*");
|
|
};
|