Index: ext/background.js |
diff --git a/ext/background.js b/ext/background.js |
index 31370f37dca8d1709896220ff9adca983ec1d7ae..c984c1c1f4f1177979ed1751a0d34ea9617d2c22 100644 |
--- a/ext/background.js |
+++ b/ext/background.js |
@@ -160,7 +160,11 @@ |
let frame = createFrame(tabId, frameId); |
frame.url = new URL(url); |
- let parentFrame = framesOfTabs.get(tabId).get(parentFrameId); |
+ let frames = framesOfTabs.get(tabId); |
+ let parentFrame = frames.get(parentFrameId); |
+ if (!parentFrame && parentFrameId > 0) |
+ parentFrame = frames.get(0); |
+ |
if (parentFrame) |
frame.parent = parentFrame; |
} |
@@ -528,7 +532,12 @@ |
frames.set(detail.frameId, frame); |
if (detail.parentFrameId != -1) |
+ { |
frame.parent = frames.get(detail.parentFrameId); |
+ |
+ if (!frame.parent && detail.parentFrameId != 0) |
Sebastian Noack
2018/07/25 19:31:24
Why not falling back to the top-level frame here i
Sebastian Noack
2018/07/25 19:31:24
Nit: Above you check for parentFrameId > 0, here y
kzar
2018/07/25 20:28:25
Well, if the parentFrameId is -1 I figure it's the
kzar
2018/07/25 20:28:25
Done.
|
+ frame.parent = frames.get(0); |
+ } |
} |
} |
}); |