Skip to content

Commit d63f8a7

Browse files
velzier58Playz
authored andcommitted
fix nested frame detection in client.frame
1 parent 8056cb9 commit d63f8a7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/client/client.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,14 @@ export class ScramjetClient {
248248
// we're in a subframe, recurse upward until we find one
249249
let currentwin = this.global.window;
250250
while (currentwin.parent !== currentwin) {
251-
if (!currentwin.frameElement) return null; // ??
252-
if (currentwin.frameElement && currentwin.frameElement[SCRAMJETFRAME]) {
253-
return currentwin.frameElement[SCRAMJETFRAME];
251+
let currentclient = currentwin[SCRAMJETCLIENT];
252+
let currentFrame = currentclient.descriptors.get(
253+
"window.frameElement",
254+
currentwin
255+
);
256+
if (!currentFrame) return null; // ??
257+
if (currentFrame && currentFrame[SCRAMJETFRAME]) {
258+
return currentFrame[SCRAMJETFRAME];
254259
}
255260
currentwin = currentwin.parent.window;
256261
}

0 commit comments

Comments
 (0)