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