Skip to content

Commit 9ae03b9

Browse files
committed
Merge branch 'master' of github.com:EFForg/https-everywhere
2 parents 838fe73 + b208e92 commit 9ae03b9

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/chrome/content/code/AndroidUI.jsm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ function loadIntoWindow() {
2727
} else if (urlbarId) {
2828
aWindow.NativeWindow.pageactions.remove(urlbarId);
2929
}
30+
31+
// When navigating away from a page, we want to clear the applicable list for
32+
// that page. There are a few different APIs to do this, but this is the one
33+
// that work on mobile. We trigger on pagehide rather than pageshow because we
34+
// want to capture subresources during load.
35+
var BrowserApp = aWindow.BrowserApp;
36+
BrowserApp.deck.addEventListener("pagehide", function(evt) {
37+
var browser = BrowserApp.getBrowserForDocument(evt.target);
38+
HTTPSEverywhere.resetApplicableList(browser);
39+
}, true);
3040
}
3141

3242
function unloadFromWindow() {

src/chrome/content/toolbar_button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ httpsEverywhere.toolbarButton = {
9595
let httpseProgressListener = {
9696
onLocationChange: function(aBrowser, aWebProgress, aReq, aLoc) {
9797
HTTPSEverywhere.log(DBUG, "Got on location change!");
98-
HTTPSEverywhere.onLocationChange(aBrowser);
98+
HTTPSEverywhere.resetApplicableList(aBrowser);
9999
},
100100
onStateChange: function(aBrowser, aWebProgress, aReq, aFlags, aStatus) {
101101
if ((gBrowser.selectedBrowser === aBrowser) &&

src/components/https-everywhere.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ HTTPSEverywhere.prototype = {
302302
obj[key] = value;
303303
},
304304

305-
// We use onLocationChange to make a fresh list of rulesets that could have
305+
// We use resetApplicableList to make a fresh list of rulesets that could have
306306
// applied to the content in the current page (the "applicable list" is used
307307
// for the context menu in the UI). This will be appended to as various
308308
// content is embedded / requested by JavaScript.
309-
onLocationChange: function(browser) {
309+
resetApplicableList: function(browser) {
310310
if (!this.prefs.getBoolPref("globalEnabled")) {
311311
return;
312312
}

0 commit comments

Comments
 (0)