mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Bug 1691527 - remove email bits from content process crash dialog. r=mconley
We no longer want to collect email data in crash reports, so we no longer need to potentially solicit the user for it in the content process crash dialog. This removes the disabled code for collecting email data. Differential Revision: https://phabricator.services.mozilla.com/D105496
This commit is contained in:
parent
903f8b2eb4
commit
91e924a5c7
@ -79,10 +79,6 @@ var AboutTabCrashed = {
|
||||
this.onClick(event);
|
||||
break;
|
||||
}
|
||||
case "input": {
|
||||
this.onInput(event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -96,9 +92,6 @@ var AboutTabCrashed = {
|
||||
el.addEventListener("click", this);
|
||||
});
|
||||
|
||||
// For setting "emailMe" checkbox automatically on email value change.
|
||||
document.getElementById("email").addEventListener("input", this);
|
||||
|
||||
// Error pages are loaded as LOAD_BACKGROUND, so they don't get load events.
|
||||
let event = new CustomEvent("AboutTabCrashedLoad", { bubbles: true });
|
||||
document.dispatchEvent(event);
|
||||
@ -130,14 +123,6 @@ var AboutTabCrashed = {
|
||||
}
|
||||
},
|
||||
|
||||
onInput(event) {
|
||||
switch (event.target.id) {
|
||||
case "email": {
|
||||
document.getElementById("emailMe").checked = !!event.target.value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* After this page tells the parent that it has loaded, the parent
|
||||
* will respond with whether or not a crash report is available. This
|
||||
@ -158,13 +143,6 @@ var AboutTabCrashed = {
|
||||
* Whether or not the user prefers to send the URL of
|
||||
* the tab that crashed.
|
||||
*
|
||||
* emailMe (bool):
|
||||
* Whether or not to send the email address of the user
|
||||
* in the report.
|
||||
*
|
||||
* email (String):
|
||||
* The email address of the user (empty if emailMe is false).
|
||||
*
|
||||
* requestAutoSubmit (bool):
|
||||
* Whether or not we should ask the user to automatically
|
||||
* submit backlogged crash reports.
|
||||
@ -180,14 +158,6 @@ var AboutTabCrashed = {
|
||||
document.getElementById("sendReport").checked = data.sendReport;
|
||||
document.getElementById("includeURL").checked = data.includeURL;
|
||||
|
||||
if (data.requestEmail) {
|
||||
document.getElementById("requestEmail").hidden = false;
|
||||
document.getElementById("emailMe").checked = data.emailMe;
|
||||
if (data.emailMe) {
|
||||
document.getElementById("email").value = data.email;
|
||||
}
|
||||
}
|
||||
|
||||
this.showCrashReportUI(data.sendReport);
|
||||
} else {
|
||||
this.showCrashReportUI(false);
|
||||
@ -255,10 +225,8 @@ var AboutTabCrashed = {
|
||||
*/
|
||||
sendMessage(messageName) {
|
||||
let comments = "";
|
||||
let email = "";
|
||||
let URL = "";
|
||||
let sendReport = false;
|
||||
let emailMe = false;
|
||||
let includeURL = false;
|
||||
let autoSubmit = false;
|
||||
|
||||
@ -271,13 +239,6 @@ var AboutTabCrashed = {
|
||||
if (includeURL) {
|
||||
URL = this.pageData.URL.trim();
|
||||
}
|
||||
|
||||
if (!document.getElementById("requestEmail").hidden) {
|
||||
emailMe = document.getElementById("emailMe").checked;
|
||||
if (emailMe) {
|
||||
email = document.getElementById("email").value.trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -293,8 +254,6 @@ var AboutTabCrashed = {
|
||||
RPMSendAsyncMessage(messageName, {
|
||||
sendReport,
|
||||
comments,
|
||||
email,
|
||||
emailMe,
|
||||
includeURL,
|
||||
URL,
|
||||
autoSubmit,
|
||||
|
@ -56,14 +56,6 @@
|
||||
<span data-l10n-id="crashed-include-URL-2"></span>
|
||||
</label>
|
||||
</li>
|
||||
|
||||
<li id="requestEmail" hidden="true">
|
||||
<label class="toggle-container-with-text">
|
||||
<input type="checkbox" id="emailMe" role="checkbox"/>
|
||||
<span data-l10n-id="crashed-email-me"></span>
|
||||
</label>
|
||||
<input type="text" id="email" data-l10n-id="crashed-email-placeholder"/>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="requestAutoSubmit" hidden="true">
|
||||
|
@ -6,7 +6,6 @@ support-files =
|
||||
file_iframe.html
|
||||
|
||||
[browser_autoSubmitRequest.js]
|
||||
[browser_clearEmail.js]
|
||||
[browser_launchFail.js]
|
||||
[browser_multipleCrashedTabs.js]
|
||||
[browser_noPermanentKey.js]
|
||||
|
@ -1,71 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
const PAGE =
|
||||
"data:text/html,<html><body>A%20regular,%20everyday,%20normal%20page.";
|
||||
const EMAIL = "foo@privacy.com";
|
||||
|
||||
add_task(async function setup() {
|
||||
await setupLocalCrashReportServer();
|
||||
// By default, requesting the email address of the user is disabled.
|
||||
// For the purposes of this test, we turn it back on.
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.tabs.crashReporting.requestEmail", true]],
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Test that if we have an email address stored in prefs, and we decide
|
||||
* not to submit the email address in the next crash report, that we
|
||||
* clear the email address.
|
||||
*/
|
||||
add_task(async function test_clear_email() {
|
||||
return BrowserTestUtils.withNewTab(
|
||||
{
|
||||
gBrowser,
|
||||
url: PAGE,
|
||||
},
|
||||
async function(browser) {
|
||||
let prefs = TabCrashHandler.prefs;
|
||||
let originalSendReport = prefs.getBoolPref("sendReport");
|
||||
let originalEmailMe = prefs.getBoolPref("emailMe");
|
||||
let originalIncludeURL = prefs.getBoolPref("includeURL");
|
||||
let originalEmail = prefs.getCharPref("email");
|
||||
|
||||
// Pretend that we stored an email address from the previous
|
||||
// crash
|
||||
prefs.setCharPref("email", EMAIL);
|
||||
prefs.setBoolPref("emailMe", true);
|
||||
|
||||
let tab = gBrowser.getTabForBrowser(browser);
|
||||
await BrowserTestUtils.crashFrame(
|
||||
browser,
|
||||
/* shouldShowTabCrashPage */ true,
|
||||
/* shouldClearMinidumps */ false
|
||||
);
|
||||
let doc = browser.contentDocument;
|
||||
|
||||
// Since about:tabcrashed will run in the parent process, we can safely
|
||||
// manipulate its DOM nodes directly
|
||||
let emailMe = doc.getElementById("emailMe");
|
||||
emailMe.checked = false;
|
||||
|
||||
let crashReport = promiseCrashReport({
|
||||
Email: "",
|
||||
});
|
||||
|
||||
let restoreTab = browser.contentDocument.getElementById("restoreTab");
|
||||
restoreTab.click();
|
||||
await BrowserTestUtils.waitForEvent(tab, "SSTabRestored");
|
||||
await crashReport;
|
||||
|
||||
is(prefs.getCharPref("email"), "", "No email address should be stored");
|
||||
|
||||
// Submitting the crash report may have set some prefs regarding how to
|
||||
// send tab crash reports. Let's reset them for the next test.
|
||||
prefs.setBoolPref("sendReport", originalSendReport);
|
||||
prefs.setBoolPref("emailMe", originalEmailMe);
|
||||
prefs.setBoolPref("includeURL", originalIncludeURL);
|
||||
prefs.setCharPref("email", originalEmail);
|
||||
}
|
||||
);
|
||||
});
|
@ -3,7 +3,6 @@
|
||||
const PAGE =
|
||||
"data:text/html,<html><body>A%20regular,%20everyday,%20normal%20page.";
|
||||
const COMMENTS = "Here's my test comment!";
|
||||
const EMAIL = "foo@privacy.com";
|
||||
|
||||
// Avoid timeouts, as in bug 1325530
|
||||
requestLongerTimeout(2);
|
||||
@ -30,10 +29,6 @@ add_task(async function setup() {
|
||||
*
|
||||
* comments (String)
|
||||
* The comments to put in the comment textarea
|
||||
* email (String)
|
||||
* The email address to put in the email address input
|
||||
* emailMe (bool)
|
||||
* The checked value of the "Email me" checkbox
|
||||
* includeURL (bool)
|
||||
* The checked value of the "Include URL" checkbox
|
||||
*
|
||||
@ -53,9 +48,7 @@ function crashTabTestHelper(fieldValues, expectedExtra) {
|
||||
async function(browser) {
|
||||
let prefs = TabCrashHandler.prefs;
|
||||
let originalSendReport = prefs.getBoolPref("sendReport");
|
||||
let originalEmailMe = prefs.getBoolPref("emailMe");
|
||||
let originalIncludeURL = prefs.getBoolPref("includeURL");
|
||||
let originalEmail = prefs.getCharPref("email");
|
||||
|
||||
let tab = gBrowser.getTabForBrowser(browser);
|
||||
await BrowserTestUtils.crashFrame(browser);
|
||||
@ -64,22 +57,12 @@ function crashTabTestHelper(fieldValues, expectedExtra) {
|
||||
// Since about:tabcrashed will run in the parent process, we can safely
|
||||
// manipulate its DOM nodes directly
|
||||
let comments = doc.getElementById("comments");
|
||||
let email = doc.getElementById("email");
|
||||
let emailMe = doc.getElementById("emailMe");
|
||||
let includeURL = doc.getElementById("includeURL");
|
||||
|
||||
if (fieldValues.hasOwnProperty("comments")) {
|
||||
comments.value = fieldValues.comments;
|
||||
}
|
||||
|
||||
if (fieldValues.hasOwnProperty("email")) {
|
||||
email.value = fieldValues.email;
|
||||
}
|
||||
|
||||
if (fieldValues.hasOwnProperty("emailMe")) {
|
||||
emailMe.checked = fieldValues.emailMe;
|
||||
}
|
||||
|
||||
if (fieldValues.hasOwnProperty("includeURL")) {
|
||||
includeURL.checked = fieldValues.includeURL;
|
||||
}
|
||||
@ -93,17 +76,14 @@ function crashTabTestHelper(fieldValues, expectedExtra) {
|
||||
// Submitting the crash report may have set some prefs regarding how to
|
||||
// send tab crash reports. Let's reset them for the next test.
|
||||
prefs.setBoolPref("sendReport", originalSendReport);
|
||||
prefs.setBoolPref("emailMe", originalEmailMe);
|
||||
prefs.setBoolPref("includeURL", originalIncludeURL);
|
||||
prefs.setCharPref("email", originalEmail);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests what we send with the crash report by default. By default, we do not
|
||||
* send any comments, the URL of the crashing page, or the email address of
|
||||
* the user.
|
||||
* send any comments or the URL of the crashing page.
|
||||
*/
|
||||
add_task(async function test_default() {
|
||||
await crashTabTestHelper(
|
||||
@ -111,7 +91,6 @@ add_task(async function test_default() {
|
||||
{
|
||||
Comments: null,
|
||||
URL: "",
|
||||
Email: null,
|
||||
}
|
||||
);
|
||||
});
|
||||
@ -127,41 +106,6 @@ add_task(async function test_just_a_comment() {
|
||||
{
|
||||
Comments: COMMENTS,
|
||||
URL: "",
|
||||
Email: null,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Test that we don't send email if emailMe is unchecked
|
||||
*/
|
||||
add_task(async function test_no_email() {
|
||||
await crashTabTestHelper(
|
||||
{
|
||||
email: EMAIL,
|
||||
emailMe: false,
|
||||
},
|
||||
{
|
||||
Comments: null,
|
||||
URL: "",
|
||||
Email: null,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Test that we can send an email address if emailMe is checked
|
||||
*/
|
||||
add_task(async function test_yes_email() {
|
||||
await crashTabTestHelper(
|
||||
{
|
||||
email: EMAIL,
|
||||
emailMe: true,
|
||||
},
|
||||
{
|
||||
Comments: null,
|
||||
URL: "",
|
||||
Email: EMAIL,
|
||||
}
|
||||
);
|
||||
});
|
||||
@ -177,26 +121,22 @@ add_task(async function test_send_URL() {
|
||||
{
|
||||
Comments: null,
|
||||
URL: PAGE,
|
||||
Email: null,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Test that we can send comments, the email address, and the URL
|
||||
* Test that we can send comments and the URL
|
||||
*/
|
||||
add_task(async function test_send_all() {
|
||||
await crashTabTestHelper(
|
||||
{
|
||||
includeURL: true,
|
||||
emailMe: true,
|
||||
email: EMAIL,
|
||||
comments: COMMENTS,
|
||||
},
|
||||
{
|
||||
Comments: COMMENTS,
|
||||
URL: PAGE,
|
||||
Email: EMAIL,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
@ -17,8 +17,6 @@ crashed-send-report-2 = Send an automated crash report so we can fix issues like
|
||||
crashed-comment =
|
||||
.placeholder = Optional comments (comments are publicly visible)
|
||||
crashed-include-URL-2 = Include the URLs of the sites you were on when { -brand-short-name } crashed
|
||||
crashed-email-placeholder = Enter your email address here
|
||||
crashed-email-me = Email me when more information is available
|
||||
crashed-report-sent = Crash report already submitted; thank you for helping make { -brand-short-name } better!
|
||||
crashed-request-auto-submit-title = Report background tabs
|
||||
crashed-auto-submit-checkbox-2 = Update preferences to automatically submit reports when { -brand-short-name } crashes
|
||||
|
@ -612,11 +612,6 @@ var TabCrashHandler = {
|
||||
* URL (String)
|
||||
* The URL that the user was on in the crashed tab
|
||||
* before the crash occurred.
|
||||
* emailMe (bool):
|
||||
* Whether or not to include the user's email address
|
||||
* in the crash report.
|
||||
* email (String):
|
||||
* The email address of the user.
|
||||
* comments (String):
|
||||
* Any additional comments from the user.
|
||||
*
|
||||
@ -653,11 +648,10 @@ var TabCrashHandler = {
|
||||
return;
|
||||
}
|
||||
|
||||
let { includeURL, comments, email, emailMe, URL } = message.data;
|
||||
let { includeURL, comments, URL } = message.data;
|
||||
|
||||
let extraExtraKeyVals = {
|
||||
Comments: comments,
|
||||
Email: email,
|
||||
URL,
|
||||
};
|
||||
|
||||
@ -684,12 +678,6 @@ var TabCrashHandler = {
|
||||
|
||||
this.prefs.setBoolPref("sendReport", true);
|
||||
this.prefs.setBoolPref("includeURL", includeURL);
|
||||
this.prefs.setBoolPref("emailMe", emailMe);
|
||||
if (emailMe) {
|
||||
this.prefs.setCharPref("email", email);
|
||||
} else {
|
||||
this.prefs.setCharPref("email", "");
|
||||
}
|
||||
|
||||
this.childMap.set(childID, null); // Avoid resubmission.
|
||||
this.removeSubmitCheckboxesForSameCrash(childID);
|
||||
@ -758,24 +746,16 @@ var TabCrashHandler = {
|
||||
}
|
||||
|
||||
let requestAutoSubmit = !UnsubmittedCrashHandler.autoSubmit;
|
||||
let requestEmail = this.prefs.getBoolPref("requestEmail");
|
||||
let sendReport = this.prefs.getBoolPref("sendReport");
|
||||
let includeURL = this.prefs.getBoolPref("includeURL");
|
||||
let emailMe = this.prefs.getBoolPref("emailMe");
|
||||
|
||||
let data = {
|
||||
hasReport: true,
|
||||
sendReport,
|
||||
includeURL,
|
||||
emailMe,
|
||||
requestAutoSubmit,
|
||||
requestEmail,
|
||||
};
|
||||
|
||||
if (emailMe) {
|
||||
data.email = this.prefs.getCharPref("email");
|
||||
}
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user