summaryrefslogtreecommitdiffstats
path: root/browser/components
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components')
-rw-r--r--browser/components/places/content/controller.js3
-rw-r--r--browser/components/preferences/cookies.js19
-rw-r--r--browser/components/preferences/cookies.xul2
-rw-r--r--browser/components/preferences/in-content/security.js12
-rw-r--r--browser/components/preferences/in-content/security.xul8
-rw-r--r--browser/components/sessionstore/content/aboutSessionRestore.js52
-rw-r--r--browser/components/webextensions/ext-commands.js6
7 files changed, 71 insertions, 31 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/cookies.js b/browser/components/preferences/cookies.js
index 1042642da..921eee4c0 100644
--- a/browser/components/preferences/cookies.js
+++ b/browser/components/preferences/cookies.js
@@ -30,6 +30,11 @@ var gCookiesWindow = {
this._bundle = document.getElementById("bundlePreferences");
this._tree = document.getElementById("cookiesList");
+ let removeAllCookies = document.getElementById("removeAllCookies");
+ removeAllCookies.setAttribute("accesskey", this._bundle.getString("removeAllCookies.accesskey"));
+ let removeSelectedCookies = document.getElementById("removeSelectedCookies");
+ removeSelectedCookies.setAttribute("accesskey", this._bundle.getString("removeSelectedCookies.accesskey"));
+
this._populateList(true);
document.getElementById("filter").focus();
@@ -582,7 +587,7 @@ var gCookiesWindow = {
}
}
- let buttonLabel = this._bundle.getString("removeSelectedCookies");
+ let buttonLabel = this._bundle.getString("removeSelectedCookies.label");
let removeSelectedCookies = document.getElementById("removeSelectedCookies");
removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel)
.replace("#1", selectedCookieCount);
@@ -894,7 +899,17 @@ var gCookiesWindow = {
},
_updateRemoveAllButton: function gCookiesWindow__updateRemoveAllButton() {
- document.getElementById("removeAllCookies").disabled = this._view._rowCount == 0;
+ let removeAllCookies = document.getElementById("removeAllCookies");
+ removeAllCookies.disabled = this._view._rowCount == 0;
+
+ let labelStringID = "removeAllCookies.label";
+ let accessKeyStringID = "removeAllCookies.accesskey";
+ if (this._view._filtered) {
+ labelStringID = "removeAllShownCookies.label";
+ accessKeyStringID = "removeAllShownCookies.accesskey";
+ }
+ removeAllCookies.setAttribute("label", this._bundle.getString(labelStringID));
+ removeAllCookies.setAttribute("accesskey", this._bundle.getString(accessKeyStringID));
},
filter: function () {
diff --git a/browser/components/preferences/cookies.xul b/browser/components/preferences/cookies.xul
index cda6ea220..bd60d9346 100644
--- a/browser/components/preferences/cookies.xul
+++ b/browser/components/preferences/cookies.xul
@@ -96,10 +96,8 @@
<hbox align="end">
<hbox class="actionButtons" flex="1">
<button id="removeSelectedCookies" disabled="true" icon="clear"
- accesskey="&button.removeSelectedCookies.accesskey;"
oncommand="gCookiesWindow.deleteCookie();"/>
<button id="removeAllCookies" disabled="true" icon="clear"
- label="&button.removeAllCookies.label;" accesskey="&button.removeAllCookies.accesskey;"
oncommand="gCookiesWindow.deleteAllCookies();"/>
<spacer flex="1"/>
#ifndef XP_MACOSX
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()}`;
},