replace getElementsByName to getElementsByTagName

This commit is contained in:
Gabe Yuan
2023-11-02 10:59:26 +08:00
parent 06f93c1c10
commit 84de1e0f12

View File

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