check other window instances in scope function

This commit is contained in:
velzie 2024-07-15 15:09:25 -04:00
parent 408bf39ffd
commit 1b55a1672a
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F

View file

@ -2,7 +2,8 @@ import { locationProxy } from "./location";
import { documentProxy, windowProxy } from "./window";
function scope(identifier: any) {
if (identifier instanceof Window) {
// this will break iframe postmessage!
if (identifier instanceof Window || identifier instanceof top.window.Window || identifier instanceof parent.window.Window) {
return windowProxy;
} else if (identifier instanceof Location) {
return locationProxy;