mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 03:27:31 +09:00
[BASILISK] Skip notifications for background tabs when restoring a session
This commit is contained in:
parent
c79f106dcc
commit
ee4ef937d9
3 changed files with 18 additions and 3 deletions
|
|
@ -2117,6 +2117,7 @@
|
||||||
var aRelatedBrowser;
|
var aRelatedBrowser;
|
||||||
var aOriginPrincipal;
|
var aOriginPrincipal;
|
||||||
var aOpener;
|
var aOpener;
|
||||||
|
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)) {
|
||||||
|
|
@ -2139,6 +2140,7 @@
|
||||||
aRelatedBrowser = params.relatedBrowser;
|
aRelatedBrowser = params.relatedBrowser;
|
||||||
aOriginPrincipal = params.originPrincipal;
|
aOriginPrincipal = params.originPrincipal;
|
||||||
aOpener = params.opener;
|
aOpener = params.opener;
|
||||||
|
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
|
||||||
|
|
@ -2167,6 +2169,11 @@
|
||||||
|
|
||||||
t.setAttribute("crop", "end");
|
t.setAttribute("crop", "end");
|
||||||
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();
|
||||||
|
|
@ -5951,7 +5958,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
|
||||||
|
|
|
||||||
|
|
@ -3113,7 +3113,8 @@ var SessionStoreInternal = {
|
||||||
tabbrowser.addTab("about:blank",
|
tabbrowser.addTab("about:blank",
|
||||||
{skipAnimation: true,
|
{skipAnimation: true,
|
||||||
forceNotRemote,
|
forceNotRemote,
|
||||||
userContextId});
|
userContextId,
|
||||||
|
skipBackgroundNotify: true});
|
||||||
|
|
||||||
// If we inserted a new tab because the userContextId didn't match with the
|
// If we inserted a new tab because the userContextId didn't match with the
|
||||||
// open tab, even though `t < openTabCount`, we need to remove that open tab
|
// open tab, even though `t < openTabCount`, we need to remove that open tab
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,10 @@ this.EXPORTED_SYMBOLS = ["TabAttributes"];
|
||||||
// 'pending' is used internal by sessionstore and managed accordingly.
|
// 'pending' is used internal by sessionstore and managed accordingly.
|
||||||
// 'iconLoadingPrincipal' is same as 'image' that it should be handled by
|
// 'iconLoadingPrincipal' is same as 'image' that it should be handled by
|
||||||
// using the gBrowser.getIcon()/setIcon() methods.
|
// using the gBrowser.getIcon()/setIcon() methods.
|
||||||
const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending", "iconLoadingPrincipal"]);
|
// 'skipbackgroundnotify' is used internal by tabbrowser.xml.
|
||||||
|
const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending",
|
||||||
|
"iconLoadingPrincipal",
|
||||||
|
"skipbackgroundnotify"]);
|
||||||
|
|
||||||
// A set of tab attributes to persist. We will read a given list of tab
|
// A set of tab attributes to persist. We will read a given list of tab
|
||||||
// attributes when collecting tab data and will re-set those attributes when
|
// attributes when collecting tab data and will re-set those attributes when
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue