diff --git a/browser/app/blocklist.xml b/browser/app/blocklist.xml index e4321ecf1fe..d5557d191ef 100644 --- a/browser/app/blocklist.xml +++ b/browser/app/blocklist.xml @@ -1,5 +1,5 @@ - + @@ -588,42 +588,42 @@ - + - + - + - + - + - + diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 0a49b425fe1..90086d01931 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -865,6 +865,10 @@ pref("breakpad.reportURL", "http://crash-stats.mozilla.com/report/index/"); pref("toolkit.crashreporter.pluginHangSubmitURL", "https://hang-reports.mozilla.org/submit"); +// URL for "Learn More" for Crash Reporter +pref("toolkit.crashreporter.infoURL", + "http://www.mozilla.com/legal/privacy/firefox.html#crash-reporter"); + // base URL for web-based support pages pref("app.support.baseURL", "http://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/"); diff --git a/browser/base/content/abouthealthreport/abouthealth.css b/browser/base/content/abouthealthreport/abouthealth.css new file mode 100644 index 00000000000..6a9a8fa03bc --- /dev/null +++ b/browser/base/content/abouthealthreport/abouthealth.css @@ -0,0 +1,140 @@ +* { + margin: 0; + padding: 0; +} + +html, body { + height: 100%; +} + +body { + background-color: window; + color: windowtext; + font-family: "Trebuchet MS", "Helvetica"; +} + +#about-header { + padding: 6px 20px; + min-height: 60px; + border-bottom: 1px solid #999999; + margin-bottom: 12px; + display: flex; + align-items: center; + justify-content: space-between; + background-image: linear-gradient(to bottom, #E66000, #BB2200); + color: #FFFFFF; +} + +#control-container { + display: flex; + align-items: center; +} + +#content-line { + display: flex; + justify-content: space-between; + align-items: center; +} + +#content { + display: flex; + flex-direction: column; +} + +#state-intro { + background-image: linear-gradient(to bottom, #EAEFF2, #D4DDE4); + border: 1px solid #999999; + border-radius: 6px; + margin: 12px; + padding: 12px; +} + +#settings-controls { + padding-top: 15px; +} + +#control-container { + padding-top: 15px; +} + +#content[state="default"] #details-hide, +#content[state="default"] #btn-optin, +#content[state="default"] #intro-disabled { + display: none; +} + +#content[state="showDetails"] #details-show, +#content[state="showDetails"] #btn-optin, +#content[state="showDetails"] #intro-disabled { + display: none; +} + +#content[state="showReport"] #details-hide, +#content[state="showReport"] #report-show, +#content[state="showReport"] #btn-optin, +#content[state="showReport"] #intro-disabled { + display: none; +} + +#content[state="disabled"] #details-hide, +#content[state="disabled"] #details-show, +#content[state="disabled"] #btn-optout, +#content[state="disabled"] #intro-enabled { + display: none; +} + +#details-view, +#report-view { + display: none; +} + +#data-view { + height: auto; + margin-top: 8px; + align-items: center; + justify-content: center; + border: 1px solid #999999; + border-radius: 6px; + margin: 12px; +} + +#remote-report, +#report-view { + width: 100%; + height: 100%; + min-height: 600px; +} + +#report-show { + display: flex; + width: 100%; + height: 100%; + min-height: 60px; + font-size: 18px; + font-weight: bold; + background-image: linear-gradient(to bottom, #80BB2E, #547D1C); + color: #ffffff; + border-radius: 6px; +} + +#details-view { + border: 1px solid #999999; + border-radius: 6px; + margin: 12px; + padding: 12px; +} + +#content[state="showDetails"], +#content[state="showReport"], +#content[state="showDetails"] #details-view, +#content[state="showReport"] #report-view { + display: block; +} + +#content[state="showReport"] #report-show { + display: none; +} +#content[state="showReport"] #report-view, +#remote-report { + border: 0; +} diff --git a/browser/base/content/abouthealthreport/abouthealth.js b/browser/base/content/abouthealthreport/abouthealth.js new file mode 100644 index 00000000000..7aaffd6f5e5 --- /dev/null +++ b/browser/base/content/abouthealthreport/abouthealth.js @@ -0,0 +1,117 @@ +/* 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/. */ + +"use strict"; + +const {classes: Cc, interfaces: Ci, utils: Cu} = Components; + +Cu.import("resource://services-common/preferences.js"); + +const reporter = Cc["@mozilla.org/datareporting/service;1"] + .getService(Ci.nsISupports) + .wrappedJSObject + .healthReporter; + +const policy = Cc["@mozilla.org/datareporting/service;1"] + .getService(Ci.nsISupports) + .wrappedJSObject.policy; + +const prefs = new Preferences("datareporting.healthreport.about."); + +function getLocale() { + return Cc["@mozilla.org/chrome/chrome-registry;1"] + .getService(Ci.nsIXULChromeRegistry) + .getSelectedLocale("global"); +} + +function init() { + refreshWithDataSubmissionFlag(reporter.willUploadData); + refreshJSONPayload(); + document.getElementById("details-link").href = prefs.get("glossaryUrl"); +} + +/** + * Update the state of the page to reflect the current data submission state. + * + * @param enabled + * (bool) Whether data submission is enabled. + */ +function refreshWithDataSubmissionFlag(enabled) { + if (!enabled) + updateView("disabled"); + else + updateView("default"); +} + +function updateView(state="default") { + let content = document.getElementById("content"); + let controlContainer = document.getElementById("control-container"); + content.setAttribute("state", state); + controlContainer.setAttribute("state", state); +} + +function refreshDataView(data) { + let noData = document.getElementById("data-no-data"); + let dataEl = document.getElementById("raw-data"); + + noData.style.display = data ? "none" : "inline"; + dataEl.style.display = data ? "block" : "none"; + if (data) + dataEl.innerHTML = JSON.stringify(data, null, 2); +} + +/** + * Ensure the page has the latest version of the uploaded JSON payload. + */ +function refreshJSONPayload() { + reporter.getLastPayload().then(refreshDataView); +} + +function onOptInClick() { + policy.healthReportUploadEnable = true; + refreshWithDataSubmissionFlag(true); +} + +function onOptOutClick() { + let prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"] + .getService(Ci.nsIPromptService); + + let messages = document.getElementById("optout-confirmationPrompt"); + let title = messages.getAttribute("confirmationPrompt_title"); + let message = messages.getAttribute("confirmationPrompt_message"); + + if (!prompts.confirm(window, title, message)) { + return; + } + + policy.healthReportUploadEnable = false; + let promise = reporter.requestDeleteRemoteData("Clicked opt out button on about page."); + if (promise) { + promise.then(function onDelete() { + refreshWithDataSubmissionFlag(reporter.willUploadData); + }); + } + + refreshWithDataSubmissionFlag(false); + updateView("disabled"); +} + +function onShowRawDataClick() { + updateView("showDetails"); + refreshJSONPayload(); +} + +function onHideRawDataClick() { + updateView("default"); +} + +function onShowReportClick() { + updateView("showReport"); + document.getElementById("remote-report").src = prefs.get("reportUrl"); +} + +function onHideReportClick() { + updateView("default"); + document.getElementById("remote-report").src = ""; +} \ No newline at end of file diff --git a/browser/base/content/abouthealthreport/abouthealth.xhtml b/browser/base/content/abouthealthreport/abouthealth.xhtml new file mode 100644 index 00000000000..4a98cf9f32f --- /dev/null +++ b/browser/base/content/abouthealthreport/abouthealth.xhtml @@ -0,0 +1,71 @@ + + + + %htmlDTD; + + %brandDTD; + + %securityPrefsDTD; + + %aboutHealthReportDTD; +]> + + + + &abouthealth.pagetitle; + +