diff options
Diffstat (limited to 'browser/components')
5 files changed, 54 insertions, 27 deletions
diff --git a/browser/components/places/content/controller.js b/browser/components/places/content/controller.js index 0d66fbcaf..ebdab60f4 100644 --- a/browser/components/places/content/controller.js +++ b/browser/components/places/content/controller.js @@ -253,7 +253,8 @@ PlacesController.prototype = { } else host = NetUtil.newURI(this._view.selectedNode.uri).host; - ForgetAboutSite.removeDataFromDomain(host); + ForgetAboutSite.removeDataFromDomain(host) + .catch(Components.utils.reportError); break; case "cmd_selectAll": this.selectAll(); diff --git a/browser/components/preferences/in-content/security.js b/browser/components/preferences/in-content/security.js index a8ad28c7e..0d7af39a3 100644 --- a/browser/components/preferences/in-content/security.js +++ b/browser/components/preferences/in-content/security.js @@ -168,12 +168,24 @@ var gSecurityPane = { let safeBrowsingPhishingPref = document.getElementById("browser.safebrowsing.phishing.enabled"); let safeBrowsingMalwarePref = document.getElementById("browser.safebrowsing.malware.enabled"); + let safeBrowsingUIPref = document.getElementById("browser.safebrowsing.UI.enabled"); + let safeBrowsingUISep = document.getElementById("safeBrowsingUISep"); + let safeBrowsingUIGroup = document.getElementById("safeBrowsingUIGroup"); + let blockDownloadsPref = document.getElementById("browser.safebrowsing.downloads.enabled"); let malwareTable = document.getElementById("urlclassifier.malwareTable"); let blockUnwantedPref = document.getElementById("browser.safebrowsing.downloads.remote.block_potentially_unwanted"); let blockUncommonPref = document.getElementById("browser.safebrowsing.downloads.remote.block_uncommon"); + if (safeBrowsingUIPref.value == false) { + safeBrowsingUISep.setAttribute("hidden", "true"); + safeBrowsingUIGroup.setAttribute("hidden", "true"); + } else { + safeBrowsingUISep.removeAttribute("hidden"); + safeBrowsingUIGroup.removeAttribute("hidden"); + } + enableSafeBrowsing.addEventListener("command", function() { safeBrowsingPhishingPref.value = enableSafeBrowsing.checked; safeBrowsingMalwarePref.value = enableSafeBrowsing.checked; diff --git a/browser/components/preferences/in-content/security.xul b/browser/components/preferences/in-content/security.xul index b7bdb9361..5dc8ad5e9 100644 --- a/browser/components/preferences/in-content/security.xul +++ b/browser/components/preferences/in-content/security.xul @@ -28,6 +28,10 @@ name="browser.safebrowsing.phishing.enabled" type="bool"/> + <preference id="browser.safebrowsing.UI.enabled" + name="browser.safebrowsing.UI.enabled" + type="bool"/> + <preference id="browser.safebrowsing.downloads.enabled" name="browser.safebrowsing.downloads.enabled" type="bool"/> @@ -73,8 +77,8 @@ accesskey="&addonExceptions.accesskey;"/> </hbox> - <separator class="thin"/> - <vbox align="start"> + <separator id="safeBrowsingUISep" class="thin"/> + <vbox id="safeBrowsingUIGroup" align="start"> <checkbox id="enableSafeBrowsing" label="&enableSafeBrowsing.label;" accesskey="&enableSafeBrowsing.accesskey;" /> diff --git a/browser/components/sessionstore/content/aboutSessionRestore.js b/browser/components/sessionstore/content/aboutSessionRestore.js index cc8d2da0b..8a9410aa8 100644 --- a/browser/components/sessionstore/content/aboutSessionRestore.js +++ b/browser/components/sessionstore/content/aboutSessionRestore.js @@ -41,7 +41,11 @@ window.onload = function() { return; } - gStateObject = JSON.parse(sessionData.value); + try { + gStateObject = JSON.parse(sessionData.value); + } catch (e) { + Cu.reportError(e); + } // make sure the data is tracked to be restored in case of a subsequent crash var event = document.createEvent("UIEvents"); @@ -68,30 +72,32 @@ function initTreeView() { var winLabel = tabList.getAttribute("_window_label"); gTreeData = []; - gStateObject.windows.forEach(function(aWinData, aIx) { - var winState = { - label: winLabel.replace("%S", (aIx + 1)), - open: true, - checked: true, - ix: aIx - }; - winState.tabs = aWinData.tabs.map(function(aTabData) { - var entry = aTabData.entries[aTabData.index - 1] || { url: "about:blank" }; - var iconURL = aTabData.image || null; - // don't initiate a connection just to fetch a favicon (see bug 462863) - if (/^https?:/.test(iconURL)) - iconURL = "moz-anno:favicon:" + iconURL; - return { - label: entry.title || entry.url, + if (gStateObject) { + gStateObject.windows.forEach(function(aWinData, aIx) { + var winState = { + label: winLabel.replace("%S", (aIx + 1)), + open: true, checked: true, - src: iconURL, - parent: winState + ix: aIx }; - }); - gTreeData.push(winState); - for (let tab of winState.tabs) - gTreeData.push(tab); - }, this); + winState.tabs = aWinData.tabs.map(function(aTabData) { + var entry = aTabData.entries[aTabData.index - 1] || { url: "about:blank" }; + var iconURL = aTabData.image || null; + // don't initiate a connection just to fetch a favicon (see bug 462863) + if (/^https?:/.test(iconURL)) + iconURL = "moz-anno:favicon:" + iconURL; + return { + label: entry.title || entry.url, + checked: true, + src: iconURL, + parent: winState + }; + }); + gTreeData.push(winState); + for (let tab of winState.tabs) + gTreeData.push(tab); + }, this); + } tabList.view = treeView; tabList.view.selection.select(0); diff --git a/browser/components/webextensions/ext-commands.js b/browser/components/webextensions/ext-commands.js index 3f0bf8d1a..b6e7ab3d1 100644 --- a/browser/components/webextensions/ext-commands.js +++ b/browser/components/webextensions/ext-commands.js @@ -163,11 +163,12 @@ CommandList.prototype = { // The modifiers are the remaining elements. keyElement.setAttribute("modifiers", this.getModifiersAttribute(parts)); - if (/^[A-Z0-9]$/.test(chromeKey)) { + if (/^[A-Z]$/.test(chromeKey)) { // We use the key attribute for all single digits and characters. keyElement.setAttribute("key", chromeKey); } else { keyElement.setAttribute("keycode", this.getKeycodeAttribute(chromeKey)); + keyElement.setAttribute("event", "keydown"); } return keyElement; @@ -187,6 +188,9 @@ CommandList.prototype = { * @returns {string} The constructed value for the Key's 'keycode' attribute. */ getKeycodeAttribute(chromeKey) { + if (/[0-9]/.test(chromeKey)) { + return `VK_${chromeKey}`; + } return `VK${chromeKey.replace(/([A-Z])/g, "_$&").toUpperCase()}`; }, |