properly rewrite postmessage

This commit is contained in:
velzie 2024-07-28 14:41:44 -04:00
parent 34c3cc5094
commit c2d147442e
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
9 changed files with 134 additions and 17 deletions

View file

@ -25,7 +25,7 @@ export default function (client: ScramjetClient) {
get(ctx) {
const realwin = ctx.get() as Window;
if (ScramjetClient.SCRAMJET in realwin.self) {
if (realwin && ScramjetClient.SCRAMJET in realwin.self) {
return realwin.self[ScramjetClient.SCRAMJET].windowProxy;
} else {
// the opener has to have been already hooked, so if we reach here then it's a real window