Commit 84f317e9 authored by Robert Helmer's avatar Robert Helmer
Browse files

Bug 1665957 - rename Pioneer to Ion r=maxxcrawford,fluent-reviewers,flod

Differential Revision: https://phabricator.services.mozilla.com/D90749
parent 3d53187b
......@@ -57,7 +57,7 @@ var gIdentityHandler = {
* RegExp used to decide if an about url should be shown as being part of
* the browser UI.
*/
_secureInternalPages: /^(?:accounts|addons|cache|certificate|config|crashes|downloads|license|logins|preferences|protections|rights|sessionrestore|support|welcomeback|pioneer)(?:[?#]|$)/i,
_secureInternalPages: /^(?:accounts|addons|cache|certificate|config|crashes|downloads|license|logins|preferences|protections|rights|sessionrestore|support|welcomeback|ion)(?:[?#]|$)/i,
/**
* Whether the established HTTPS connection is considered "broken".
......
......@@ -277,7 +277,7 @@ toolbar[customizing] > .overflow-button {
display: none;
}
toolbar[customizing] #pioneer-button,
toolbar[customizing] #ion-button,
toolbar[customizing] #whats-new-menu-button {
display: none;
}
......
......@@ -2001,12 +2001,12 @@
<toolbaritem id="PanelUI-button"
removable="false">
<toolbarbutton id="pioneer-button"
<toolbarbutton id="ion-button"
class="toolbarbutton-1"
hidden="true"
badged="true"
onmousedown="switchToTabHavingURI('about:pioneer', true);"
onkeypress="switchToTabHavingURI('about:pioneer', true);"/>
onmousedown="switchToTabHavingURI('about:ion', true);"
onkeypress="switchToTabHavingURI('about:ion', true);"/>
<toolbarbutton id="whats-new-menu-button"
class="toolbarbutton-1"
hidden="true"
......
......@@ -2193,14 +2193,14 @@ BrowserGlue.prototype = {
_checkHTTPSOnlyPBMPref();
},
_monitorPioneerPref() {
const PREF_PIONEER_ID = "toolkit.telemetry.pioneerId";
_monitorIonPref() {
const PREF_ION_ID = "toolkit.telemetry.pioneerId";
const _checkPioneerPref = async () => {
const _checkIonPref = async () => {
for (let win of Services.wm.getEnumerator("navigator:browser")) {
win.document.getElementById(
"pioneer-button"
).hidden = !Services.prefs.getStringPref(PREF_PIONEER_ID, null);
"ion-button"
).hidden = !Services.prefs.getStringPref(PREF_ION_ID, null);
}
};
......@@ -2208,32 +2208,29 @@ BrowserGlue.prototype = {
onOpenWindow(xulWindow) {
const win = xulWindow.docShell.domWindow;
win.addEventListener("load", () => {
const pioneerButton = win.document.getElementById("pioneer-button");
if (pioneerButton) {
pioneerButton.hidden = !Services.prefs.getStringPref(
PREF_PIONEER_ID,
null
);
const ionButton = win.document.getElementById("ion-button");
if (ionButton) {
ionButton.hidden = !Services.prefs.getStringPref(PREF_ION_ID, null);
}
});
},
onCloseWindow() {},
};
Services.prefs.addObserver(PREF_PIONEER_ID, _checkPioneerPref);
Services.prefs.addObserver(PREF_ION_ID, _checkIonPref);
Services.wm.addListener(windowListener);
_checkPioneerPref();
_checkIonPref();
},
_monitorPioneerStudies() {
_monitorIonStudies() {
const STUDY_ADDON_COLLECTION_KEY = "pioneer-study-addons-v1";
const PREF_PIONEER_NEW_STUDIES_AVAILABLE =
const PREF_ION_NEW_STUDIES_AVAILABLE =
"toolkit.telemetry.pioneer-new-studies-available";
const _badgeIcon = async () => {
for (let win of Services.wm.getEnumerator("navigator:browser")) {
win.document
.getElementById("pioneer-button")
.getElementById("ion-button")
.querySelector(".toolbarbutton-badge")
.classList.add("feature-callout");
}
......@@ -2243,14 +2240,11 @@ BrowserGlue.prototype = {
onOpenWindow(xulWindow) {
const win = xulWindow.docShell.domWindow;
win.addEventListener("load", () => {
const pioneerButton = win.document.getElementById("pioneer-button");
if (pioneerButton) {
const badge = pioneerButton.querySelector(".toolbarbutton-badge");
const ionButton = win.document.getElementById("ion-button");
if (ionButton) {
const badge = ionButton.querySelector(".toolbarbutton-badge");
if (
Services.prefs.getBoolPref(
PREF_PIONEER_NEW_STUDIES_AVAILABLE,
false
)
Services.prefs.getBoolPref(PREF_ION_NEW_STUDIES_AVAILABLE, false)
) {
badge.classList.add("feature-callout");
} else {
......@@ -2263,15 +2257,15 @@ BrowserGlue.prototype = {
};
// Update all open windows if the pref changes.
Services.prefs.addObserver(PREF_PIONEER_NEW_STUDIES_AVAILABLE, _badgeIcon);
Services.prefs.addObserver(PREF_ION_NEW_STUDIES_AVAILABLE, _badgeIcon);
// Badge any currently-open windows.
if (Services.prefs.getBoolPref(PREF_PIONEER_NEW_STUDIES_AVAILABLE, false)) {
if (Services.prefs.getBoolPref(PREF_ION_NEW_STUDIES_AVAILABLE, false)) {
_badgeIcon();
}
RemoteSettings(STUDY_ADDON_COLLECTION_KEY).on("sync", async event => {
Services.prefs.setBoolPref(PREF_PIONEER_NEW_STUDIES_AVAILABLE, true);
Services.prefs.setBoolPref(PREF_ION_NEW_STUDIES_AVAILABLE, true);
});
// When a new window opens, check if we need to badge the icon.
......@@ -2368,8 +2362,8 @@ BrowserGlue.prototype = {
this._monitorScreenshotsPref();
this._monitorWebcompatReporterPref();
this._monitorHTTPSOnlyPref();
this._monitorPioneerPref();
this._monitorPioneerStudies();
this._monitorIonPref();
this._monitorIonStudies();
let pService = Cc["@mozilla.org/toolkit/profile-service;1"].getService(
Ci.nsIToolkitProfileService
......
......@@ -118,7 +118,7 @@ static const RedirEntry kRedirMap[] = {
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS},
{"pioneer", "chrome://browser/content/pioneer.html",
{"ion", "chrome://browser/content/ion.html",
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT},
};
......
......@@ -14,7 +14,7 @@ pages = [
'logins',
'newinstall',
'newtab',
'pioneer',
'ion',
'pocket-saved',
'pocket-signup',
'policies',
......
......@@ -143,7 +143,7 @@ details > summary {
display: none !important;
}
#pioneer-icon {
#ion-icon {
-moz-context-properties: fill;
fill: currentColor;
}
......
# 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/.
### This file is not in a locales directory to prevent it from
### being translated as the feature is still in heavy development
### and strings are likely to change often.
-ion-brand-short-name = Ion
ion = { -ion-brand-short-name }
ion-document-title = Put your data to work for a better internet
ion-summary = { -ion-brand-short-name } puts your data to work to address some of today’s most pressing technology concerns, like misinformation, data privacy, and ethical AI. The data you agree to share with Mozilla (the makers of Firefox) helps create tools for better internet transparency and design products that give control back to the people who use them. As a { -ion-brand-short-name } participant, you’ll also have the option to contribute your data to studies sponsored by research institutions and other organizations.
ion-study-prompt = Join to enroll
ion-join-study = Join Study
ion-leave-study = Leave Study
ion-enrollment-button = Join { -ion-brand-short-name }
ion-unenrollment-button = Leave { -ion-brand-short-name }
ion-current-studies = Current Studies
ion-no-current-studies = No current studies, please check back later.
ion-end-study = End Study
ion-ended-study = Study Ended
ion-accept-participate = Accept and Participate
ion-accept-leave = Accept and Leave
ion-cancel = Cancel
ion-consent-notice = { -ion-brand-short-name } Privacy Notice
ion-consent-study-notice = { -ion-brand-short-name } Study Privacy Consent Notice
ion-leave = Leaving { -ion-brand-short-name }
ion-consent-study-title = Leaving Study
ion-consent-study-join = Accept and Join Study
ion-consent-study-leave = Accept and Leave Study
ion-program-consent-intro = When you enroll in { -ion-brand-short-name }, you are sharing personal information. Keeping that information safe is important to us and to the integrity of { -ion-brand-short-name }. Here is how we safeguard your data and protect your identity.
ion-program-study-intro = When you enroll in this study, you are sharing personal information. Keeping that information safe is important to us and to the integrity of { -ion-brand-short-name }. Here is how we safeguard your data and protect your identity.
ion-works-title = How it works:
ion-works-bullet-get-started-title = Get started.
ion-works-bullet-get-started-content = Select the { ion-enrollment-button } button, review and agree to our Privacy Notice, and answer a few (optional) demographic questions. Note that { -ion-brand-short-name } is currently open to participants in the US who are 19 or older.
ion-works-bullet-enroll-title = Enroll in studies.
ion-works-bullet-enroll-content = Share your data with studies run by { -vendor-short-name } and our { -ion-brand-short-name } research partners. You’ll have the opportunity to learn about a study’s goals, the data it collects, and its research team before you enroll.
ion-works-bullet-control-title = Stay in control.
ion-works-bullet-control-content = The { -ion-brand-short-name } icon will appear on the { -brand-product-name } toolbar. Select the icon any time you want to return to this page to update your settings, enroll in a study, or leave a study or the { -ion-brand-short-name } program.
ion-your-data-title = Your data: why it matters and how we protect it
ion-your-data-summary = { -ion-brand-short-name } puts your data to work for a better internet. Our goal is to better understand topics like internet usage, online privacy, algorithmic bias, discrimination, and misinformation. This in turn can lead to new products that fundamentally change the tech landscape and hand more power and control back to users.
ion-your-data-bullet-know = You’ll know the information we plan to collect before we collect it. We publish our data collection documentation, so you can confirm this for yourself. Read each privacy notice for detailed information.
ion-your-data-bullet-lengths = We prioritize securing your data and protecting your privacy.
ion-your-data-bullet-leave = You can leave the { -ion-brand-short-name } program at any time, and we’ll stop collecting data when you do.
ion-your-data-learn-more = Learn more about <a data-l10n-name="privacy-policy">managing the data you share</a> with { -ion-brand-short-name }.
ion-us-only = Sorry, { -ion-brand-short-name } is currently only open to participants in the US.
ion-enroll-effective-date = Effective September 1, 2020
ion-enroll-summary = { -ion-brand-short-name } is an experimental initiative led by Mozilla to better understand how our users use and navigate the internet. { -ion-brand-short-name } is available to Firefox users in the United States who are 19 or older.
ion-enroll-demographic = When you join { -ion-brand-short-name }, we’ll ask you to provide optional demographic data. We’ll also collect basic technical and interaction data as long as you’re participating in { -ion-brand-short-name }. Once you’ve enrolled, you’ll have the opportunity to join available studies—each study will have a specific research purpose and unique privacy notice for you to review before you join it.
ion-enroll-privacy-notice = In this Privacy Notice, we detail what data the { -ion-brand-short-name } program collects and discloses, and why. Read each study’s privacy notice for information about how data is collected and handled in that particular study. We also adhere to the <a data-l10n-name="privacy-notice">Mozilla Privacy Policy</a> for how we receive, handle, and share information.
ion-enroll-data-disclosure = To see a full list of the data we collect, click <a data-l10n-name="privacy-policy">here</a>.
ion-enroll-what-we-collect = What Information We Collect:
ion-enroll-collect-demographic = <strong>Demographic data:</strong> We collect optional, self-reported demographic data from { -ion-brand-short-name } participants, including their age, gender, race/ethnicity, education level, household income, and zip code.
ion-enroll-technical-data = <strong>Technical data:</strong> We collect basic information about your device’s operating system. When Firefox sends data to us, your IP address is temporarily collected as part of our server logs.
ion-enroll-interaction-data = <strong>Interaction data:</strong> We collect data about your interactions with Firefox, like number and type of installed Firefox Add-ons and your active browsing session duration.
ion-enroll-location-data = <strong>Location data:</strong> We will use your IP address to approximate your country location, in addition to collecting your self-reported zip code (if you provide it).
ion-enroll-how-we-use = How We Use Your Information:
ion-enroll-r-and-d = We use the information we collect for for <strong>research and development</strong>, including:
ion-enroll-bullet-criteria = To determine which participants meet the criteria to be available to participate in particular research studies
ion-enroll-bullet-representative = To ensure our data sets are representative of the many users of Firefox
ion-enroll-bullet-improve-existing = To improve our existing products and services
ion-enroll-bullet-create = To create and develop new products
ion-enroll-who-we-disclose-to = Who We May Disclose Information To:
ion-enroll-who-we-disclose-bullet-gcp = <strong>Google Cloud Platform (GCP):</strong> We use GCP as our cloud-storage service. Mozilla has contracted with GCP requiring them to handle the data in ways that are approved by us.
ion-enroll-who-we-disclose-bullet-third-party = <strong>Third-party researchers:</strong> As part of being part of the { -ion-brand-short-name } program, we will offer you the ability to join studies. If necessary for the study, we may ask you to share all or some of the data collected under this Privacy Notice with the third party researcher(s) administering a study. Mozilla will contractually obligate the third party researchers to ensure that your data is handled in ways that are approved by us.
ion-enroll-who-we-disclose-bullet-public = <strong>General public:</strong> To advance our <a data-l10n-name="mozilla-manifesto">mission of being open</a>, we may release data sets to the general public. When we do so, we will aggregate the data and remove identifying information, so the data won’t reveal the behaviors or characteristics of individual users.
ion-enroll-data-management = Data Management:
ion-enroll-data-management-learn-more = You can learn more about managing your { -ion-brand-short-name } and individual study data <a data-l10n-name="privacy-policy">here</a>. If you have any other questions regarding our privacy practices, please contact us at <a data-l10n-name="compliance-email">compliance@mozilla.com</a>.
......@@ -10,108 +10,108 @@
<link rel="localization" href="browser/branding/brandings.ftl">
<link rel="localization" href="branding/brand.ftl">
<!-- Temporary "en-US"-only l10n strings -->
<link rel="localization" href="preview/pioneer.ftl">
<link rel="localization" href="preview/ion.ftl">
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css">
<link rel="stylesheet" href="chrome://browser/content/pioneer.css">
<script src="chrome://browser/content/pioneer.js"></script>
<link rel="icon" href="chrome://browser/skin/pioneer.svg">
<title data-l10n-id="pioneer"></title>
<link rel="stylesheet" href="chrome://browser/content/ion.css">
<script src="chrome://browser/content/ion.js"></script>
<link rel="icon" href="chrome://browser/skin/ion.svg">
<title data-l10n-id="ion"></title>
</head>
<body>
<div id="locale-notification" data-l10n-id="pioneer-us-only"></div>
<div id="locale-notification" data-l10n-id="ion-us-only"></div>
<div id="report-content">
<header>
<h1 id="title" data-l10n-id="pioneer-document-title"></h1>
<h1 id="title" data-l10n-id="ion-document-title"></h1>
<button id="enrollment-button" class="primary"></button>
</header>
<div id="summary" data-l10n-id="pioneer-summary"></div>
<div id="summary" data-l10n-id="ion-summary"></div>
<div id="details">
<h2 data-l10n-id="pioneer-works-title"></h2>
<p><strong data-l10n-id="pioneer-works-bullet-get-started-title" ></strong> <span data-l10n-id="pioneer-works-bullet-get-started-content"></span></p>
<p><strong data-l10n-id="pioneer-works-bullet-enroll-title" ></strong> <span data-l10n-id="pioneer-works-bullet-enroll-content"></span></p>
<p><strong data-l10n-id="pioneer-works-bullet-control-title" ></strong> <span data-l10n-id="pioneer-works-bullet-control-content"></span></p>
<h2 data-l10n-id="ion-works-title"></h2>
<p><strong data-l10n-id="ion-works-bullet-get-started-title" ></strong> <span data-l10n-id="ion-works-bullet-get-started-content"></span></p>
<p><strong data-l10n-id="ion-works-bullet-enroll-title" ></strong> <span data-l10n-id="ion-works-bullet-enroll-content"></span></p>
<p><strong data-l10n-id="ion-works-bullet-control-title" ></strong> <span data-l10n-id="ion-works-bullet-control-content"></span></p>
</div>
<div id="data">
<h2 data-l10n-id="pioneer-your-data-title"></h2>
<p data-l10n-id="pioneer-your-data-summary"></p>
<h2 data-l10n-id="ion-your-data-title"></h2>
<p data-l10n-id="ion-your-data-summary"></p>
<ul>
<li data-l10n-id="pioneer-your-data-bullet-know"></li>
<li data-l10n-id="pioneer-your-data-bullet-lengths"></li>
<li data-l10n-id="pioneer-your-data-bullet-leave"></li>
<li data-l10n-id="ion-your-data-bullet-know"></li>
<li data-l10n-id="ion-your-data-bullet-lengths"></li>
<li data-l10n-id="ion-your-data-bullet-leave"></li>
</ul>
<p data-l10n-id="pioneer-your-data-learn-more">
<p data-l10n-id="ion-your-data-learn-more">
<a data-l10n-name="privacy-policy" class="privacy-policy" href="https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/pioneer-managing-account-data" target="_blank"></a>
</p>
</div>
<h2 id="header-available-studies"></h2>
<div id="available-studies"></div>
<dialog id="join-pioneer-consent-dialog" class="modal" is="trapped-dialog">
<h3 data-l10n-id="pioneer-consent-notice"></h3>
<p data-l10n-id="pioneer-program-consent-intro"></p>
<ul id="join-pioneer-consent" class="consent-list">
<p data-l10n-id="pioneer-enroll-effective-date"></p>
<p data-l10n-id="pioneer-enroll-summary"></p>
<p data-l10n-id="pioneer-enroll-demographic"></p>
<p data-l10n-id="pioneer-enroll-privacy-notice">
<dialog id="join-ion-consent-dialog" class="modal" is="trapped-dialog">
<h3 data-l10n-id="ion-consent-notice"></h3>
<p data-l10n-id="ion-program-consent-intro"></p>
<ul id="join-ion-consent" class="consent-list">
<p data-l10n-id="ion-enroll-effective-date"></p>
<p data-l10n-id="ion-enroll-summary"></p>
<p data-l10n-id="ion-enroll-demographic"></p>
<p data-l10n-id="ion-enroll-privacy-notice">
<a data-l10n-name="privacy-notice" class="privacy-notice" href="https://www.mozilla.org/%LOCALE%/privacy/" target="_blank"></a>
</p>
<h2 data-l10n-id="pioneer-enroll-what-we-collect"></h2>
<p data-l10n-id="pioneer-enroll-collect-demographic"></p>
<p data-l10n-id="pioneer-enroll-technical-data"></p>
<p data-l10n-id="pioneer-enroll-interaction-data"></p>
<p data-l10n-id="pioneer-enroll-location-data"></p>
<p data-l10n-id="pioneer-enroll-data-disclosure">
<h2 data-l10n-id="ion-enroll-what-we-collect"></h2>
<p data-l10n-id="ion-enroll-collect-demographic"></p>
<p data-l10n-id="ion-enroll-technical-data"></p>
<p data-l10n-id="ion-enroll-interaction-data"></p>
<p data-l10n-id="ion-enroll-location-data"></p>
<p data-l10n-id="ion-enroll-data-disclosure">
<a data-l10n-name="privacy-policy" class="privacy-policy" href="https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/pioneer-managing-account-data" target="_blank"></a>
</p>
<h2 data-l10n-id="pioneer-enroll-how-we-use"></h2>
<p data-l10n-id="pioneer-enroll-r-and-d"></p>
<h2 data-l10n-id="ion-enroll-how-we-use"></h2>
<p data-l10n-id="ion-enroll-r-and-d"></p>
<ul>
<li data-l10n-id="pioneer-enroll-bullet-criteria"></li>
<li data-l10n-id="pioneer-enroll-bullet-representative"></li>
<li data-l10n-id="pioneer-enroll-bullet-improve-existing"></li>
<li data-l10n-id="pioneer-enroll-bullet-create"></li>
<li data-l10n-id="ion-enroll-bullet-criteria"></li>
<li data-l10n-id="ion-enroll-bullet-representative"></li>
<li data-l10n-id="ion-enroll-bullet-improve-existing"></li>
<li data-l10n-id="ion-enroll-bullet-create"></li>
</ul>
<h2 data-l10n-id="pioneer-enroll-who-we-disclose-to"></h2>
<p data-l10n-id="pioneer-enroll-who-we-disclose-bullet-gcp"></p>
<p data-l10n-id="pioneer-enroll-who-we-disclose-bullet-third-party"></p>
<p data-l10n-id="pioneer-enroll-who-we-disclose-bullet-public">
<h2 data-l10n-id="ion-enroll-who-we-disclose-to"></h2>
<p data-l10n-id="ion-enroll-who-we-disclose-bullet-gcp"></p>
<p data-l10n-id="ion-enroll-who-we-disclose-bullet-third-party"></p>
<p data-l10n-id="ion-enroll-who-we-disclose-bullet-public">
<a data-l10n-name="mozilla-manifesto" href="https://www.mozilla.org/about/manifesto/" target="_blank"></a>
</p>
<h2 data-l10n-id="pioneer-enroll-data-management"></h2>
<p data-l10n-id="pioneer-enroll-data-management-learn-more">
<h2 data-l10n-id="ion-enroll-data-management"></h2>
<p data-l10n-id="ion-enroll-data-management-learn-more">
<a data-l10n-name="privacy-policy" class="privacy-policy" href="https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/pioneer-managing-account-data" target="_blank"></a>
<a data-l10n-name="compliance-email" href="mailto:compliance@mozilla.com"></a>
</p>
</ul>
<footer>
<button id="join-pioneer-accept-dialog-button" class="primary" data-l10n-id="pioneer-accept-participate" ></button>
<button id="join-pioneer-cancel-dialog-button" data-l10n-id="pioneer-cancel" ></button>
<button id="join-ion-accept-dialog-button" class="primary" data-l10n-id="ion-accept-participate" ></button>
<button id="join-ion-cancel-dialog-button" data-l10n-id="ion-cancel" ></button>
</footer>
</dialog>
<dialog id="leave-pioneer-consent-dialog" class="modal" is="trapped-dialog">
<h3 data-l10n-id="pioneer-leave"></h3>
<ul id="leave-pioneer-consent" class="consent-list"></ul>
<dialog id="leave-ion-consent-dialog" class="modal" is="trapped-dialog">
<h3 data-l10n-id="ion-leave"></h3>
<ul id="leave-ion-consent" class="consent-list"></ul>
<footer>
<button id="leave-pioneer-cancel-dialog-button" class="primary" data-l10n-id="pioneer-cancel"></button>
<button id="leave-pioneer-accept-dialog-button" data-l10n-id="pioneer-accept-leave" ></button>
<button id="leave-ion-cancel-dialog-button" class="primary" data-l10n-id="ion-cancel"></button>
<button id="leave-ion-accept-dialog-button" data-l10n-id="ion-accept-leave" ></button>
</footer>
</dialog>
<dialog id="join-study-consent-dialog" class="modal" is="trapped-dialog">
<h3 data-l10n-id="pioneer-consent-study-notice"></h3>
<p data-l10n-id="pioneer-program-study-intro"></p>
<h3 data-l10n-id="ion-consent-study-notice"></h3>
<p data-l10n-id="ion-program-study-intro"></p>
<ul id="join-study-consent" class="consent-list"></ul>
<footer>
<button id="join-study-accept-dialog-button" class="primary" data-l10n-id="pioneer-consent-study-join"></button>
<button id="join-study-cancel-dialog-button" data-l10n-id="pioneer-cancel" ></button>
<button id="join-study-accept-dialog-button" class="primary" data-l10n-id="ion-consent-study-join"></button>
<button id="join-study-cancel-dialog-button" data-l10n-id="ion-cancel" ></button>
</footer>
</dialog>
<dialog id="leave-study-consent-dialog" class="modal" is="trapped-dialog">
<h3 data-l10n-id="pioneer-consent-study-title"></h3>
<h3 data-l10n-id="ion-consent-study-title"></h3>
<ul id="leave-study-consent" class="consent-list"></ul>
<footer>
<button id="leave-study-cancel-dialog-button" class="primary" data-l10n-id="pioneer-cancel" ></button>
<button id="leave-study-accept-dialog-button" data-l10n-id="pioneer-consent-study-leave"></button>
<button id="leave-study-cancel-dialog-button" class="primary" data-l10n-id="ion-cancel" ></button>
<button id="leave-study-accept-dialog-button" data-l10n-id="ion-consent-study-leave"></button>
</footer>
</dialog>
</div>
......
......@@ -2,6 +2,15 @@
* 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/. */
/**
* Control panel for the Ion project, formerly known as Pioneer.
* This lives in `about:ion` and provides a UI for users to un/enroll in the
* overall program, and to un/enroll from individual studies.
*
* NOTE - prefs and Telemetry both still mention Pioneer for backwards-compatibility,
* this may change in the future.
*/
const { AddonManager } = ChromeUtils.import(
"resource://gre/modules/AddonManager.jsm"
);
......@@ -16,10 +25,10 @@ const { TelemetryController } = ChromeUtils.import(
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const PREF_PIONEER_ID = "toolkit.telemetry.pioneerId";
const PREF_PIONEER_NEW_STUDIES_AVAILABLE =
const PREF_ION_ID = "toolkit.telemetry.pioneerId";
const PREF_ION_NEW_STUDIES_AVAILABLE =
"toolkit.telemetry.pioneer-new-studies-available";
const PREF_PIONEER_COMPLETED_STUDIES =
const PREF_ION_COMPLETED_STUDIES =
"toolkit.telemetry.pioneer-completed-studies";
/**
......@@ -38,15 +47,15 @@ const PREF_TEST_CACHED_ADDONS = "toolkit.pioneer.testCachedAddons";
const PREF_TEST_ADDONS = "toolkit.pioneer.testAddons";
function showEnrollmentStatus() {
const pioneerId = Services.prefs.getStringPref(PREF_PIONEER_ID, null);
const ionId = Services.prefs.getStringPref(PREF_ION_ID, null);
const enrollmentButton = document.getElementById("enrollment-button");
document.l10n.setAttributes(
enrollmentButton,
`pioneer-${pioneerId ? "un" : ""}enrollment-button`
`ion-${ionId ? "un" : ""}enrollment-button`
);
enrollmentButton.classList.toggle("primary", !pioneerId);
enrollmentButton.classList.toggle("primary", !ionId);
}
function toggleContentBasedOnLocale() {
......@@ -102,7 +111,7 @@ async function toggleEnrolled(studyAddonId, cachedAddons) {
}
const completedStudies = Services.prefs.getStringPref(
PREF_PIONEER_COMPLETED_STUDIES,
PREF_ION_COMPLETED_STUDIES,
"{}"
);
......@@ -114,7 +123,7 @@ async function toggleEnrolled(studyAddonId, cachedAddons) {
await addon.uninstall();
await sendDeletionPing(studyAddonId);
document.l10n.setAttributes(joinBtn, "pioneer-join-study");
document.l10n.setAttributes(joinBtn, "ion-join-study");
joinBtn.disabled = false;
// Record that the user abandoned this study, since it may not be re-join-able.
......@@ -122,7 +131,7 @@ async function toggleEnrolled(studyAddonId, cachedAddons) {
const studies = JSON.parse(completedStudies);
studies[studyAddonId] = STUDY_LEAVE_REASONS.USER_ABANDONED;
Services.prefs.setStringPref(
PREF_PIONEER_COMPLETED_STUDIES,
PREF_ION_COMPLETED_STUDIES,
JSON.stringify(studies)
);
}
......@@ -142,7 +151,7 @@ async function toggleEnrolled(studyAddonId, cachedAddons) {
}
joinBtn.disabled = true;
await install.install();
document.l10n.setAttributes(joinBtn, "pioneer-leave-study");
document.l10n.setAttributes(joinBtn, "ion-leave-study");
joinBtn.disabled = false;
// Send an enrollment ping for this study. Note that this could be sent again
......@@ -154,9 +163,9 @@ async function toggleEnrolled(studyAddonId, cachedAddons) {
}
async function showAvailableStudies(cachedAddons) {
const pioneerId = Services.prefs.getStringPref(PREF_PIONEER_ID, null);
const ionId = Services.prefs.getStringPref(PREF_ION_ID, null);
const defaultAddons = cachedAddons.filter(a => a.isDefault);
if (pioneerId) {
if (ionId) {
for (const defaultAddon of defaultAddons) {
let addon;
let install;
......@@ -165,8 +174,7 @@ async function showAvailableStudies(cachedAddons) {
install = {
install: async () => {
if (
defaultAddon.addon_id ==
"pioneer-v2-bad-default-example@mozilla.org"
defaultAddon.addon_id == "ion-v2-bad-default-example@mozilla.org"
) {
throw new Error("Bad test default add-on");
}
......@@ -190,7 +198,7 @@ async function showAvailableStudies(cachedAddons) {
for (const cachedAddon of studyAddons) {
if (!cachedAddon) {
console.error(
`about:pioneer - Study addon ID not found in cache: ${studyAddonId}`
`about:ion - Study addon ID not found in cache: ${studyAddonId}`
);
return;
}
......@@ -230,7 +238,7 @@ async function showAvailableStudies(cachedAddons) {
joinBtn.setAttribute("id", `${studyAddonId}-join-button`);
joinBtn.classList.add("primary");
joinBtn.classList.add("join-button");
document.l10n.setAttributes(joinBtn, "pioneer-join-study");
document.l10n.setAttributes(joinBtn, "ion-join-study");
joinBtn.addEventListener("click", async () => {
let addon;
......@@ -319,7 +327,7 @@ async function showAvailableStudies(cachedAddons) {
}
const availableStudies = document.getElementById("header-available-studies");
document.l10n.setAttributes(availableStudies, "pioneer-current-studies");
document.l10n.setAttributes(availableStudies, "ion-current-studies");
}
async function updateStudy(studyAddonId) {
......@@ -341,10 +349,10 @@ async function updateStudy(studyAddonId) {
const joinBtn = study.querySelector(".join-button");
const pioneerId = Services.prefs.getStringPref(PREF_PIONEER_ID, null);
const ionId = Services.prefs.getStringPref(PREF_ION_ID, null);
const completedStudies = Services.prefs.getStringPref(
PREF_PIONEER_COMPLETED_STUDIES,
PREF_ION_COMPLETED_STUDIES,
"{}"
);
......@@ -352,21 +360,21 @@ async function updateStudy(studyAddonId) {
if (studyAddonId in studies) {
study.style.opacity = 0.5;
joinBtn.disabled = true;
document.l10n.setAttributes(joinBtn, "pioneer-ended-study");
document.l10n.setAttributes(joinBtn, "ion-ended-study");
return;
}
if (pioneerId) {
if (ionId) {
study.style.opacity = 1;
joinBtn.disabled = false;
if (addon) {
document.l10n.setAttributes(joinBtn, "pioneer-leave-study");
document.l10n.setAttributes(joinBtn, "ion-leave-study");
} else {
document.l10n.setAttributes(joinBtn, "pioneer-join-study");
document.l10n.setAttributes(joinBtn, "ion-join-study");
}
} else {
document.l10n.setAttributes(joinBtn, "pioneer-study-prompt");
document.l10n.setAttributes(joinBtn, "ion-study-prompt");
study.style.opacity = 0.5;
joinBtn.disabled = true;
}
......@@ -386,28 +394,28 @@ async function setup(cachedAddons) {
document
.getElementById("enrollment-button")
.addEventListener("click", async () => {
const pioneerId = Services.prefs.getStringPref(PREF_PIONEER_ID, null);
const ionId = Services.prefs.getStringPref(PREF_ION_ID, null);
if (pioneerId) {