This commit is contained in:
Mark Banner 2017-03-13 11:30:29 +00:00
Родитель abfd2f7432
Коммит 9e668c9f67
7 изменённых файлов: 26 добавлений и 17 удалений

Просмотреть файл

@ -125,7 +125,7 @@ module.exports = {
"no-floating-decimal": "error",
"no-func-assign": "error",
"no-implicit-coercion": ["error", {"allow": ["!!"]}],
"no-implicit-globals": "error",
"no-implicit-globals": "off",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-inner-declarations": "error",
@ -207,7 +207,7 @@ module.exports = {
"no-unused-labels": "error",
"no-unused-vars": ["error", {
"vars": "all",
"varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS",
"varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS|startup|shutdown|install|uninstall",
"args": "none"
}],
"no-use-before-define": "error",

8
addons/aushelper/bootstrap.js поставляемый
Просмотреть файл

@ -35,16 +35,18 @@ const observer = {
case "prefservice:after-app-defaults":
TelemetryLog.log("WEBSENSE_DEFAULT_PREFS_RESET");
break;
case "nsPref:changed":
case "nsPref:changed": {
let branch = Services.prefs.getDefaultBranch("");
let prefValue = branch.getCharPref(APP_UPDATE_URL_PREF);
TelemetryLog.log("WEBSENSE_PREF_CHANGED", [prefValue]);
break;
}
}
}
};
function startup() {
/* eslint max-depth:off */
function startup() { // eslint-disable-line complexity, max-statements
if (Services.appinfo.OS != "WINNT") {
return;
}
@ -110,7 +112,7 @@ function startup() {
hexVal.unshift(c);
}
cpuRevMatch = false;
if (microCodeVersions.indexOf(parseInt(hexVal.join(""))) != -1) {
if (microCodeVersions.indexOf(parseInt(hexVal.join(""), 16)) != -1) {
cpuRevMatch = true;
}
break;

16
addons/tls13-compat-ff51/bootstrap.js поставляемый
Просмотреть файл

@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
let {classes: Cc, interfaces: Ci, utils: Cu} = Components;
let {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Services.jsm");
@ -34,7 +34,7 @@ let gTimer;
function debug(msg) {
if (DEBUG) {
console.log(`TLSEXP: ${msg}`);
console.log(`TLSEXP: ${msg}`); // eslint-disable-line no-console
}
}
@ -97,7 +97,7 @@ function makeRequest(prefs, index, url, body) {
debug("Finished with error");
let channel = e.target.channel;
let nsireq = channel.QueryInterface(Ci.nsIRequest);
result.error = nsireq ? nsireq.status : NS_ERROR_NOT_AVAILABLE;
result.error = nsireq ? nsireq.status : Cr.NS_ERROR_NOT_AVAILABLE;
recordSecInfo(channel, result);
result.elapsed = Date.now() - t0;
debug("Re-setting pref");
@ -146,7 +146,7 @@ function report(status, result) {
// Inefficient shuffle algorithm, but n <= 10
function shuffleArray(orig) {
let inarr = [];
for (let i in orig) {
for (let i of orig) {
inarr.push(orig[i]);
}
let out = [];
@ -171,7 +171,7 @@ function install() { // eslint-disable-line no-unused-vars
// setting.
let userprefs = new Preferences();
if (userprefs.isSet(VERSION_MAX_PREF)) {
console.log("User has changed TLS max version. Skipping");
debug("User has changed TLS max version. Skipping");
return;
}
@ -193,15 +193,15 @@ function install() { // eslint-disable-line no-unused-vars
let shuffled = shuffleArray(Object.keys(URLs));
let results = [];
Task.spawn(function*() {
for (let i in shuffled) {
Task.spawn(function*() { // eslint-disable-line promise/catch-or-return
for (let i of shuffled) {
results.push(yield makeRequest(gPrefs, i, shuffled[i], null));
}
report("report", results);
})
.catch(e => Cu.reportError(e))
.then(_ => {
.then(_ => { // eslint-disable-line promise/always-return
// Make sure we re-set to TLS 1.2.
setTlsPref(gPrefs, 3);

Просмотреть файл

@ -2,11 +2,13 @@
* 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 {Preferences} = Cu.import("resource://gre/modules/Preferences.jsm", {});
const {TelemetryArchive} = Cu.import("resource://gre/modules/TelemetryArchive.jsm", {});
/* global AddonManager */
"use strict";
const {Preferences} = Cu.import("resource://gre/modules/Preferences.jsm", {});
const {TelemetryArchive} = Cu.import("resource://gre/modules/TelemetryArchive.jsm", {});
// The Firefox TLS setting. 3 is TLS 1.2, 4 is TLS 1.3
const VERSION_MAX_PREF = "security.tls.version.max";

5
addons/websensehelper/bootstrap.js поставляемый
Просмотреть файл

@ -10,6 +10,8 @@
// matching. Instead of REPLACE_KEY + "/", we match on a regex which accounts for
// the possibility that the Bug1296630 replacement has already run.
const PREF_DEFAULTS_RESET_TOPIC = "prefservice:after-app-defaults";
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
const APP_UPDATE_URL_PREF = "app.update.url";
@ -25,11 +27,12 @@ const observer = {
case "prefservice:after-app-defaults":
TelemetryLog.log("WEBSENSE_DEFAULT_PREFS_RESET");
break;
case "nsPref:changed":
case "nsPref:changed": {
let branch = Services.prefs.getDefaultBranch("");
let prefValue = branch.getCharPref(APP_UPDATE_URL_PREF);
TelemetryLog.log("WEBSENSE_PREF_CHANGED", [prefValue]);
break;
}
}
}
};

Просмотреть файл

@ -1,4 +1,6 @@
// Parent config file for all browser-chrome files.
/* eslint-env node */
module.exports = {
"rules": {
"mozilla/import-headjs-globals": "warn",
@ -8,6 +10,7 @@ module.exports = {
"env": {
"browser": true,
"mozilla/browser-window": true,
"mozilla/places-overlay": true,
"mozilla/simpletest": true,
"node": true
},

Просмотреть файл

@ -96,7 +96,6 @@
"FxAccountsStorage.jsm": ["FxAccountsStorageManagerCanStoreField", "FxAccountsStorageManager"],
"FxAccountsWebChannel.jsm": ["EnsureFxAccountsWebChannel"],
"gDevTools.jsm": ["gDevTools", "gDevToolsBrowser"],
"gDevTools.jsm": ["gDevTools", "gDevToolsBrowser"],
"Geometry.jsm": ["Point", "Rect"],
"Gestures.jsm": ["GestureSettings", "GestureTracker"],
"GMPInstallManager.jsm": ["GMPInstallManager", "GMPExtractor", "GMPDownloader", "GMPAddon"],