From e62b020e246044a18abf33c4e2a53b3b59f89bb5 Mon Sep 17 00:00:00 2001 From: JustOff Date: Tue, 17 Apr 2018 18:37:43 +0300 Subject: [PATCH] Always run cleanup routine when URI scheme changed --- content/tabs.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/content/tabs.js b/content/tabs.js index 48a6cfa..07c1c1f 100644 --- a/content/tabs.js +++ b/content/tabs.js @@ -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) {} }