Skip to content

Commit

Permalink
Always run cleanup routine when URI scheme changed
Browse files Browse the repository at this point in the history
  • Loading branch information
JustOff committed Apr 17, 2018
1 parent 597bcda commit e62b020
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions content/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ let Tabs = function(Cleaner, Buttons, Utils) {
}
};

this.onTabProgress = {
this.onTabProgress = {
onLocationChange: function(aBrowser, aWebProgress, aRequest, aURI, aFlag) {
if (aFlag & Components.interfaces.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
return;
}
try {
if (aURI.host && aURI.scheme && (aURI.scheme == "http" || aURI.scheme == "https")) {
if (aURI.scheme == "http" || aURI.scheme == "https") {
if (aBrowser.previousURI && aBrowser.previousURI.host != aURI.host) {
Cleaner.trackTabs(aBrowser.previousURI);
}
aBrowser["previousURI"] = aURI;
} else if (aBrowser.previousURI) {
Cleaner.trackTabs(aBrowser.previousURI);
aBrowser["previousURI"] = null;
}
} catch(e) {}
}
Expand Down

0 comments on commit e62b020

Please sign in to comment.