mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 14:30:02 -04:00
dumb regression
This commit is contained in:
parent
c38ba1c9b4
commit
ac5b03736a
3 changed files with 9 additions and 7 deletions
|
@ -124,7 +124,7 @@ export default function (client: ScramjetClient, self: typeof window) {
|
|||
const realwin = ctx.get() as Window;
|
||||
|
||||
if (ScramjetClient.SCRAMJET in realwin.self) {
|
||||
return realwin.self[ScramjetClient.SCRAMJET].windowProxy;
|
||||
return realwin.self[ScramjetClient.SCRAMJET].globalProxy.window;
|
||||
} else {
|
||||
// hook the iframe
|
||||
const newclient = new ScramjetClient(realwin.self);
|
||||
|
|
|
@ -14,7 +14,9 @@ export default function (client: ScramjetClient) {
|
|||
if (!realwin) return ctx.return(realwin);
|
||||
|
||||
if (ScramjetClient.SCRAMJET in realwin.self) {
|
||||
return ctx.return(realwin.self[ScramjetClient.SCRAMJET].windowProxy);
|
||||
return ctx.return(
|
||||
realwin.self[ScramjetClient.SCRAMJET].globalProxy.window
|
||||
);
|
||||
} else {
|
||||
const newclient = new ScramjetClient(realwin.self);
|
||||
// hook the opened window
|
||||
|
@ -31,7 +33,7 @@ export default function (client: ScramjetClient) {
|
|||
const realwin = ctx.get() as Window;
|
||||
|
||||
if (realwin && ScramjetClient.SCRAMJET in realwin.self) {
|
||||
return realwin.self[ScramjetClient.SCRAMJET].windowProxy;
|
||||
return realwin.self[ScramjetClient.SCRAMJET].globalProxy;
|
||||
} else {
|
||||
// the opener has to have been already hooked, so if we reach here then it's a real window
|
||||
return undefined;
|
||||
|
|
|
@ -17,7 +17,7 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
|||
} else if (iswindow && identifier instanceof self.parent.self.Window) {
|
||||
if (ScramjetClient.SCRAMJET in self.parent.self) {
|
||||
// ... then we're in a subframe, and the parent frame is also in a proxy context, so we should return its proxy
|
||||
return self.parent.self[ScramjetClient.SCRAMJET].windowProxy;
|
||||
return self.parent.self[ScramjetClient.SCRAMJET].globalProxy;
|
||||
} else {
|
||||
// ... then we should pretend we aren't nested and return the current window
|
||||
return client.globalProxy;
|
||||
|
@ -37,7 +37,7 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
|||
current = test;
|
||||
}
|
||||
|
||||
return current[ScramjetClient.SCRAMJET].windowProxy;
|
||||
return current[ScramjetClient.SCRAMJET].globalProxy.window;
|
||||
} else if (
|
||||
(iswindow && identifier instanceof self.Location) ||
|
||||
(isworker && identifier instanceof self.WorkerLocation)
|
||||
|
@ -89,7 +89,7 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
|||
}
|
||||
}
|
||||
self.$scramerr = function scramerr(e) {
|
||||
console.warn("CAUGHT ERROR", e);
|
||||
// console.warn("CAUGHT ERROR", e);
|
||||
};
|
||||
|
||||
self.$scramdbg = function scramdbg(args, t) {
|
||||
|
@ -102,7 +102,7 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
|||
apply(ctx) {
|
||||
ctx.args[0] = new Proxy(ctx.args[0], {
|
||||
apply(target, thisArg, argArray) {
|
||||
console.warn("CAUGHT PROMISE REJECTION", argArray);
|
||||
// console.warn("CAUGHT PROMISE REJECTION", argArray);
|
||||
Reflect.apply(target, thisArg, argArray);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue