Bug 1233747 and
bug 1235709 - deal better with host-less URIs in the checkbox handling for dialogs in non-selected tabs, r?Aryx
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -7949,23 +7949,27 @@ TabModalPromptBox.prototype = {
browser.setAttribute("tabmodalPromptShowing", true);
newPrompt.clientTop; // style flush to assure binding is attached
let principalToAllowFocusFor = this._allowTabFocusByPromptPrincipal;
delete this._allowTabFocusByPromptPrincipal;
let allowFocusCheckbox; // Define outside the if block so we can bind it into the callback.
- if (principalToAllowFocusFor) {
+ let hostForAllowFocusCheckbox = "";
+ try {
+ hostForAllowFocusCheckbox = principalToAllowFocusFor.URI.host;
+ } catch (ex) { /* Ignore exceptions for host-less URIs */ }
+ if (hostForAllowFocusCheckbox) {
let allowFocusRow = document.createElementNS(XUL_NS, "row");
allowFocusCheckbox = document.createElementNS(XUL_NS, "checkbox");
let spacer = document.createElementNS(XUL_NS, "spacer");
allowFocusRow.appendChild(spacer);
let label = gBrowser.mStringBundle.getFormattedString("tabs.allowTabFocusByPromptForSite",
- [principalToAllowFocusFor.URI.host]);
+ [hostForAllowFocusCheckbox]);
allowFocusCheckbox.setAttribute("label", label);
allowFocusRow.appendChild(allowFocusCheckbox);
newPrompt.appendChild(allowFocusRow);
}
let tab = gBrowser.getTabForBrowser(browser);
let closeCB = this._promptCloseCallback.bind(null, onCloseCallback, principalToAllowFocusFor,
allowFocusCheckbox);