From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../content/aboutPrivateBrowsing.css | 10 + .../content/aboutPrivateBrowsing.js | 98 +++++++ .../content/aboutPrivateBrowsing.xhtml | 85 ++++++ browser/components/privatebrowsing/jar.mn | 8 + browser/components/privatebrowsing/moz.build | 14 + .../privatebrowsing/test/browser/.eslintrc.js | 7 + .../privatebrowsing/test/browser/browser.ini | 54 ++++ ...owser_privatebrowsing_DownloadLastDirWithCPS.js | 282 ++++++++++++++++++++ .../test/browser/browser_privatebrowsing_about.js | 115 ++++++++ ...vatebrowsing_aboutHomeButtonAfterWindowClose.js | 24 ++ .../browser_privatebrowsing_aboutSessionRestore.js | 23 ++ .../browser/browser_privatebrowsing_blobUrl.js | 45 ++++ .../test/browser/browser_privatebrowsing_cache.js | 138 ++++++++++ .../browser_privatebrowsing_certexceptionsui.js | 53 ++++ .../browser/browser_privatebrowsing_concurrent.js | 88 +++++++ .../browser_privatebrowsing_concurrent_page.html | 33 +++ ...wser_privatebrowsing_context_and_chromeFlags.js | 60 +++++ .../test/browser/browser_privatebrowsing_crh.js | 42 +++ .../browser_privatebrowsing_downloadLastDir.js | 93 +++++++ .../browser_privatebrowsing_downloadLastDir_c.js | 95 +++++++ ...owser_privatebrowsing_downloadLastDir_toggle.js | 105 ++++++++ .../browser/browser_privatebrowsing_favicon.js | 293 +++++++++++++++++++++ .../browser/browser_privatebrowsing_geoprompt.js | 54 ++++ .../browser_privatebrowsing_geoprompt_page.html | 13 + .../browser_privatebrowsing_lastpbcontextexited.js | 49 ++++ .../browser_privatebrowsing_localStorage.js | 25 ++ ...er_privatebrowsing_localStorage_before_after.js | 36 +++ ...atebrowsing_localStorage_before_after_page.html | 11 + ...tebrowsing_localStorage_before_after_page2.html | 10 + ...browser_privatebrowsing_localStorage_page1.html | 10 + ...browser_privatebrowsing_localStorage_page2.html | 10 + .../browser_privatebrowsing_newtab_from_popup.js | 61 +++++ ...r_privatebrowsing_noSessionRestoreMenuOption.js | 23 ++ .../browser/browser_privatebrowsing_nonbrowser.js | 19 ++ .../browser/browser_privatebrowsing_opendir.js | 133 ++++++++++ ...rowser_privatebrowsing_placesTitleNoUpdate.html | 8 + .../browser_privatebrowsing_placesTitleNoUpdate.js | 72 +++++ .../browser/browser_privatebrowsing_placestitle.js | 95 +++++++ .../browser_privatebrowsing_popupblocker.js | 70 +++++ .../browser_privatebrowsing_protocolhandler.js | 47 ++++ ...owser_privatebrowsing_protocolhandler_page.html | 13 + .../browser/browser_privatebrowsing_sidebar.js | 92 +++++++ .../browser/browser_privatebrowsing_theming.js | 38 +++ .../test/browser/browser_privatebrowsing_ui.js | 82 ++++++ .../browser/browser_privatebrowsing_urlbarfocus.js | 43 +++ .../browser/browser_privatebrowsing_windowtitle.js | 77 ++++++ .../browser_privatebrowsing_windowtitle_page.html | 9 + .../test/browser/browser_privatebrowsing_zoom.js | 37 +++ .../browser/browser_privatebrowsing_zoomrestore.js | 64 +++++ .../privatebrowsing/test/browser/empty_file.html | 1 + .../privatebrowsing/test/browser/file_favicon.html | 11 + .../privatebrowsing/test/browser/file_favicon.png | Bin 0 -> 344 bytes .../test/browser/file_favicon.png^headers^ | 1 + .../privatebrowsing/test/browser/head.js | 63 +++++ .../privatebrowsing/test/browser/popup.html | 12 + .../privatebrowsing/test/browser/title.sjs | 22 ++ 56 files changed, 3076 insertions(+) create mode 100644 browser/components/privatebrowsing/content/aboutPrivateBrowsing.css create mode 100644 browser/components/privatebrowsing/content/aboutPrivateBrowsing.js create mode 100644 browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml create mode 100644 browser/components/privatebrowsing/jar.mn create mode 100644 browser/components/privatebrowsing/moz.build create mode 100644 browser/components/privatebrowsing/test/browser/.eslintrc.js create mode 100644 browser/components/privatebrowsing/test/browser/browser.ini create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_DownloadLastDirWithCPS.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutHomeButtonAfterWindowClose.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutSessionRestore.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_blobUrl.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_certexceptionsui.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_concurrent.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_concurrent_page.html create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_context_and_chromeFlags.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_crh.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir_c.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir_toggle.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_favicon.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt_page.html create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_lastpbcontextexited.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage_before_after.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage_before_after_page.html create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage_before_after_page2.html create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage_page1.html create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage_page2.html create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_newtab_from_popup.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_noSessionRestoreMenuOption.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_nonbrowser.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_opendir.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.html create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_popupblocker.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_protocolhandler.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_protocolhandler_page.html create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_sidebar.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_theming.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_ui.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_urlbarfocus.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle_page.html create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoomrestore.js create mode 100644 browser/components/privatebrowsing/test/browser/empty_file.html create mode 100644 browser/components/privatebrowsing/test/browser/file_favicon.html create mode 100644 browser/components/privatebrowsing/test/browser/file_favicon.png create mode 100644 browser/components/privatebrowsing/test/browser/file_favicon.png^headers^ create mode 100644 browser/components/privatebrowsing/test/browser/head.js create mode 100644 browser/components/privatebrowsing/test/browser/popup.html create mode 100644 browser/components/privatebrowsing/test/browser/title.sjs (limited to 'browser/components/privatebrowsing') diff --git a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.css b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.css new file mode 100644 index 000000000..29d7a843d --- /dev/null +++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.css @@ -0,0 +1,10 @@ +html.private .showNormal, +html.normal .showPrivate, +body[tpEnabled] .showTpDisabled, +body:not([tpEnabled]) .showTpEnabled { + display: none !important; +} + +.hide { + display: none; +} diff --git a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js new file mode 100644 index 000000000..31ce96347 --- /dev/null +++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js @@ -0,0 +1,98 @@ +/* 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/. */ + +var {classes: Cc, interfaces: Ci, utils: Cu} = Components; + +Cu.import("resource://gre/modules/Services.jsm"); +Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); + +const FAVICON_QUESTION = "chrome://global/skin/icons/question-32.png"; +const FAVICON_PRIVACY = "chrome://browser/skin/privatebrowsing/favicon.svg"; + +var stringBundle = Services.strings.createBundle( + "chrome://browser/locale/aboutPrivateBrowsing.properties"); + +var prefBranch = Services.prefs.getBranch("privacy.trackingprotection."); +var prefObserver = { + QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, + Ci.nsISupportsWeakReference]), + observe: function () { + let tpSubHeader = document.getElementById("tpSubHeader"); + let tpToggle = document.getElementById("tpToggle"); + let tpButton = document.getElementById("tpButton"); + let title = document.getElementById("title"); + let titleTracking = document.getElementById("titleTracking"); + let globalTrackingEnabled = prefBranch.getBoolPref("enabled"); + let trackingEnabled = globalTrackingEnabled || + prefBranch.getBoolPref("pbmode.enabled"); + + tpButton.classList.toggle("hide", globalTrackingEnabled); + tpToggle.checked = trackingEnabled; + title.classList.toggle("hide", trackingEnabled); + titleTracking.classList.toggle("hide", !trackingEnabled); + tpSubHeader.classList.toggle("tp-off", !trackingEnabled); + } +}; +prefBranch.addObserver("pbmode.enabled", prefObserver, true); +prefBranch.addObserver("enabled", prefObserver, true); + +function setFavIcon(url) { + document.getElementById("favicon").setAttribute("href", url); +} + +document.addEventListener("DOMContentLoaded", function () { + if (!PrivateBrowsingUtils.isContentWindowPrivate(window)) { + document.documentElement.classList.remove("private"); + document.documentElement.classList.add("normal"); + document.title = stringBundle.GetStringFromName("title.normal"); + document.getElementById("favicon") + .setAttribute("href", FAVICON_QUESTION); + document.getElementById("startPrivateBrowsing") + .addEventListener("command", openPrivateWindow); + return; + } + + let tpToggle = document.getElementById("tpToggle"); + document.getElementById("tpButton").addEventListener('click', () => { + tpToggle.click(); + }); + + document.title = stringBundle.GetStringFromName("title.head"); + document.getElementById("favicon") + .setAttribute("href", FAVICON_PRIVACY); + tpToggle.addEventListener("change", toggleTrackingProtection); + document.getElementById("startTour") + .addEventListener("click", dontShowIntroPanelAgain); + + let formatURLPref = Cc["@mozilla.org/toolkit/URLFormatterService;1"] + .getService(Ci.nsIURLFormatter).formatURLPref; + document.getElementById("startTour").setAttribute("href", + formatURLPref("privacy.trackingprotection.introURL")); + document.getElementById("learnMore").setAttribute("href", + formatURLPref("app.support.baseURL") + "private-browsing"); + + // Update state that depends on preferences. + prefObserver.observe(); +}, false); + +function openPrivateWindow() { + // Ask chrome to open a private window + document.dispatchEvent( + new CustomEvent("AboutPrivateBrowsingOpenWindow", {bubbles:true})); +} + +function toggleTrackingProtection() { + // Ask chrome to enable tracking protection + document.dispatchEvent( + new CustomEvent("AboutPrivateBrowsingToggleTrackingProtection", + {bubbles: true})); +} + +function dontShowIntroPanelAgain() { + // Ask chrome to disable the doorhanger + document.dispatchEvent( + new CustomEvent("AboutPrivateBrowsingDontShowIntroPanelAgain", + {bubbles: true})); +} diff --git a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml new file mode 100644 index 000000000..fb5c4ac8e --- /dev/null +++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml @@ -0,0 +1,85 @@ + + + + %htmlDTD; + + %globalDTD; + + %brandDTD; + + %browserDTD; + + %aboutPrivateBrowsingDTD; +]> + + + + + + + + + + +

&aboutPrivateBrowsing.notPrivate;

+