diff options
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/components/moz.build | 1 | ||||
-rw-r--r-- | toolkit/components/securityreporter/SecurityReporter.js | 112 | ||||
-rw-r--r-- | toolkit/components/securityreporter/SecurityReporter.manifest | 2 | ||||
-rw-r--r-- | toolkit/components/securityreporter/moz.build | 16 | ||||
-rw-r--r-- | toolkit/components/securityreporter/nsISecurityReporter.idl | 14 | ||||
-rw-r--r-- | toolkit/jetpack/sdk/ui/buttons.js | 23 | ||||
-rw-r--r-- | toolkit/themes/shared/jar.inc.mn | 2 | ||||
-rw-r--r-- | toolkit/themes/shared/media/TopLevelImageDocument.css | 7 |
8 files changed, 29 insertions, 148 deletions
diff --git a/toolkit/components/moz.build b/toolkit/components/moz.build index c11f62792..953e6c6e3 100644 --- a/toolkit/components/moz.build +++ b/toolkit/components/moz.build @@ -51,7 +51,6 @@ DIRS += [ 'reader', 'remotebrowserutils', 'reflect', - 'securityreporter', 'sqlite', 'startup', 'statusfilter', diff --git a/toolkit/components/securityreporter/SecurityReporter.js b/toolkit/components/securityreporter/SecurityReporter.js deleted file mode 100644 index 9ca1e5546..000000000 --- a/toolkit/components/securityreporter/SecurityReporter.js +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -const { classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.importGlobalProperties(['fetch']); - -const { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {}); -const protocolHandler = Cc["@mozilla.org/network/protocol;1?name=http"] - .getService(Ci.nsIHttpProtocolHandler); -const { Services } = Cu.import("resource://gre/modules/Services.jsm", {}); - -const TLS_ERROR_REPORT_TELEMETRY_SUCCESS = 6; -const TLS_ERROR_REPORT_TELEMETRY_FAILURE = 7; -const HISTOGRAM_ID = "TLS_ERROR_REPORT_UI"; - - -XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils", - "resource://gre/modules/UpdateUtils.jsm"); - -function getDERString(cert) -{ - var length = {}; - var derArray = cert.getRawDER(length); - var derString = ''; - for (var i = 0; i < derArray.length; i++) { - derString += String.fromCharCode(derArray[i]); - } - return derString; -} - -function SecurityReporter() { } - -SecurityReporter.prototype = { - classDescription: "Security reporter component", - classID: Components.ID("{8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b}"), - contractID: "@mozilla.org/securityreporter;1", - QueryInterface: XPCOMUtils.generateQI([Ci.nsISecurityReporter]), - reportTLSError: function(transportSecurityInfo, hostname, port) { - // don't send if there's no transportSecurityInfo (since the report cannot - // contain anything of interest) - if (!transportSecurityInfo) { - return; - } - - // don't send a report if the pref is not enabled - if (!Services.prefs.getBoolPref("security.ssl.errorReporting.enabled")) { - return; - } - - // Don't send a report if the host we're connecting to is the report - // server (otherwise we'll get loops when this fails) - let endpoint = - Services.prefs.getCharPref("security.ssl.errorReporting.url"); - let reportURI = Services.io.newURI(endpoint, null, null); - - if (reportURI.host == hostname) { - return; - } - - // Convert the nsIX509CertList into a format that can be parsed into - // JSON - let asciiCertChain = []; - - if (transportSecurityInfo.failedCertChain) { - let certs = transportSecurityInfo.failedCertChain.getEnumerator(); - while (certs.hasMoreElements()) { - let cert = certs.getNext(); - cert.QueryInterface(Ci.nsIX509Cert); - asciiCertChain.push(btoa(getDERString(cert))); - } - } - - let report = { - hostname: hostname, - port: port, - timestamp: Math.round(Date.now() / 1000), - errorCode: transportSecurityInfo.errorCode, - failedCertChain: asciiCertChain, - userAgent: protocolHandler.userAgent, - version: 1, - build: Services.appinfo.appBuildID, - product: Services.appinfo.name, - channel: UpdateUtils.UpdateChannel - } - - fetch(endpoint, { - method: "POST", - body: JSON.stringify(report), - headers: { - 'Content-Type': 'application/json' - } - }).then(function (aResponse) { - if (!aResponse.ok) { - // request returned non-success status - Services.telemetry.getHistogramById(HISTOGRAM_ID) - .add(TLS_ERROR_REPORT_TELEMETRY_FAILURE); - } else { - Services.telemetry.getHistogramById(HISTOGRAM_ID) - .add(TLS_ERROR_REPORT_TELEMETRY_SUCCESS); - } - }).catch(function (e) { - // error making request to reportURL - Services.telemetry.getHistogramById(HISTOGRAM_ID) - .add(TLS_ERROR_REPORT_TELEMETRY_FAILURE); - }); - } -}; - -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SecurityReporter]); diff --git a/toolkit/components/securityreporter/SecurityReporter.manifest b/toolkit/components/securityreporter/SecurityReporter.manifest deleted file mode 100644 index d4e080dc7..000000000 --- a/toolkit/components/securityreporter/SecurityReporter.manifest +++ /dev/null @@ -1,2 +0,0 @@ -component {8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b} SecurityReporter.js -contract @mozilla.org/securityreporter;1 {8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b} diff --git a/toolkit/components/securityreporter/moz.build b/toolkit/components/securityreporter/moz.build deleted file mode 100644 index 7ef56a115..000000000 --- a/toolkit/components/securityreporter/moz.build +++ /dev/null @@ -1,16 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -XPIDL_MODULE = 'toolkit_securityreporter' - -XPIDL_SOURCES += [ - 'nsISecurityReporter.idl', -] - -EXTRA_COMPONENTS += [ - 'SecurityReporter.js', - 'SecurityReporter.manifest', -] diff --git a/toolkit/components/securityreporter/nsISecurityReporter.idl b/toolkit/components/securityreporter/nsISecurityReporter.idl deleted file mode 100644 index 462dd1e48..000000000 --- a/toolkit/components/securityreporter/nsISecurityReporter.idl +++ /dev/null @@ -1,14 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsISupports.idl" -#include "nsITransportSecurityInfo.idl" - -[scriptable, uuid(8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b)] -interface nsISecurityReporter : nsISupports -{ - void reportTLSError(in nsITransportSecurityInfo aSecurityInfo, - in AUTF8String aHostname, - in long aPort); -}; diff --git a/toolkit/jetpack/sdk/ui/buttons.js b/toolkit/jetpack/sdk/ui/buttons.js index 6aaed3865..450584ea7 100644 --- a/toolkit/jetpack/sdk/ui/buttons.js +++ b/toolkit/jetpack/sdk/ui/buttons.js @@ -50,6 +50,14 @@ function insertButton(aWindow, id, onBuild) { let toolbar = toolbarId != "" && doc.getElementById(toolbarId); if (toolbar) { + // Handle special items with dynamic ids + let match = /^(separator|spacer|spring)\[(\d+)\]$/.exec(nextItemId); + if (match !== null) { + let dynItems = toolbar.querySelectorAll("toolbar" + match[1]); + if (match[2] < dynItems.length) { + nextItemId = dynItems[match[2]].id; + } + } let nextItem = nextItemId != "" && doc.getElementById(nextItemId); // If nextItem not in toolbar then retrieve it by reading currentset attribute if (!(nextItem && nextItem.parentNode && nextItem.parentNode.id == toolbarId)) { @@ -82,15 +90,26 @@ function afterCustomize(e) { for (let [id] of buttonsList) { let toolbox = e.target; let b = toolbox.parentNode.querySelector("#" + id); - let toolbarId = null, nextItemId = null; + let toolbarId = null, nextItem = null, nextItemId = null; if (b) { let parent = b.parentNode; - let nextItem = b.nextSibling; + nextItem = b.nextSibling; if (parent && parent.localName == "toolbar") { toolbarId = parent.id; nextItemId = nextItem && nextItem.id; } } + // Handle special items with dynamic ids + let match = /^(separator|spacer|spring)\d+$/.exec(nextItemId); + if (match !== null) { + let dynItems = nextItem.parentNode.querySelectorAll("toolbar" + match[1]); + for (let i = 0; i < dynItems.length; i++) { + if (dynItems[i].id == nextItemId) { + nextItemId = match[1] + "[" + i + "]"; + break; + } + } + } saveLocation(id, toolbarId, nextItemId); } } diff --git a/toolkit/themes/shared/jar.inc.mn b/toolkit/themes/shared/jar.inc.mn index 675353409..e361e744f 100644 --- a/toolkit/themes/shared/jar.inc.mn +++ b/toolkit/themes/shared/jar.inc.mn @@ -59,7 +59,7 @@ toolkit.jar: skin/classic/global/reader/RM-Content-Width-Plus-44x16.svg (../../shared/reader/RM-Content-Width-Plus-44x16.svg) skin/classic/global/reader/RM-Line-Height-Minus-38x14.svg (../../shared/reader/RM-Line-Height-Minus-38x14.svg) skin/classic/global/reader/RM-Line-Height-Plus-38x24.svg (../../shared/reader/RM-Line-Height-Plus-38x24.svg) - skin/classic/global/media/TopLevelImageDocument.css (../../shared/media/TopLevelImageDocument.css) +* skin/classic/global/media/TopLevelImageDocument.css (../../shared/media/TopLevelImageDocument.css) skin/classic/global/media/TopLevelVideoDocument.css (../../shared/media/TopLevelVideoDocument.css) skin/classic/global/media/imagedoc-lightnoise.png (../../shared/media/imagedoc-lightnoise.png) skin/classic/global/media/imagedoc-darknoise.png (../../shared/media/imagedoc-darknoise.png) diff --git a/toolkit/themes/shared/media/TopLevelImageDocument.css b/toolkit/themes/shared/media/TopLevelImageDocument.css index 524217516..de970512c 100644 --- a/toolkit/themes/shared/media/TopLevelImageDocument.css +++ b/toolkit/themes/shared/media/TopLevelImageDocument.css @@ -5,6 +5,12 @@ @media not print { /* N.B.: Remember to update ImageDocument.css in the tree or reftests may fail! */ +%ifdef MC_PALEMOON + body { + color: #eee; + background: #2E3B41; + } +%else body { color: #eee; background-image: url("chrome://global/skin/media/imagedoc-darknoise.png"); @@ -14,4 +20,5 @@ background: hsl(0,0%,90%) url("chrome://global/skin/media/imagedoc-lightnoise.png"); color: #222; } +%endif } |