replace getElementsByTagName to querySelectorAll

This commit is contained in:
Gabe Yuan
2023-11-05 16:20:44 +08:00
parent 94288b5dc3
commit 477361eb40

View File

@@ -1,7 +1,7 @@
export const isIframe = window.self !== window.top;
export const sendIframeMsg = (action, args) => {
document.getElementsByTagName("iframe").forEach((iframe) => {
document.querySelectorAll("iframe").forEach((iframe) => {
iframe.contentWindow.postMessage({ action, args }, "*");
});
};