Skip to content

Commit

Permalink
Stop polluting the autocomplete service when unloading tabs
Browse files Browse the repository at this point in the history
This resolves #11.
  • Loading branch information
JustOff committed Jun 14, 2020
1 parent c29fd31 commit 9b61fc0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,15 @@ LullTheTabs.prototype = {
// ensure the nsISessionStore service won't save this in the
// recently closed tabs.
if (tabbrowser._beginRemoveTab(aTab, true, null, false)) {
let browser = tabbrowser.getBrowserForTab(aTab);
if (browser.registeredOpenURI) {
if (tabbrowser._placesAutocomplete) {
tabbrowser._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI);
} else if (tabbrowser._unifiedComplete) {
tabbrowser._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI);
}
delete browser.registeredOpenURI;
}
tabbrowser._endRemoveTab(aTab);
}
},
Expand Down

0 comments on commit 9b61fc0

Please sign in to comment.