[PALEMOON] Skip notifications for background tabs when restoring a session

This commit is contained in:
JustOff 2018-09-16 19:46:33 +03:00 • committed by Roy Tam
commit c79f106dcc
2 changed files with 17 additions and 3 deletions

View file

@ -1429,6 +1429,7 @@
var aRelatedToCurrent; var aRelatedToCurrent;
var aSkipAnimation; var aSkipAnimation;
var aOriginPrincipal; var aOriginPrincipal;
var aSkipBackgroundNotify;
if (arguments.length == 2 && if (arguments.length == 2 &&
typeof arguments[1] == "object" && typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) { !(arguments[1] instanceof Ci.nsIURI)) {
@ -1444,6 +1445,7 @@
aRelatedToCurrent = params.relatedToCurrent; aRelatedToCurrent = params.relatedToCurrent;
aSkipAnimation = params.skipAnimation; aSkipAnimation = params.skipAnimation;
aOriginPrincipal = params.originPrincipal; aOriginPrincipal = params.originPrincipal;
aSkipBackgroundNotify = params.skipBackgroundNotify;
} }
// if we're adding tabs, we're past interrupt mode, ditch the owner // if we're adding tabs, we're past interrupt mode, ditch the owner
@ -1467,6 +1469,11 @@
t.setAttribute("crop", "end"); t.setAttribute("crop", "end");
t.setAttribute("validate", "never"); //PMed t.setAttribute("validate", "never"); //PMed
t.setAttribute("onerror", "this.removeAttribute('image');"); t.setAttribute("onerror", "this.removeAttribute('image');");
if (aSkipBackgroundNotify) {
t.setAttribute("skipbackgroundnotify", true);
}
t.className = "tabbrowser-tab"; t.className = "tabbrowser-tab";
this.tabContainer._unlockTabSizing(); this.tabContainer._unlockTabSizing();
@ -4143,7 +4150,11 @@
this._fillTrailingGap(); this._fillTrailingGap();
this._handleTabSelect(); this._handleTabSelect();
} else { } else {
this._notifyBackgroundTab(tab); if (tab.hasAttribute("skipbackgroundnotify")) {
tab.removeAttribute("skipbackgroundnotify");
} else {
this._notifyBackgroundTab(tab);
}
} }
// XXXmano: this is a temporary workaround for bug 345399 // XXXmano: this is a temporary workaround for bug 345399

View file

@ -2739,7 +2739,9 @@ var SessionStoreInternal = {
for (var t = 0; t < newTabCount; t++) { for (var t = 0; t < newTabCount; t++) {
tabs.push(t < openTabCount ? tabs.push(t < openTabCount ?
tabbrowser.tabs[t] : tabbrowser.tabs[t] :
tabbrowser.addTab("about:blank", {skipAnimation: true})); tabbrowser.addTab("about:blank",
{skipAnimation: true,
skipBackgroundNotify: true}));
// when resuming at startup: add additionally requested pages to the end // when resuming at startup: add additionally requested pages to the end
if (!aOverwriteTabs && root._firstTabs) { if (!aOverwriteTabs && root._firstTabs) {
tabbrowser.moveTabTo(tabs[t], t); tabbrowser.moveTabTo(tabs[t], t);
@ -4684,7 +4686,8 @@ var TabAttributes = {
// 'image' should not be accessed directly but handled by using the // 'image' should not be accessed directly but handled by using the
// gBrowser.getIcon()/setIcon() methods. // gBrowser.getIcon()/setIcon() methods.
// 'pending' is used internal by sessionstore and managed accordingly. // 'pending' is used internal by sessionstore and managed accordingly.
_skipAttrs: new Set(["image", "pending"]), // 'skipbackgroundnotify' is used internal by tabbrowser.xml.
_skipAttrs: new Set(["image", "pending", "skipbackgroundnotify"]),
persist: function (name) { persist: function (name) {
if (this._attrs.has(name) || this._skipAttrs.has(name)) { if (this._attrs.has(name) || this._skipAttrs.has(name)) {