From b67c938e7ef770a1792c3fae7415856d23e101a7 Mon Sep 17 00:00:00 2001 From: NDevTK <31563761+NDevTK@users.noreply.github.com> Date: Fri, 8 Nov 2024 13:34:08 +0000 Subject: [PATCH] Update WindowScript.js --- WindowScript.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/WindowScript.js b/WindowScript.js index a9e2e64..34965c7 100644 --- a/WindowScript.js +++ b/WindowScript.js @@ -70,8 +70,14 @@ }, }; } - - window.parent = new Proxy(window.parent, handle('parent')); - window.opener = new Proxy(window.opener, handle('opener')); + + if (window.parent !== window) { + window.parent = new Proxy(window.parent, handle('parent')); + } + + if (window.opener) { + window.opener = new Proxy(window.opener, handle('opener')); + } + window.postMessage = new Proxy(window.postMessage, handle('self')); })();