From 5909cef47a4aaf458e41e0d2a46b88972b934dff Mon Sep 17 00:00:00 2001 From: trav90 Date: Sat, 12 May 2018 08:17:44 -0500 Subject: Make safebrowsing optional at build time - Part 1: browser/ --- browser/components/about/AboutRedirector.cpp | 2 ++ browser/components/build/nsModule.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'browser/components') diff --git a/browser/components/about/AboutRedirector.cpp b/browser/components/about/AboutRedirector.cpp index 717ae9c48..8ddf19510 100644 --- a/browser/components/about/AboutRedirector.cpp +++ b/browser/components/about/AboutRedirector.cpp @@ -41,12 +41,14 @@ static RedirEntry kRedirMap[] = { nsIAboutModule::HIDE_FROM_ABOUTABOUT }, { +#ifdef MOZ_SAFE_BROWSING "blocked", "chrome://browser/content/blockedSite.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT }, +#endif { "certerror", "chrome://browser/content/aboutNetError.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | diff --git a/browser/components/build/nsModule.cpp b/browser/components/build/nsModule.cpp index 1fad0ce68..967da3ebc 100644 --- a/browser/components/build/nsModule.cpp +++ b/browser/components/build/nsModule.cpp @@ -86,7 +86,9 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = { #endif { NS_FEEDSNIFFER_CONTRACTID, &kNS_FEEDSNIFFER_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "basilisk", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, +#ifdef MOZ_SAFE_BROWSING { NS_ABOUT_MODULE_CONTRACTID_PREFIX "blocked", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, +#endif { NS_ABOUT_MODULE_CONTRACTID_PREFIX "certerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "socialerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "providerdirectory", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, -- cgit v1.2.3 From 4e1d60e7db4462d3d79c48718758cdba84fc0505 Mon Sep 17 00:00:00 2001 From: trav90 Date: Sat, 12 May 2018 08:20:17 -0500 Subject: Fix build bustage --- browser/components/about/AboutRedirector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'browser/components') diff --git a/browser/components/about/AboutRedirector.cpp b/browser/components/about/AboutRedirector.cpp index 8ddf19510..5e8df6ab2 100644 --- a/browser/components/about/AboutRedirector.cpp +++ b/browser/components/about/AboutRedirector.cpp @@ -40,8 +40,8 @@ static RedirEntry kRedirMap[] = { nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::HIDE_FROM_ABOUTABOUT }, - { #ifdef MOZ_SAFE_BROWSING + { "blocked", "chrome://browser/content/blockedSite.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::URI_CAN_LOAD_IN_CHILD | -- cgit v1.2.3 From 41d68e3f70b0aabc01cf9a49c43cf1aab0f4bdce Mon Sep 17 00:00:00 2001 From: trav90 Date: Sat, 12 May 2018 08:32:13 -0500 Subject: Make safebrowsing optional at build time - Part 5: preferences --- browser/components/preferences/blocklists.js | 2 ++ browser/components/preferences/in-content/security.js | 16 ++++------------ browser/components/preferences/in-content/security.xul | 18 ++++++++++-------- 3 files changed, 16 insertions(+), 20 deletions(-) (limited to 'browser/components') diff --git a/browser/components/preferences/blocklists.js b/browser/components/preferences/blocklists.js index bc39eb6bd..c0ce5b656 100644 --- a/browser/components/preferences/blocklists.js +++ b/browser/components/preferences/blocklists.js @@ -6,9 +6,11 @@ Components.utils.import("resource://gre/modules/Services.jsm"); const BASE_LIST_ID = "base"; const CONTENT_LIST_ID = "content"; const TRACK_SUFFIX = "-track-digest256"; +#ifdef MOZ_SAFE_BROWSING const TRACKING_TABLE_PREF = "urlclassifier.trackingTable"; const LISTS_PREF_BRANCH = "browser.safebrowsing.provider.mozilla.lists."; const UPDATE_TIME_PREF = "browser.safebrowsing.provider.mozilla.nextupdatetime"; +#endif var gBlocklistManager = { _type: "", diff --git a/browser/components/preferences/in-content/security.js b/browser/components/preferences/in-content/security.js index 0d7af39a3..37a187f9c 100644 --- a/browser/components/preferences/in-content/security.js +++ b/browser/components/preferences/in-content/security.js @@ -23,7 +23,9 @@ var gSecurityPane = { this._pane = document.getElementById("paneSecurity"); this._initMasterPasswordUI(); +#ifdef MOZ_SAFE_BROWSING this._initSafeBrowsing(); +#endif setEventListener("addonExceptions", "command", gSecurityPane.showAddonExceptions); @@ -160,6 +162,7 @@ var gSecurityPane = { checkbox.checked = !noMP; }, +#ifdef MOZ_SAFE_BROWSING _initSafeBrowsing() { let enableSafeBrowsing = document.getElementById("enableSafeBrowsing"); let blockDownloads = document.getElementById("blockDownloads"); @@ -168,24 +171,12 @@ var gSecurityPane = { let safeBrowsingPhishingPref = document.getElementById("browser.safebrowsing.phishing.enabled"); let safeBrowsingMalwarePref = document.getElementById("browser.safebrowsing.malware.enabled"); - let safeBrowsingUIPref = document.getElementById("browser.safebrowsing.UI.enabled"); - let safeBrowsingUISep = document.getElementById("safeBrowsingUISep"); - let safeBrowsingUIGroup = document.getElementById("safeBrowsingUIGroup"); - let blockDownloadsPref = document.getElementById("browser.safebrowsing.downloads.enabled"); let malwareTable = document.getElementById("urlclassifier.malwareTable"); let blockUnwantedPref = document.getElementById("browser.safebrowsing.downloads.remote.block_potentially_unwanted"); let blockUncommonPref = document.getElementById("browser.safebrowsing.downloads.remote.block_uncommon"); - if (safeBrowsingUIPref.value == false) { - safeBrowsingUISep.setAttribute("hidden", "true"); - safeBrowsingUIGroup.setAttribute("hidden", "true"); - } else { - safeBrowsingUISep.removeAttribute("hidden"); - safeBrowsingUIGroup.removeAttribute("hidden"); - } - enableSafeBrowsing.addEventListener("command", function() { safeBrowsingPhishingPref.value = enableSafeBrowsing.checked; safeBrowsingMalwarePref.value = enableSafeBrowsing.checked; @@ -244,6 +235,7 @@ var gSecurityPane = { blockUncommonUnwanted.checked = blockUnwantedPref.value && blockUncommonPref.value; }, +#endif /** * Enables/disables the master password button depending on the state of the diff --git a/browser/components/preferences/in-content/security.xul b/browser/components/preferences/in-content/security.xul index 5dc8ad5e9..33e1471bd 100644 --- a/browser/components/preferences/in-content/security.xul +++ b/browser/components/preferences/in-content/security.xul @@ -16,11 +16,13 @@ name="pref.privacy.disable_button.view_passwords_exceptions" type="bool"/> - + +#ifdef MOZ_SAFE_BROWSING + @@ -28,10 +30,6 @@ name="browser.safebrowsing.phishing.enabled" type="bool"/> - - @@ -46,6 +44,7 @@ +#endif @@ -61,7 +60,7 @@ - + -- cgit v1.2.3 From 79edb388a3ce6facbb11de51eeade667dae0d995 Mon Sep 17 00:00:00 2001 From: trav90 Date: Mon, 14 May 2018 08:22:11 -0500 Subject: Include in-content preferences file security.js in pre-processing --- browser/components/preferences/in-content/jar.mn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'browser/components') diff --git a/browser/components/preferences/in-content/jar.mn b/browser/components/preferences/in-content/jar.mn index 3497ff555..130bf8549 100644 --- a/browser/components/preferences/in-content/jar.mn +++ b/browser/components/preferences/in-content/jar.mn @@ -14,5 +14,5 @@ browser.jar: content/browser/preferences/in-content/applications.js * content/browser/preferences/in-content/content.js content/browser/preferences/in-content/sync.js - content/browser/preferences/in-content/security.js +* content/browser/preferences/in-content/security.js content/browser/preferences/in-content/search.js -- cgit v1.2.3