Skip to content

Commit 2de5808

Browse files
committed
Get browser from loadContext.associatedWindow
This allows the applicable list to clear itself of old entries when the location changes.
1 parent 5d4c8a1 commit 2de5808

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/https-everywhere.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ HTTPSEverywhere.prototype = {
261261
_xpcom_categories: [
262262
{
263263
category: "app-startup",
264-
},
264+
}
265265
],
266266

267267
// QueryInterface implementation, e.g. using the generateQI helper
@@ -361,7 +361,8 @@ HTTPSEverywhere.prototype = {
361361
try {
362362
var loadContext = nc.getInterface(CI.nsILoadContext);
363363
dump("loadContext = " + loadContext + "\n");
364-
var browser = loadContext.topFrameElement;
364+
let domWin = loadContext.associatedWindow;
365+
var browser = gBrowser.getBrowserForDocument(domWin.top.document);
365366
} catch(e) {
366367
this.log(INFO, "No <browser> element associated with request: " + channel.URI.spec);
367368
return null;

0 commit comments

Comments
 (0)