Skip to content

Commit

Permalink
Ignore forgetClosedTab() failure, if tab was moved to another window
Browse files Browse the repository at this point in the history
(enhancement for #6, related to #36)
  • Loading branch information
Infocatcher committed May 4, 2013
1 parent 2edf154 commit f0a8e82
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,11 @@ var windowsObserver = {
+ "\nTry don't save it in undo close history"
);
var silentFail = false;
if(tab.hasAttribute("closedownloadtabs-closed")) {
if(e.detail) {
_log("Tab moved to another window");
silentFail = true;
}
else if(tab.hasAttribute("closedownloadtabs-closed")) {
// https://github.com/Infocatcher/Close_Download_Tabs
_log('Found "closedownloadtabs-closed" attribute');
silentFail = true;
Expand Down Expand Up @@ -740,9 +744,11 @@ var windowsObserver = {
return;
}
}
!silentFail && Components.utils.reportError(
LOG_PREFIX + "!!! Can't forget about closed tab: tab not found, closed tabs count: " + l
);
var msg = "Can't forget about closed tab: tab not found, closed tabs count: " + l;
if(silentFail)
_log(msg + ", but all should be OK");
else
Components.utils.reportError(LOG_PREFIX + "!!! " + msg);
},
filterSession: function(stateData) {
if(!stateData || !(stateData instanceof Components.interfaces.nsISupportsString))
Expand Down

0 comments on commit f0a8e82

Please sign in to comment.