summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-08-04 19:48:44 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-08-04 19:48:44 -0400
commit0f6f331d01dcf783b6c5c504ec4b2370b231765f (patch)
treed9e99a49978910d19e4b11e91372456699d88e50
parent87150eb7cbe80247602c9ddace7968e691dd4291 (diff)
downloadiceweasel-uxp-0f6f331d01dcf783b6c5c504ec4b2370b231765f.tar.gz
tabbrowser.xml: Add a null check to aBrowser and fix a few spurious whitespace and commas
Without the null check aWindow can error because addons can call the fast path and not have a window due to race conditions.
-rw-r--r--base/content/tabbrowser.xml22
1 files changed, 12 insertions, 10 deletions
diff --git a/base/content/tabbrowser.xml b/base/content/tabbrowser.xml
index 4d0d783..72db9c9 100644
--- a/base/content/tabbrowser.xml
+++ b/base/content/tabbrowser.xml
@@ -371,11 +371,13 @@
// directly from the content window to the browser without looping
// over all browsers.
if (!gMultiProcessBrowser) {
- let browser = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell)
- .chromeEventHandler;
- return this.getTabForBrowser(browser);
+ if (aWindow) {
+ let browser = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIWebNavigation)
+ .QueryInterface(Ci.nsIDocShell)
+ .chromeEventHandler;
+ return this.getTabForBrowser(browser);
+ }
}
for (let i = 0; i < this.browsers.length; i++) {
@@ -1596,7 +1598,7 @@
ownerTab: owner,
skipAnimation: multiple,
allowThirdPartyFixup: aAllowThirdPartyFixup,
- postData: aPostDatas[0],
+ postData: aPostDatas[0]
});
if (aNewIndex !== -1) {
this.moveTabTo(firstTabAdded, aNewIndex);
@@ -1609,7 +1611,7 @@
let tab = this.addTab(aURIs[i], {
skipAnimation: true,
allowThirdPartyFixup: aAllowThirdPartyFixup,
- postData: aPostDatas[i],
+ postData: aPostDatas[i]
});
if (targetTabIndex !== -1)
this.moveTabTo(tab, ++tabNum);
@@ -2081,7 +2083,7 @@
var aRelatedBrowser;
var aOriginPrincipal;
var aOpener;
- var aSkipBackgroundNotify;
+ var aSkipBackgroundNotify;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
@@ -2127,11 +2129,11 @@
t.setAttribute("crop", "end");
t.setAttribute("onerror", "this.removeAttribute('image');");
-
+
if (aSkipBackgroundNotify) {
t.setAttribute("skipbackgroundnotify", true);
}
-
+
t.className = "tabbrowser-tab";
this.tabContainer._unlockTabSizing();