diff --git a/basilisk/app/profile/basilisk.js b/basilisk/app/profile/basilisk.js index e4ab23b60..0ca123f4f 100644 --- a/basilisk/app/profile/basilisk.js +++ b/basilisk/app/profile/basilisk.js @@ -943,10 +943,6 @@ pref("services.sync.prefs.sync.browser.link.open_newwindow", true); pref("services.sync.prefs.sync.browser.newtabpage.enabled", true); pref("services.sync.prefs.sync.browser.newtabpage.pinned", true); pref("services.sync.prefs.sync.browser.offline-apps.notify", true); -#ifdef MOZ_SAFE_BROWSING -pref("services.sync.prefs.sync.browser.safebrowsing.phishing.enabled", true); -pref("services.sync.prefs.sync.browser.safebrowsing.malware.enabled", true); -#endif pref("services.sync.prefs.sync.browser.search.update", true); pref("services.sync.prefs.sync.browser.sessionstore.restore_on_demand", true); pref("services.sync.prefs.sync.browser.startup.homepage", true); @@ -991,8 +987,6 @@ pref("services.sync.prefs.sync.privacy.clearOnShutdown.sessions", true); pref("services.sync.prefs.sync.privacy.clearOnShutdown.siteSettings", true); pref("services.sync.prefs.sync.privacy.donottrackheader.enabled", true); pref("services.sync.prefs.sync.privacy.sanitize.sanitizeOnShutdown", true); -pref("services.sync.prefs.sync.privacy.trackingprotection.enabled", true); -pref("services.sync.prefs.sync.privacy.trackingprotection.pbmode.enabled", true); pref("services.sync.prefs.sync.security.OCSP.enabled", true); pref("services.sync.prefs.sync.security.OCSP.require", true); pref("services.sync.prefs.sync.security.default_personal_cert", true); @@ -1204,12 +1198,6 @@ pref("browser.cache.frecency_experiment", -1); // Enable GMP support in the addon manager. pref("media.gmp-provider.enabled", true); -#ifdef NIGHTLY_BUILD -pref("privacy.trackingprotection.ui.enabled", true); -#else -pref("privacy.trackingprotection.ui.enabled", false); -#endif - #ifndef RELEASE_OR_BETA // At the moment, autostart.2 is used, while autostart.1 is unused. // We leave it here set to false to reset users' defaults and allow diff --git a/basilisk/base/content/blockedSite.xhtml b/basilisk/base/content/blockedSite.xhtml deleted file mode 100644 index 10a4b33e8..000000000 --- a/basilisk/base/content/blockedSite.xhtml +++ /dev/null @@ -1,196 +0,0 @@ - - - - %htmlDTD; - - %globalDTD; - - %brandDTD; - - %blockedSiteDTD; -]> - - - - - - - - - - - - -
- - -
-

&safeb.blocked.phishingPage.title2;

-

&safeb.blocked.malwarePage.title;

-

&safeb.blocked.unwantedPage.title;

-
- -
- - -
-

&safeb.blocked.phishingPage.shortDesc2;

-

&safeb.blocked.malwarePage.shortDesc;

-

&safeb.blocked.unwantedPage.shortDesc;

-
- - -
-

&safeb.blocked.phishingPage.longDesc2;

-

&safeb.blocked.malwarePage.longDesc;

-

&safeb.blocked.unwantedPage.longDesc;

-
- - -
- - -
- -
-
-
- -
-
- - - - diff --git a/basilisk/base/content/browser-doctype.inc b/basilisk/base/content/browser-doctype.inc index 30d70ccea..14f5f80bd 100644 --- a/basilisk/base/content/browser-doctype.inc +++ b/basilisk/base/content/browser-doctype.inc @@ -13,10 +13,6 @@ %customizeToolbarDTD; %placesDTD; -#ifdef MOZ_SAFE_BROWSING - -%safebrowsingDTD; -#endif %aboutHomeDTD; #ifdef MOZ_SERVICES_SYNC diff --git a/basilisk/base/content/browser-safebrowsing.js b/basilisk/base/content/browser-safebrowsing.js deleted file mode 100644 index 430d84f13..000000000 --- a/basilisk/base/content/browser-safebrowsing.js +++ /dev/null @@ -1,48 +0,0 @@ -/* 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 gSafeBrowsing = { - - setReportPhishingMenu: function() { - // In order to detect whether or not we're at the phishing warning - // page, we have to check the documentURI instead of the currentURI. - // This is because when the DocShell loads an error page, the - // currentURI stays at the original target, while the documentURI - // will point to the internal error page we loaded instead. - var docURI = gBrowser.selectedBrowser.documentURI; - var isPhishingPage = - docURI && docURI.spec.startsWith("about:blocked?e=deceptiveBlocked"); - - // Show/hide the appropriate menu item. - document.getElementById("menu_HelpPopup_reportPhishingtoolmenu") - .hidden = isPhishingPage; - document.getElementById("menu_HelpPopup_reportPhishingErrortoolmenu") - .hidden = !isPhishingPage; - - var broadcasterId = isPhishingPage - ? "reportPhishingErrorBroadcaster" - : "reportPhishingBroadcaster"; - - var broadcaster = document.getElementById(broadcasterId); - if (!broadcaster) - return; - - // Now look at the currentURI to learn which page we were trying - // to browse to. - let uri = gBrowser.currentURI; - if (uri && (uri.schemeIs("http") || uri.schemeIs("https"))) - broadcaster.removeAttribute("disabled"); - else - broadcaster.setAttribute("disabled", true); - }, - - /** - * Used to report a phishing page or a false positive - * @param name String One of "Phish", "Error", "Malware" or "MalwareError" - * @return String the report phishing URL. - */ - getReportURL: function(name) { - return SafeBrowsing.getReportURL(name, gBrowser.currentURI); - } -} diff --git a/basilisk/base/content/browser-trackingprotection.js b/basilisk/base/content/browser-trackingprotection.js deleted file mode 100644 index 17b1e4f98..000000000 --- a/basilisk/base/content/browser-trackingprotection.js +++ /dev/null @@ -1,130 +0,0 @@ -/* 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 TrackingProtection = { - // If the user ignores the doorhanger, we stop showing it after some time. - PREF_ENABLED_GLOBALLY: "privacy.trackingprotection.enabled", - PREF_ENABLED_IN_PRIVATE_WINDOWS: "privacy.trackingprotection.pbmode.enabled", - enabledGlobally: false, - enabledInPrivateWindows: false, - container: null, - content: null, - icon: null, - activeTooltipText: null, - disabledTooltipText: null, - - init() { - let $ = selector => document.querySelector(selector); - this.container = $("#tracking-protection-container"); - this.content = $("#tracking-protection-content"); - this.icon = $("#tracking-protection-icon"); - - this.updateEnabled(); - Services.prefs.addObserver(this.PREF_ENABLED_GLOBALLY, this, false); - Services.prefs.addObserver(this.PREF_ENABLED_IN_PRIVATE_WINDOWS, this, false); - - this.activeTooltipText = - gNavigatorBundle.getString("trackingProtection.icon.activeTooltip"); - this.disabledTooltipText = - gNavigatorBundle.getString("trackingProtection.icon.disabledTooltip"); - }, - - uninit() { - Services.prefs.removeObserver(this.PREF_ENABLED_GLOBALLY, this); - Services.prefs.removeObserver(this.PREF_ENABLED_IN_PRIVATE_WINDOWS, this); - }, - - observe() { - this.updateEnabled(); - }, - - get enabled() { - return this.enabledGlobally || - (this.enabledInPrivateWindows && - PrivateBrowsingUtils.isWindowPrivate(window)); - }, - - updateEnabled() { - this.enabledGlobally = - Services.prefs.getBoolPref(this.PREF_ENABLED_GLOBALLY); - this.enabledInPrivateWindows = - Services.prefs.getBoolPref(this.PREF_ENABLED_IN_PRIVATE_WINDOWS); - this.container.hidden = !this.enabled; - }, - - onSecurityChange(state, isSimulated) { - if (!this.enabled) { - return; - } - - // Only animate the shield if the event was not fired directly from - // the tabbrowser (due to a browser change). - if (isSimulated) { - this.icon.removeAttribute("animate"); - } else { - this.icon.setAttribute("animate", "true"); - } - - let isBlocking = state & Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT; - let isAllowing = state & Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT; - - if (isBlocking) { - this.icon.setAttribute("tooltiptext", this.activeTooltipText); - this.icon.setAttribute("state", "blocked-tracking-content"); - this.content.setAttribute("state", "blocked-tracking-content"); - } else if (isAllowing) { - this.icon.setAttribute("tooltiptext", this.disabledTooltipText); - this.icon.setAttribute("state", "loaded-tracking-content"); - this.content.setAttribute("state", "loaded-tracking-content"); - } else { - this.icon.removeAttribute("tooltiptext"); - this.icon.removeAttribute("state"); - this.content.removeAttribute("state"); - } - }, - - disableForCurrentPage() { - // Convert document URI into the format used by - // nsChannelClassifier::ShouldEnableTrackingProtection. - // Any scheme turned into https is correct. - let normalizedUrl = Services.io.newURI( - "https://" + gBrowser.selectedBrowser.currentURI.hostPort, - null, null); - - // Add the current host in the 'trackingprotection' consumer of - // the permission manager using a normalized URI. This effectively - // places this host on the tracking protection allowlist. - if (PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser)) { - PrivateBrowsingUtils.addToTrackingAllowlist(normalizedUrl); - } else { - Services.perms.add(normalizedUrl, - "trackingprotection", Services.perms.ALLOW_ACTION); - } - - // Hide the control center. - document.getElementById("identity-popup").hidePopup(); - - BrowserReload(); - }, - - enableForCurrentPage() { - // Remove the current host from the 'trackingprotection' consumer - // of the permission manager. This effectively removes this host - // from the tracking protection allowlist. - let normalizedUrl = Services.io.newURI( - "https://" + gBrowser.selectedBrowser.currentURI.hostPort, - null, null); - - if (PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser)) { - PrivateBrowsingUtils.removeFromTrackingAllowlist(normalizedUrl); - } else { - Services.perms.remove(normalizedUrl, "trackingprotection"); - } - - // Hide the control center. - document.getElementById("identity-popup").hidePopup(); - - BrowserReload(); - }, -}; diff --git a/basilisk/base/content/browser.js b/basilisk/base/content/browser.js index 1756748df..61bba23e6 100644 --- a/basilisk/base/content/browser.js +++ b/basilisk/base/content/browser.js @@ -50,11 +50,6 @@ Cu.import("resource://gre/modules/NotificationDB.jsm"); ["webrtcUI", "resource:///modules/webrtcUI.jsm", ] ].forEach(([name, resource]) => XPCOMUtils.defineLazyModuleGetter(this, name, resource)); -#ifdef MOZ_SAFE_BROWSING - XPCOMUtils.defineLazyModuleGetter(this, "SafeBrowsing", - "resource://gre/modules/SafeBrowsing.jsm"); -#endif - // lazy service getters [ ["Favicons", "@mozilla.org/browser/favicon-service;1", "mozIAsyncFavicons"], @@ -954,7 +949,6 @@ var gBrowserInit = { BrowserOnClick.init(); FeedHandler.init(); AboutPrivateBrowsingListener.init(); - TrackingProtection.init(); RefreshBlocker.init(); CaptivePortalWatcher.init(); @@ -1163,11 +1157,6 @@ var gBrowserInit = { } } -#ifdef MOZ_SAFE_BROWSING - // Bug 778855 - Perf regression if we do this here. To be addressed in bug 779008. - setTimeout(function() { SafeBrowsing.init(); }, 2000); -#endif - Services.obs.addObserver(gIdentityHandler, "perm-changed", false); Services.obs.addObserver(gSessionHistoryObserver, "browser:purge-session-history", false); Services.obs.addObserver(gXPInstallObserver, "addon-install-disabled", false); @@ -1437,8 +1426,6 @@ var gBrowserInit = { FeedHandler.uninit(); - TrackingProtection.uninit(); - RefreshBlocker.uninit(); CaptivePortalWatcher.uninit(); @@ -4181,7 +4168,6 @@ var XULBrowserWindow = { uri = Services.uriFixup.createExposableURI(uri); } catch (e) {} gIdentityHandler.updateIdentity(this._state, uri); - TrackingProtection.onSecurityChange(this._state, aIsSimulated); }, // simulate all change notifications after switching tabs @@ -7617,12 +7603,6 @@ var AboutPrivateBrowsingListener = { msg => { OpenBrowserWindow({private: true}); }); - window.messageManager.addMessageListener( - "AboutPrivateBrowsing:ToggleTrackingProtection", - msg => { - const PREF = "privacy.trackingprotection.pbmode.enabled"; - Services.prefs.setBoolPref(PREF, !Services.prefs.getBoolPref(PREF)); - }); } }; diff --git a/basilisk/base/content/global-scripts.inc b/basilisk/base/content/global-scripts.inc index 6edb11214..d97485697 100644 --- a/basilisk/base/content/global-scripts.inc +++ b/basilisk/base/content/global-scripts.inc @@ -22,13 +22,9 @@