Index: ext/background.js |
diff --git a/ext/background.js b/ext/background.js |
index 31370f37dca8d1709896220ff9adca983ec1d7ae..11132924c9127e4de30e24d4c7972a2413b3f979 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) |
+ frame.parent = frames.get(0); |
+ } |
} |
} |
}); |