Skip to content

Commit

Permalink
Merge autoland to mozilla-central. a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
raulgurzau committed May 17, 2019
2 parents a0948f1 + 79650a7 commit 5a74fb4
Show file tree
Hide file tree
Showing 673 changed files with 7,420 additions and 7,325 deletions.
37 changes: 33 additions & 4 deletions .eslintignore
Expand Up @@ -101,12 +101,41 @@ devtools/shared/tests/mochitest/*.html
devtools/shared/webconsole/test/test_*.html
devtools/client/webreplay/mochitest/examples/*.html

# Soon to be removed, the new/ directory is explicitly excluded below due to
# also being an imported repository.
devtools/client/debugger/**
# Ignore devtools debugger files
# Keep in sync with devtools/client/debugger/.eslintignore
devtools/client/debugger/assets/*
devtools/client/debugger/src/test/examples/**
devtools/client/debugger/src/test/integration/**
devtools/client/debugger/src/test/unit-sources/**
devtools/client/debugger/src/**/fixtures/**
devtools/client/debugger/src/test/mochitest/**
devtools/client/debugger/bin/
devtools/client/debugger/packages/**/fixtures/**
devtools/client/debugger/node_modules
devtools/client/debugger/out

# Ignore devtools debugger files
# Keep in sync with devtools/client/debugger/.prettierignore
devtools/client/debugger/src/workers/parser/tests/fixtures/functionNames.js
devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/*.js
devtools/client/debugger/src/workers/parser/tests/fixtures/pause/*.js
devtools/client/debugger/src/test/mochitest/examples/babel/polyfill-bundle.js
devtools/client/debugger/src/test/mochitest/examples/babel/fixtures/*/input.js
devtools/client/debugger/src/test/mochitest/examples/babel/fixtures/*/output.js
devtools/client/debugger/src/test/mochitest/examples/babel/fixtures/*/output.js.map
devtools/client/debugger/src/test/mochitest/examples/ember/quickstart

# Ignore devtools debugger files which aren't intended for linting, and also
# aren't included in any .eslintignore or .prettierignore file.
# See https://github.com/firefox-devtools/debugger/blob/master/package.json#L24
devtools/client/debugger/configs/**
devtools/client/debugger/dist/**
devtools/client/debugger/flow-typed/**
devtools/client/debugger/images/**
devtools/client/debugger/test/**
devtools/client/debugger/index.html

# Ignore devtools imported repositories
devtools/client/debugger/**
devtools/client/shared/components/reps/**

# Ignore devtools preferences files
Expand Down
5 changes: 5 additions & 0 deletions .prettierrc
@@ -0,0 +1,5 @@
{
"printWidth": 80,
"tabWidth": 2,
"trailingComma": "es5"
}
14 changes: 2 additions & 12 deletions browser/app/profile/firefox.js
Expand Up @@ -1188,7 +1188,6 @@ pref("services.sync.prefs.sync.addons.ignoreUserEnabledChanges", true);
// source, and this would propagate automatically to other,
// uncompromised Sync-connected devices.
pref("services.sync.prefs.sync.browser.contentblocking.category", true);
pref("services.sync.prefs.sync.browser.contentblocking.features.standard", true);
pref("services.sync.prefs.sync.browser.contentblocking.features.strict", true);
pref("services.sync.prefs.sync.browser.contentblocking.introCount", true);
pref("services.sync.prefs.sync.browser.crashReports.unsubmittedCheck.autoSubmit2", true);
Expand Down Expand Up @@ -1591,7 +1590,7 @@ pref("browser.contentblocking.control-center.ui.showAllowedLabels", false);
pref("browser.contentblocking.cryptomining.preferences.ui.enabled", true);
pref("browser.contentblocking.fingerprinting.preferences.ui.enabled", true);

// Possible values for browser.contentblocking.features.* prefs:
// Possible values for browser.contentblocking.features.strict pref:
// Tracking Protection:
// "tp": tracking protection enabled
// "-tp": tracking protection disabled
Expand All @@ -1610,17 +1609,8 @@ pref("browser.contentblocking.fingerprinting.preferences.ui.enabled", true);
// "cookieBehavior2": cookie behaviour BEHAVIOR_REJECT
// "cookieBehavior3": cookie behaviour BEHAVIOR_LIMIT_FOREIGN
// "cookieBehavior4": cookie behaviour BEHAVIOR_REJECT_TRACKER
// One value from each section must be included in each browser.contentblocking.features.* pref.
// One value from each section must be included in the browser.contentblocking.features.strict pref.
pref("browser.contentblocking.features.strict", "tp,tpPrivate,cookieBehavior4,cm,fp");
// Enable blocking access to storage from tracking resources only in nightly
// and early beta. By default the value is "cookieBehavior0": BEHAVIOR_ACCEPT
// Enable cryptomining blocking in standard in nightly and early beta.
// Enable fingerprinting blocking in standard in nightly and early beta.
#ifdef EARLY_BETA_OR_EARLIER
pref("browser.contentblocking.features.standard", "-tp,tpPrivate,cookieBehavior4,cm,fp");
#else
pref("browser.contentblocking.features.standard", "-tp,tpPrivate,cookieBehavior0,-cm,-fp");
#endif

// Enable the Report Breakage UI on Nightly and Beta but not on Release yet.
#ifdef EARLY_BETA_OR_EARLIER
Expand Down
120 changes: 57 additions & 63 deletions browser/components/BrowserGlue.jsm
Expand Up @@ -1039,8 +1039,8 @@ BrowserGlue.prototype = {
Services.prefs.removeObserver("privacy.trackingprotection", this._matchCBCategory);
Services.prefs.removeObserver("network.cookie.cookieBehavior", this._matchCBCategory);
Services.prefs.removeObserver(ContentBlockingCategoriesPrefs.PREF_CB_CATEGORY, this._updateCBCategory);
Services.prefs.removeObserver("browser.contentblocking.features.standard", this._setPrefExpectations);
Services.prefs.removeObserver("browser.contentblocking.features.strict", this._setPrefExpectations);
Services.prefs.removeObserver("privacy.trackingprotection", this._setPrefExpectations);
Services.prefs.removeObserver("browser.contentblocking.features.strict", this._setPrefExpectationsAndUpdate);
},

// runs on startup, before the first command line handler is invoked
Expand Down Expand Up @@ -1391,16 +1391,16 @@ BrowserGlue.prototype = {

// Set the default favicon size for UI views that use the page-icon protocol.
PlacesUtils.favicons.setDefaultIconURIPreferredSize(16 * aWindow.devicePixelRatio);
this._setPrefExpectations();
this._setPrefExpectationsAndUpdate();
this._matchCBCategory();

// This observes the entire privacy.trackingprotection.* pref tree.
Services.prefs.addObserver("privacy.trackingprotection", this._matchCBCategory);
Services.prefs.addObserver("network.cookie.cookieBehavior", this._matchCBCategory);
Services.prefs.addObserver(ContentBlockingCategoriesPrefs.PREF_CB_CATEGORY, this._updateCBCategory);
Services.prefs.addObserver("media.autoplay.default", this._updateAutoplayPref);
Services.prefs.addObserver("browser.contentblocking.features.standard", this._setPrefExpectations);
Services.prefs.addObserver("browser.contentblocking.features.strict", this._setPrefExpectations);
Services.prefs.addObserver("privacy.trackingprotection", this._setPrefExpectations);
Services.prefs.addObserver("browser.contentblocking.features.strict", this._setPrefExpectationsAndUpdate);
},

_updateAutoplayPref() {
Expand All @@ -1410,6 +1410,10 @@ BrowserGlue.prototype = {

_setPrefExpectations() {
ContentBlockingCategoriesPrefs.setPrefExpectations();
},

_setPrefExpectationsAndUpdate() {
ContentBlockingCategoriesPrefs.setPrefExpectations();
ContentBlockingCategoriesPrefs.updateCBCategory();
},

Expand Down Expand Up @@ -3018,13 +3022,12 @@ BrowserGlue.prototype = {
var ContentBlockingCategoriesPrefs = {
PREF_CB_CATEGORY: "browser.contentblocking.category",
PREF_STRICT_DEF: "browser.contentblocking.features.strict",
PREF_STANDARD_DEF: "browser.contentblocking.features.standard",
switchingCategory: false,

setPrefExpectations() {
// The prefs inside CATEGORY_PREFS are initial values, these values then get set.
// If the pref remains null, then it will expect the default value,
// but the UI will not respond correctly.
// The prefs inside CATEGORY_PREFS are initial values.
// If the pref remains null, then it will expect the default value.
// The "standard" category is defined as expecting all 5 default values.
this.CATEGORY_PREFS = {
strict: {
"network.cookie.cookieBehavior": null,
Expand All @@ -3041,58 +3044,51 @@ var ContentBlockingCategoriesPrefs = {
"privacy.trackingprotection.cryptomining.enabled": null,
},
};
let types = ["strict", "standard"];
for (let type of types) {
let rulesArray;
if (type == "strict") {
rulesArray = Services.prefs.getStringPref(this.PREF_STRICT_DEF).split(",");
} else {
rulesArray = Services.prefs.getStringPref(this.PREF_STANDARD_DEF).split(",");
}
for (let item of rulesArray) {
switch (item) {
case "tp":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.enabled"] = true;
break;
case "-tp":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.enabled"] = false;
break;
case "tpPrivate":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.pbmode.enabled"] = true;
break;
case "-tpPrivate":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.pbmode.enabled"] = false;
break;
case "fp":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.fingerprinting.enabled"] = true;
break;
case "-fp":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.fingerprinting.enabled"] = false;
break;
case "cm":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.cryptomining.enabled"] = true;
break;
case "-cm":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.cryptomining.enabled"] = false;
break;
case "cookieBehavior0":
this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_ACCEPT;
break;
case "cookieBehavior1":
this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN;
break;
case "cookieBehavior2":
this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_REJECT;
break;
case "cookieBehavior3":
this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN;
break;
case "cookieBehavior4":
this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER;
break;
default:
Cu.reportError(`Error: Unknown rule observed ${item}`);
}
let type = "strict";
let rulesArray = Services.prefs.getStringPref(this.PREF_STRICT_DEF).split(",");
for (let item of rulesArray) {
switch (item) {
case "tp":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.enabled"] = true;
break;
case "-tp":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.enabled"] = false;
break;
case "tpPrivate":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.pbmode.enabled"] = true;
break;
case "-tpPrivate":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.pbmode.enabled"] = false;
break;
case "fp":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.fingerprinting.enabled"] = true;
break;
case "-fp":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.fingerprinting.enabled"] = false;
break;
case "cm":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.cryptomining.enabled"] = true;
break;
case "-cm":
this.CATEGORY_PREFS[type]["privacy.trackingprotection.cryptomining.enabled"] = false;
break;
case "cookieBehavior0":
this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_ACCEPT;
break;
case "cookieBehavior1":
this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN;
break;
case "cookieBehavior2":
this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_REJECT;
break;
case "cookieBehavior3":
this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN;
break;
case "cookieBehavior4":
this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER;
break;
default:
Cu.reportError(`Error: Unknown rule observed ${item}`);
}
}
},
Expand All @@ -3109,7 +3105,6 @@ var ContentBlockingCategoriesPrefs = {
for (let pref in this.CATEGORY_PREFS[category]) {
let value = this.CATEGORY_PREFS[category][pref];
if (value == null) {
Cu.reportError(`Error: ${pref} has not been defined in ${category}`);
if (Services.prefs.prefHasUserValue(pref)) {
return false;
}
Expand Down Expand Up @@ -3175,7 +3170,6 @@ var ContentBlockingCategoriesPrefs = {
let value = this.CATEGORY_PREFS[category][pref];
if (!Services.prefs.prefIsLocked(pref)) {
if (value == null) {
Cu.reportError(`Error: ${pref} has not been defined in ${category}`);
Services.prefs.clearUserPref(pref);
} else {
switch (Services.prefs.getPrefType(pref)) {
Expand Down
3 changes: 3 additions & 0 deletions browser/components/newtab/.mcignore
Expand Up @@ -14,6 +14,9 @@ npm-debug.log
/logs/
/node_modules/

# ignore README since it's GitHub specific
/README.md

# also ignores ping centre tests
ping-centre/

Expand Down
24 changes: 0 additions & 24 deletions browser/components/newtab/README.md

This file was deleted.

Expand Up @@ -24,7 +24,8 @@ export function convertLinks(links, sendClick, doNotAutoBlock, openNewWindow = f
// Setting the value to false will not include the attribute in the anchor
const url = action ? false : safeURI(links[linkTag].url);

acc[linkTag] = (<a href={url}
acc[linkTag] = (<a href={url} // eslint-disable-line jsx-a11y/anchor-has-content
// eslint was getting a false positive caused by the dynamic injection of content.
target={openNewWindow ? "_blank" : ""}
data-metric={links[linkTag].metric}
data-action={action}
Expand Down
Expand Up @@ -98,3 +98,23 @@
vertical-align: middle;
}
}

// We show snippet icons for both themes and conditionally hide
// based on which theme is currently active
body {
&:not([lwt-newtab-brighttext]) {
.icon-dark-theme,
.icon.icon-dark-theme,
.scene2Icon .icon-dark-theme {
display: none;
}
}

&[lwt-newtab-brighttext] {
.icon-light-theme,
.icon.icon-light-theme,
.scene2Icon .icon-light-theme {
display: none;
}
}
}
@@ -1,7 +1,7 @@
{
"title": "EOYSnippet",
"description": "Fundraising Snippet",
"version": "1.0.0",
"version": "1.1.0",
"type": "object",
"definitions": {
"plainText": {
Expand Down Expand Up @@ -76,6 +76,10 @@
"type": "string",
"description": "Snippet icon. 64x64px. SVG or PNG preferred."
},
"icon_dark_theme": {
"type": "string",
"description": "Snippet icon. Dark theme variant. 64x64px. SVG or PNG preferred."
},
"title": {
"allOf": [
{"$ref": "#/definitions/plainText"},
Expand All @@ -86,6 +90,10 @@
"type": "string",
"description": "Small icon that shows up before the title / text. 16x16px. SVG or PNG preferred. Grayscale."
},
"title_icon_dark_theme": {
"type": "string",
"description": "Small icon that shows up before the title / text. Dark theme variant. 16x16px. SVG or PNG preferred. Grayscale."
},
"button_label": {
"allOf": [
{"$ref": "#/definitions/plainText"},
Expand Down
@@ -1,7 +1,7 @@
{
"title": "FXASignupSnippet",
"description": "A snippet template for FxA sign up/sign in",
"version": "1.0.0",
"version": "1.1.0",
"type": "object",
"definitions": {
"plainText": {
Expand Down Expand Up @@ -47,10 +47,18 @@
"type": "string",
"description": "Snippet icon. 64x64px. SVG or PNG preferred."
},
"scene1_icon_dark_theme": {
"type": "string",
"description": "Snippet icon. Dark theme variant. 64x64px. SVG or PNG preferred."
},
"scene1_title_icon": {
"type": "string",
"description": "Small icon that shows up before the title / text. 16x16px. SVG or PNG preferred. Grayscale."
},
"scene1_title_icon_dark_theme": {
"type": "string",
"description": "Small icon that shows up before the title / text. Dark theme variant. 16x16px. SVG or PNG preferred. Grayscale."
},
"scene2_email_placeholder_text": {
"type": "string",
"description": "Value to show while input is empty.",
Expand Down

0 comments on commit 5a74fb4

Please sign in to comment.