Skip to content

Commit 9761d35

Browse files
committed
[frontend] fix window.open proxy
1 parent 226f917 commit 9761d35

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

frontend/src/Tab.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,7 @@ export class Tab extends StatefulClass {
185185
function injectWindowFill(client: ScramjetClient, tab: Tab) {
186186
client.Proxy("window.open", {
187187
apply(ctx) {
188-
let tab = browser.newTab();
189-
if (ctx.args[0]) {
190-
tab.frame.go(ctx.args[0]);
191-
}
188+
let tab = browser.newTab(ctx.args[0] || new URL("about:blank"));
192189

193190
// this is a bit jank: we need the global proxy NOW, but it will only load naturally after a few seconds
194191
const realContentWindow = tab.frame.frame.contentWindow;
@@ -198,7 +195,7 @@ function injectWindowFill(client: ScramjetClient, tab: Tab) {
198195
const newclient = new ctor(realContentWindow);
199196
newclient.hook();
200197

201-
ctx.return(newclient.globalProxy);
198+
ctx.return(newclient.global);
202199
},
203200
});
204201
}

0 commit comments

Comments
 (0)