Index: ext/background.js |
diff --git a/ext/background.js b/ext/background.js |
index e0242e545396f8e48fdbbfea961b8cf42e14a8b9..3b43ec49af55f15be2e6bb7c46f6c5b55335dcec 100644 |
--- a/ext/background.js |
+++ b/ext/background.js |
@@ -559,10 +559,34 @@ |
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 if (rawSender.url) |
+ { |
+ let rawSenderHref = 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; |
} |
}; |