Skip to content

Commit 7b939bd

Browse files
committed
[core] fix dpsc refactor mistakenly removing window.open eager hooking
1 parent 258e828 commit 7b939bd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/client/dom/open.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@ export default function (client: ScramjetClient) {
1313

1414
const realwin = ctx.call();
1515

16-
return ctx.return(realwin);
16+
if (!realwin) return ctx.return(realwin);
17+
18+
if (SCRAMJETCLIENT in realwin) {
19+
return ctx.return(realwin[SCRAMJETCLIENT].globalProxy);
20+
} else {
21+
const newclient = new ScramjetClient(realwin);
22+
// hook the opened window
23+
newclient.hook();
24+
25+
return ctx.return(newclient.global);
26+
}
1727
},
1828
});
1929

0 commit comments

Comments
 (0)