Index: ext/background.js |
diff --git a/ext/background.js b/ext/background.js |
index e0242e545396f8e48fdbbfea961b8cf42e14a8b9..857bafaa729d56febd7d1a4328cc113b26804063 100644 |
--- a/ext/background.js |
+++ b/ext/background.js |
@@ -559,10 +559,36 @@ |
if (!frames) |
return null; |
- let frame = frames.get(rawSender.frameId); |
+ let frame; |
+ // In Microsoft Edge (version 42.17134.1.0) we don't have frameId |
+ // so we fall back to iterating over the tab's frames |
+ // see https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11716733 |
+ if (rawSender.frameId != undefined) |
+ frame = frames.get(rawSender.frameId); |
+ else |
+ { |
+ let rawSenderHref = rawSender.url ? |
Sebastian Noack
2018/07/19 16:18:05
Do we even want to enter this code path if we don'
geo
2018/07/19 18:48:16
No, you are right, there is no point to it. `frame
|
+ rawSender.url.replace(/#.*/, "") : |
+ ""; |
+ |
+ for (let [frameId, frameInfo] of frames) |
+ { |
+ let frameInfoHref = frameInfo.url.href.replace(/#.*/, ""); |
+ |
+ // If we have two frames with the same URL |
+ // we are going to pick the first one we find |
+ // as we have no other way of distinguishing between them. |
+ if (frameInfoHref == rawSenderHref) |
+ { |
+ frame = frameInfo; |
+ this.id = frameId; |
+ break; |
+ } |
+ } |
+ } |
+ |
if (frame) |
return frame.parent || null; |
- |
return frames.get(0) || null; |
} |
}; |