From 07ae33e5d7bf2961377b1f2d7f23b112fa56ed03 Mon Sep 17 00:00:00 2001 From: Cosmin Sabou Date: Fri, 18 Sep 2020 20:27:03 +0300 Subject: [PATCH] Backed out changeset 206a04ae2fa7 (bug 1661756) for bc failures on browser_protections_telemetry.js. CLOSED TREE --- browser/actors/AboutProtectionsParent.jsm | 67 ---- browser/app/profile/firefox.js | 13 - browser/base/content/logos/vpn-dark.svg | 6 - browser/base/content/logos/vpn-light.svg | 6 - .../test/static/browser_parsable_script.js | 1 - browser/base/jar.mn | 2 - .../protections/content/protections.css | 118 +------- .../protections/content/protections.ftl | 13 - .../protections/content/protections.html | 36 --- .../protections/content/protections.js | 13 - .../protections/content/vpn-card.js | 120 -------- browser/components/protections/jar.mn | 1 - .../protections/test/browser/browser.ini | 1 - .../test/browser/browser_protections_proxy.js | 1 - .../browser/browser_protections_report_ui.js | 5 +- .../browser/browser_protections_telemetry.js | 286 ++---------------- .../test/browser/browser_protections_vpn.js | 283 ----------------- .../protections/test/browser/head.js | 12 - toolkit/components/telemetry/Events.yaml | 10 +- toolkit/modules/AsyncPrefs.jsm | 6 +- toolkit/modules/RemotePageAccessManager.jsm | 10 - 21 files changed, 27 insertions(+), 983 deletions(-) delete mode 100644 browser/base/content/logos/vpn-dark.svg delete mode 100644 browser/base/content/logos/vpn-light.svg delete mode 100644 browser/components/protections/content/vpn-card.js delete mode 100644 browser/components/protections/test/browser/browser_protections_vpn.js diff --git a/browser/actors/AboutProtectionsParent.jsm b/browser/actors/AboutProtectionsParent.jsm index 0551adf41d81..5ee04b97639c 100644 --- a/browser/actors/AboutProtectionsParent.jsm +++ b/browser/actors/AboutProtectionsParent.jsm @@ -49,16 +49,6 @@ const SCOPE_MONITOR = [ "https://identity.mozilla.com/apps/monitor", ]; -const SCOPE_VPN = "profile https://identity.mozilla.com/account/subscriptions"; -const VPN_ENDPOINT = `${Services.prefs.getStringPref( - "identity.fxaccounts.auth.uri" -)}oauth/subscriptions/active`; - -// The ID of the vpn subscription, if we see this ID attached to a user's account then they have subscribed to vpn. -const VPN_SUB_ID = Services.prefs.getStringPref( - "browser.contentblocking.report.vpn_sub_id" -); - // Error messages const INVALID_OAUTH_TOKEN = "Invalid OAuth token"; const USER_UNSUBSCRIBED_TO_MONITOR = "User is not subscribed to Monitor"; @@ -311,57 +301,6 @@ class AboutProtectionsParent extends JSWindowActorParent { ); } - async VPNSubStatus() { - // For testing, set vpn sub status manually - if (gTestOverride && "vpnOverrides" in gTestOverride) { - return gTestOverride.vpnOverrides().hasSubscription; - } - - const vpnToken = await fxAccounts.getOAuthToken({ scope: SCOPE_VPN }); - let headers = new Headers(); - headers.append("Authorization", `Bearer ${vpnToken}`); - const request = new Request(VPN_ENDPOINT, { headers }); - const res = await fetch(request); - if (res.ok) { - const result = await res.json(); - for (let sub of result) { - if (sub.subscriptionId == VPN_SUB_ID) { - return true; - } - } - return false; - } - // there was an error, assume user is not subscribed to VPN - return false; - } - - // VPN shows if we are in a supported region and supported languages - // VPN does not show in China - VPNs are illegal there, this is a requirement to hardcode, and not use in a pref. - VPNShouldShow() { - let currentRegion = ""; - if (gTestOverride && "vpnOverrides" in gTestOverride) { - currentRegion = gTestOverride.vpnOverrides().location; - } else { - // The region we have detected the user to be in - // We cannot run this in tests due to it using a request - currentRegion = Region.current ? Region.current.toLowerCase() : ""; - } - - // The region that the user has set as their home region - const homeRegion = Region.home.toLowerCase() || ""; - const regionsWithVPN = Services.prefs.getStringPref( - "browser.contentblocking.report.vpn_regions" - ); - const language = Services.locale.appLocaleAsBCP47; - - return ( - currentRegion != "cn" && - homeRegion != "cn" && - regionsWithVPN.includes(currentRegion) && - language.includes("en-") - ); - } - async receiveMessage(aMessage) { let win = this.browsingContext.top.embedderElement.ownerGlobal; switch (aMessage.name) { @@ -447,12 +386,6 @@ class AboutProtectionsParent extends JSWindowActorParent { case "FetchEntryPoint": return entrypoint; - - case "FetchVPNSubStatus": - return this.VPNSubStatus(); - - case "FetchShowVPNCard": - return this.VPNShouldShow(); } return undefined; diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index a42fb729abd8..538d9197705d 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1695,15 +1695,6 @@ pref("browser.contentblocking.report.proxy.enabled", false); // Disable the mobile promotion by default. pref("browser.contentblocking.report.show_mobile_app", true); -// Enable the vpn card by default. -pref("browser.contentblocking.report.vpn.enabled", true); -// Only show vpn card to certain regions. Comma separated string of two letter ISO 3166-1 country codes. -pref("browser.contentblocking.report.vpn_regions", "us,ca,nz,sg,my,gb"); -// Comma separated string of mozilla vpn supported platforms. -pref("browser.contentblocking.report.vpn_platforms", "win"); -pref("browser.contentblocking.report.hide_vpn_banner", false); -pref("browser.contentblocking.report.vpn_sub_id", "sub_HrfCZF7VPHzZkA"); - pref("browser.contentblocking.report.monitor.url", "https://monitor.firefox.com/?entrypoint=protection_report_monitor&utm_source=about-protections"); pref("browser.contentblocking.report.monitor.how_it_works.url", "https://monitor.firefox.com/about"); pref("browser.contentblocking.report.monitor.sign_in_url", "https://monitor.firefox.com/oauth/init?entrypoint=protection_report_monitor&utm_source=about-protections&email="); @@ -1716,10 +1707,6 @@ pref("browser.contentblocking.report.lockwise.mobile-ios.url", "https://apps.app pref("browser.contentblocking.report.lockwise.mobile-android.url", "https://play.google.com/store/apps/details?id=mozilla.lockbox&referrer=utm_source%3Dprotection_report%26utm_content%3Dmobile_promotion"); pref("browser.contentblocking.report.mobile-ios.url", "https://apps.apple.com/app/firefox-private-safe-browser/id989804926"); pref("browser.contentblocking.report.mobile-android.url", "https://play.google.com/store/apps/details?id=org.mozilla.firefox&referrer=utm_source%3Dprotection_report%26utm_content%3Dmobile_promotion"); -pref("browser.contentblocking.report.vpn.url", "https://vpn.mozilla.org/?utm_source=firefox-browser&utm_medium=firefox-browser&utm_campaign=about-protections-card"); -pref("browser.contentblocking.report.vpn-promo.url", "https://vpn.mozilla.org/?utm_source=firefox-browser&utm_medium=firefox-browser&utm_campaign=about-protections-top-promo"); -pref("browser.contentblocking.report.vpn-android.url", "https://play.google.com/store/apps/details?id=org.mozilla.firefox.vpn&referrer=utm_source%3Dfirefox-browser%26utm_medium%3Dfirefox-browser%26utm_campaign%3Dabout-protections-mobile-vpn%26anid%3D--"); -pref("browser.contentblocking.report.vpn-ios.url", "https://apps.apple.com/us/app/firefox-private-network-vpn/id1489407738"); // Protection Report's SUMO urls pref("browser.contentblocking.report.lockwise.how_it_works.url", "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/password-manager-report"); diff --git a/browser/base/content/logos/vpn-dark.svg b/browser/base/content/logos/vpn-dark.svg deleted file mode 100644 index 8c546170522d..000000000000 --- a/browser/base/content/logos/vpn-dark.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/browser/base/content/logos/vpn-light.svg b/browser/base/content/logos/vpn-light.svg deleted file mode 100644 index 710e63a177bd..000000000000 --- a/browser/base/content/logos/vpn-light.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/browser/base/content/test/static/browser_parsable_script.js b/browser/base/content/test/static/browser_parsable_script.js index e24f2483d78f..4621f30ce2fc 100644 --- a/browser/base/content/test/static/browser_parsable_script.js +++ b/browser/base/content/test/static/browser_parsable_script.js @@ -22,7 +22,6 @@ const kESModuleList = new Set([ /browser\/lockwise-card.js$/, /browser\/monitor-card.js$/, /browser\/proxy-card.js$/, - /browser\/vpn-card.js$/, /toolkit\/content\/global\/certviewer\/components\/.*\.js$/, /toolkit\/content\/global\/certviewer\/.*\.js$/, ]); diff --git a/browser/base/jar.mn b/browser/base/jar.mn index ef8d5542bc06..addd837db6af 100644 --- a/browser/base/jar.mn +++ b/browser/base/jar.mn @@ -22,8 +22,6 @@ browser.jar: content/browser/logos/send.svg (content/logos/send.svg) content/browser/logos/tracking-protection.svg (content/logos/tracking-protection.svg) content/browser/logos/tracking-protection-dark-theme.svg (content/logos/tracking-protection-dark-theme.svg) - content/browser/logos/vpn-dark.svg (content/logos/vpn-dark.svg) - content/browser/logos/vpn-light.svg (content/logos/vpn-light.svg) content/browser/aboutNetErrorCodes.js (content/aboutNetErrorCodes.js) content/browser/aboutNetError.xhtml (content/aboutNetError.xhtml) content/browser/aboutNetError.js (content/aboutNetError.js) diff --git a/browser/components/protections/content/protections.css b/browser/components/protections/content/protections.css index c35f92b04333..33c824afbcea 100644 --- a/browser/components/protections/content/protections.css +++ b/browser/components/protections/content/protections.css @@ -33,10 +33,10 @@ --gear-icon-fill: var(--grey-90-a60); --hover-grey-link: var(--grey-70); - --feature-banner-color: rgba(0, 0, 0, 0.05); } body { + margin-block: 40px 80px; box-sizing: border-box; } @@ -85,11 +85,9 @@ h2 { #report-content { width: 763px; margin: 0 auto; - margin-block: 40px 80px; } -.card-header .wrapper, -.new-banner .wrapper { +.card-header .wrapper { display: grid; grid-template-columns: repeat(7, 1fr); align-items: center; @@ -99,8 +97,6 @@ h2 { .card-header > button, #save-passwords-button, #get-proxy-extension-link, -#get-vpn-link, -#vpn-banner-link, #manage-passwords-button, #sign-up-for-monitor-link { grid-area: 1 / 5 / 1 / -1; @@ -112,15 +108,6 @@ h2 { line-height: initial; } -#vpn-banner-link { - grid-area: 1 / 6 / 1 / -1; -} - -.new-banner .wrapper div:nth-child(1) { - grid-area: 1 / 1 / 1 / 6; - padding-inline-end: 15px; -} - .lockwise-card.has-logins .wrapper div:nth-child(1) { grid-area: 1 / 1 / 1 / 6; } @@ -139,11 +126,6 @@ h2 { grid-area: 1 / 1 / 1 / -1; } -.vpn-card.subscribed .wrapper div:nth-child(1) { - padding-inline-end: 29px; - grid-area: 1 / 1 / 1 / 7; -} - /* We want to hide certain components depending on its state. */ .no-logins .monitor-scanned-wrapper, .etp-card.custom-not-blocking .card-body, @@ -151,8 +133,6 @@ h2 { #manage-protections, .etp-card .icon.dark, .proxy-card .icon.dark, -.vpn-card .icon.dark, -.vpn-banner .icon.dark, a.hidden, .loading .card-body, .lockwise-card.hidden, @@ -176,7 +156,6 @@ a.hidden, .loading button, .loading .wrapper, .proxy-card.hidden, -.vpn-card.hidden, .card-body.hidden, .hidden { display: none; @@ -190,15 +169,6 @@ a.hidden, z-index: 1; } -.vpn-card .icon { - width: 56px; - height: 56px; -} - -.new-banner .icon { - width: 50px; - height: 50px; -} @media (prefers-color-scheme: dark) { :root { @@ -209,21 +179,16 @@ a.hidden, --cryptominer-highlight-color: #BEBECA; --gear-icon-fill: rgba(249, 249, 250, 0.60); - --hover-grey-link: var(--grey-30); - --feature-banner-color: rgba(255, 255, 255, 0.1); + --hover-grey-link: var(--grey-30) } .etp-card .icon.dark, - .proxy-card .icon.dark, - .vpn-card .icon.dark, - .vpn-banner .icon.dark { + .proxy-card .icon.dark { display: block; } .etp-card .icon.light, - .proxy-card .icon.light, - .vpn-card .icon.light, - .vpn-banner .icon.light { + .proxy-card .icon.light { display: none; } } @@ -693,7 +658,7 @@ label[for="tab-cryptominer"]:hover ~ #highlight-hover { .lockwise-scanned-wrapper { display: grid; - grid-template-columns: 24px auto; + grid-template-columns: 7% auto; margin-block-start: 24px; grid-area: 2 / 1 / 2 / 5; padding-bottom: 1.7em; @@ -712,18 +677,6 @@ label[for="tab-cryptominer"]:hover ~ #highlight-hover { margin-inline-end: 15px; } -.vpn-card.subscribed #get-vpn-link { - display: none; -} - -.vpn-card:not(.subscribed) .content.subscribed { - display: none; -} - -.vpn-card.subscribed .content:not(.subscribed) { - display: none; -} - /* Monitor card */ .monitor-info-wrapper { display: grid; @@ -994,8 +947,6 @@ label[for="tab-cryptominer"]:hover ~ #highlight-hover { #manage-protections, #sign-up-for-monitor-link, #get-proxy-extension-link, -#get-vpn-link, -#vpn-banner-link, .monitor-partial-breaches-link-wrapper, .monitor-breaches-link-wrapper { background-color: var(--in-content-primary-button-background); @@ -1008,8 +959,6 @@ label[for="tab-cryptominer"]:hover ~ #highlight-hover { #manage-protections:active, #sign-up-for-monitor-link:active, #get-proxy-extension-link:active, -#get-vpn-link:active, -#vpn-banner-link:active, #monitor-partial-breaches-link:active, #monitor-breaches-link:active { background-color: var(--in-content-primary-button-background-active); @@ -1018,8 +967,6 @@ label[for="tab-cryptominer"]:hover ~ #highlight-hover { #manage-protections:hover, #sign-up-for-monitor-link:hover, #get-proxy-extension-link:hover, -#get-vpn-link:hover, -#vpn-banner-link:hover, #monitor-partial-breaches-link:hover, #monitor-breaches-link:hover { background-color: var(--in-content-primary-button-background-hover); @@ -1028,8 +975,6 @@ label[for="tab-cryptominer"]:hover ~ #highlight-hover { #manage-protections:focus, #sign-up-for-monitor-link:focus, #get-proxy-extension-link:focus, -#get-vpn-link:focus, -#vpn-banner-link:focus, #monitor-partial-breaches-link:focus, .monitor-block > a:focus, #monitor-breaches-link:focus { @@ -1080,54 +1025,3 @@ label[for="tab-cryptominer"]:hover ~ #highlight-hover { opacity: 0.02; } } - -.new-banner { - width: 100%; - background: var(--feature-banner-color); -} - -.banner-wrapper { - width: 763px; - display: grid; - grid-template-columns: 1fr 7fr; - grid-gap: var(--card-padding); - line-height: 1.3em; - margin: 0 auto; - padding: 12px var(--card-padding); -} - -.new-banner .banner-title { - margin: 0; - line-height: 1.25; - cursor: default; - font-size: inherit; -} - -.new-banner .content { - margin-block: 5px 0; - font-size: 0.88em; - cursor: default; - color: var(--in-content-deemphasized-text); -} - -.new-banner .exit-icon { - top: auto; - inset-inline-end: 30px; -} - -.vpn-card .title-wrapper { - display: grid; - grid-template-columns: 24px auto; -} - -.vpn-card:not(.subscribed) .card-title { - grid-area: 1 / 1 / 1 / -1; -} - -.vpn-card.subscribed .card-title { - margin-inline-start: 3px; -} - -.vpn-card:not(.subscribed) #check-icon { - display: none; -} diff --git a/browser/components/protections/content/protections.ftl b/browser/components/protections/content/protections.ftl index 5ac8a7b08cf5..9a4ecf933cd2 100644 --- a/browser/components/protections/content/protections.ftl +++ b/browser/components/protections/content/protections.ftl @@ -11,16 +11,3 @@ proxy-title = Stay safe on public Wi-Fi proxy-header-content = { -secure-proxy-brand-name } makes wireless hotspots more secure to protect you from hackers. get-proxy-extension-link = Get the Extension - -vpn-title = Take privacy protections beyond the browser -vpn-header-content = Protect your entire device with { -mozilla-vpn-brand-name }. One tap encrypts all traffic and hides your location. -get-vpn-link = Get { -mozilla-vpn-brand-name } - -vpn-title-subscribed = VPN: Subscribed -# Note This text is not being translated, and the
will need to be removed if or when it does get translated -vpn-header-content-subscribed = Using the { -mozilla-vpn-brand-name } encrypts all your traffic and hides your location β€” on up to 5 devices. Get the most from your subscription β€” add it from
the Google Play Store or Apple App Store. - -vpn-banner-header = Protection that extends beyond the browser -# Note This text is not being translated, and the
will need to be removed if or when it does get translated -vpn-banner-content = Try { -mozilla-vpn-brand-name } risk-free and see why TechRadar says
β€œits speed, simplicity and low monthly price make it worth a look.” -vpn-banner-link = Get { -mozilla-vpn-brand-name } diff --git a/browser/components/protections/content/protections.html b/browser/components/protections/content/protections.html index 5b4e2c6a51ed..7229b9bb6c8a 100644 --- a/browser/components/protections/content/protections.html +++ b/browser/components/protections/content/protections.html @@ -20,25 +20,10 @@ - -

@@ -302,27 +287,6 @@
- - diff --git a/browser/components/protections/content/protections.js b/browser/components/protections/content/protections.js index a918bd3c1b87..c0bed425e59e 100644 --- a/browser/components/protections/content/protections.js +++ b/browser/components/protections/content/protections.js @@ -7,7 +7,6 @@ import LockwiseCard from "./lockwise-card.js"; import MonitorCard from "./monitor-card.js"; import ProxyCard from "./proxy-card.js"; -import VPNCard from "./vpn-card.js"; let cbCategory = RPMGetStringPref("browser.contentblocking.category"); document.sendTelemetryEvent = (action, object, value = "") => { @@ -481,16 +480,4 @@ document.addEventListener("DOMContentLoaded", e => { // For tests const proxyUI = document.querySelector(".proxy-card"); proxyUI.dataset.enabled = proxyEnabled; - - const VPNEnabled = RPMGetBoolPref( - "browser.contentblocking.report.vpn.enabled", - true - ); - if (VPNEnabled) { - const vpnCard = new VPNCard(document); - vpnCard.init(); - } - // For tests - const vpnUI = document.querySelector(".vpn-card"); - vpnUI.dataset.enabled = VPNEnabled; }); diff --git a/browser/components/protections/content/vpn-card.js b/browser/components/protections/content/vpn-card.js deleted file mode 100644 index 16577897e6bb..000000000000 --- a/browser/components/protections/content/vpn-card.js +++ /dev/null @@ -1,120 +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/. */ - -/* eslint-env mozilla/frame-script */ -export default class VPNCard { - constructor(document) { - this.doc = document; - } - - init() { - const vpnLink = this.doc.getElementById("get-vpn-link"); - const vpnBannerLink = this.doc.getElementById("vpn-banner-link"); - vpnLink.href = RPMGetStringPref( - "browser.contentblocking.report.vpn.url", - "" - ); - vpnBannerLink.href = RPMGetStringPref( - "browser.contentblocking.report.vpn-promo.url", - "" - ); - - this.showVPNCard(); - } - - // Show the VPN card if user is located in areas, and on platforms, it serves - async showVPNCard() { - const showVPNBanner = this.showVPNBanner.bind(this); - RPMSendQuery("FetchShowVPNCard", {}).then(shouldShow => { - if (!shouldShow) { - return; - } - const vpnCard = this.doc.querySelector(".vpn-card"); - let availablePlatforms = RPMGetStringPref( - "browser.contentblocking.report.vpn_platforms" - ); - - let hasSupportedPlatform = false; - for (let platform of availablePlatforms.split(",")) { - if (navigator.platform.toLowerCase().includes(platform)) { - hasSupportedPlatform = true; - break; - } - } - - if (!hasSupportedPlatform) { - return; - } - - // add 'subscribed' class if user is subscribed to vpn - RPMSendQuery("FetchVPNSubStatus", {}).then(async hasVPN => { - let vpnLink = vpnCard.querySelector("#get-vpn-link"); - if (hasVPN) { - vpnCard.classList.add("subscribed"); - vpnCard - .querySelector(".card-title") - .setAttribute("data-l10n-id", "vpn-title-subscribed"); - - // hide the promo banner if the user is already subscribed to vpn - await RPMSetBoolPref( - "browser.contentblocking.report.hide_vpn_banner", - true - ); - } - - vpnLink.addEventListener("click", () => { - this.doc.sendTelemetryEvent("click", "vpn_card_link"); - }); - - let androidVPNAppLink = document.getElementById( - "vpn-google-playstore-link" - ); - androidVPNAppLink.href = RPMGetStringPref( - "browser.contentblocking.report.vpn-android.url" - ); - androidVPNAppLink.addEventListener("click", () => { - document.sendTelemetryEvent("click", "vpn_app_link_android"); - }); - - let iosVPNAppLink = document.getElementById("vpn-app-store-link"); - iosVPNAppLink.href = RPMGetStringPref( - "browser.contentblocking.report.vpn-ios.url" - ); - iosVPNAppLink.addEventListener("click", () => { - document.sendTelemetryEvent("click", "vpn_app_link_ios"); - }); - - vpnCard.classList.remove("hidden"); - showVPNBanner(); - }); - }); - } - - showVPNBanner() { - if ( - RPMGetBoolPref("browser.contentblocking.report.hide_vpn_banner", false) || - !RPMGetBoolPref("browser.contentblocking.report.vpn.enabled", false) - ) { - return; - } - - const vpnBanner = this.doc.querySelector(".vpn-banner"); - const exitIcon = vpnBanner.querySelector(".exit-icon"); - const vpnBannerLink = vpnBanner.querySelector("#vpn-banner-link"); - - vpnBannerLink.addEventListener("click", () => { - this.doc.sendTelemetryEvent("click", "vpn_banner_link"); - }); - - // User has closed the vpn banner, hide it. - exitIcon.addEventListener("click", () => { - vpnBanner.classList.add("hidden"); - this.doc.sendTelemetryEvent("click", "vpn_banner_close"); - }); - vpnBanner.classList.remove("hidden"); - this.doc.sendTelemetryEvent("show", "vpn_banner"); - // VPN banner only shows on the first visit, flip a pref so it does not show again. - RPMSetBoolPref("browser.contentblocking.report.hide_vpn_banner", true); - } -} diff --git a/browser/components/protections/jar.mn b/browser/components/protections/jar.mn index 17e7bb41934e..cc8d9d5068d5 100644 --- a/browser/components/protections/jar.mn +++ b/browser/components/protections/jar.mn @@ -9,4 +9,3 @@ browser.jar: content/browser/protections.html (content/protections.html) content/browser/protections.js (content/protections.js) content/browser/proxy-card.js (content/proxy-card.js) - content/browser/vpn-card.js (content/vpn-card.js) diff --git a/browser/components/protections/test/browser/browser.ini b/browser/components/protections/test/browser/browser.ini index 6a1dba1f67db..9d9e62117551 100644 --- a/browser/components/protections/test/browser/browser.ini +++ b/browser/components/protections/test/browser/browser.ini @@ -10,4 +10,3 @@ support-files = [browser_protections_proxy.js] [browser_protections_report_ui.js] [browser_protections_telemetry.js] -[browser_protections_vpn.js] diff --git a/browser/components/protections/test/browser/browser_protections_proxy.js b/browser/components/protections/test/browser/browser_protections_proxy.js index 8e8c675edd25..e42958943ea4 100644 --- a/browser/components/protections/test/browser/browser_protections_proxy.js +++ b/browser/components/protections/test/browser/browser_protections_proxy.js @@ -13,7 +13,6 @@ add_task(async function setup() { set: [ ["browser.contentblocking.report.monitor.enabled", false], ["browser.contentblocking.report.lockwise.enabled", false], - ["browser.contentblocking.report.vpn.enabled", false], ], }); }); diff --git a/browser/components/protections/test/browser/browser_protections_report_ui.js b/browser/components/protections/test/browser/browser_protections_report_ui.js index 88deef7e36a3..8fc427de84ff 100644 --- a/browser/components/protections/test/browser/browser_protections_report_ui.js +++ b/browser/components/protections/test/browser/browser_protections_report_ui.js @@ -31,10 +31,7 @@ const SQL = { add_task(async function setup() { await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.contentblocking.database.enabled", true], - ["browser.contentblocking.report.vpn.enabled", false], - ], + set: [["browser.contentblocking.database.enabled", true]], }); }); diff --git a/browser/components/protections/test/browser/browser_protections_telemetry.js b/browser/components/protections/test/browser/browser_protections_telemetry.js index 3eb29c5586c1..dcb1ba9a4ba7 100644 --- a/browser/components/protections/test/browser/browser_protections_telemetry.js +++ b/browser/components/protections/test/browser/browser_protections_telemetry.js @@ -10,10 +10,6 @@ XPCOMUtils.defineLazyServiceGetter( "nsITrackingDBService" ); -XPCOMUtils.defineLazyModuleGetters(this, { - Region: "resource://gre/modules/Region.jsm", -}); - const { AboutProtectionsParent } = ChromeUtils.import( "resource:///actors/AboutProtectionsParent.jsm" ); @@ -50,9 +46,10 @@ requestLongerTimeout(2); add_task(async function setup() { await SpecialPowers.pushPrefEnv({ set: [ - ["browser.contentblocking.report.vpn_regions", "us,ca,nz,sg,my,gb"], - ["browser.contentblocking.report.vpn_platforms", "win"], - + ["browser.contentblocking.database.enabled", true], + ["browser.contentblocking.report.monitor.enabled", true], + ["browser.contentblocking.report.lockwise.enabled", true], + ["browser.contentblocking.report.proxy.enabled", true], // Change the endpoints to prevent non-local network connections when landing on the page. ["browser.contentblocking.report.monitor.url", ""], ["browser.contentblocking.report.monitor.sign_in_url", ""], @@ -67,10 +64,6 @@ add_task(async function setup() { ["browser.contentblocking.report.mobile-android.url", ""], ["browser.contentblocking.report.monitor.home_page_url", ""], ["browser.contentblocking.report.monitor.preferences_url", ""], - ["browser.contentblocking.report.vpn.url", ""], - ["browser.contentblocking.report.vpn-promo.url", ""], - ["browser.contentblocking.report.vpn-android.url", ""], - ["browser.contentblocking.report.vpn-ios.url", ""], ], }); @@ -78,21 +71,16 @@ add_task(async function setup() { Services.telemetry.canRecordExtended = true; registerCleanupFunction(() => { Services.telemetry.canRecordExtended = oldCanRecord; - // AboutProtectionsParent.setTestOverride(null); }); }); add_task(async function checkTelemetryLoadEvents() { - await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.contentblocking.database.enabled", false], - ["browser.contentblocking.report.monitor.enabled", false], - ["browser.contentblocking.report.lockwise.enabled", false], - ["browser.contentblocking.report.proxy.enabled", false], - ["browser.contentblocking.report.vpn.enabled", false], - ], - }); - await addArbitraryTimeout(); + // There's an arbitrary interval of 2 seconds in which the content + // processes sync their event data with the parent process, we wait + // this out to ensure that we clear everything that is left over from + // previous tests and don't receive random events in the middle of our tests. + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + await new Promise(c => setTimeout(c, 2000)); // Clear everything. Services.telemetry.clearEvents(); @@ -170,26 +158,13 @@ function waitForTelemetryEventCount(count) { }, "waiting for telemetry event count of: " + count); } -let addArbitraryTimeout = async () => { +add_task(async function checkTelemetryClickEvents() { // There's an arbitrary interval of 2 seconds in which the content // processes sync their event data with the parent process, we wait // this out to ensure that we clear everything that is left over from // previous tests and don't receive random events in the middle of our tests. // eslint-disable-next-line mozilla/no-arbitrary-setTimeout await new Promise(c => setTimeout(c, 2000)); -}; - -add_task(async function checkTelemetryClickEvents() { - await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.contentblocking.database.enabled", true], - ["browser.contentblocking.report.monitor.enabled", true], - ["browser.contentblocking.report.lockwise.enabled", true], - ["browser.contentblocking.report.proxy.enabled", true], - ["browser.contentblocking.report.vpn.enabled", false], - ], - }); - await addArbitraryTimeout(); // Clear everything. Services.telemetry.clearEvents(); @@ -845,16 +820,12 @@ add_task(async function test_save_telemetry() { // Test that telemetry is sent if entrypoint param is included, // and test that it is recorded as default if entrypoint param is not properly included add_task(async function checkTelemetryLoadEventForEntrypoint() { - await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.contentblocking.database.enabled", false], - ["browser.contentblocking.report.monitor.enabled", false], - ["browser.contentblocking.report.lockwise.enabled", false], - ["browser.contentblocking.report.proxy.enabled", false], - ["browser.contentblocking.report.vpn.enabled", false], - ], - }); - await addArbitraryTimeout(); + // There's an arbitrary interval of 2 seconds in which the content + // processes sync their event data with the parent process, we wait + // this out to ensure that we clear everything that is left over from + // previous tests and don't receive random events in the middle of our tests. + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout + await new Promise(c => setTimeout(c, 2000)); // Clear everything. Services.telemetry.clearEvents(); @@ -932,226 +903,3 @@ add_task(async function checkTelemetryLoadEventForEntrypoint() { // Clean up. await BrowserTestUtils.removeTab(tab); }); - -// Test that telemetry is sent from the vpn card -add_task(async function checkTelemetryClickEventsVPN() { - if (!navigator.platform.startsWith("Win")) { - ok(true, "User is on an unsupported platform, the vpn card will not show"); - return; - } - await addArbitraryTimeout(); - // Clear everything. - Services.telemetry.clearEvents(); - await TestUtils.waitForCondition(() => { - let events = Services.telemetry.snapshotEvents( - Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS, - true - ).content; - return !events || !events.length; - }); - Services.telemetry.setEventRecordingEnabled("security.ui.protections", true); - - // user is not subscribed to VPN, and is in the us - AboutProtectionsParent.setTestOverride(getVPNOverrides(false, "us")); - await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.contentblocking.database.enabled", false], - ["browser.contentblocking.report.monitor.enabled", false], - ["browser.contentblocking.report.lockwise.enabled", false], - ["browser.contentblocking.report.proxy.enabled", false], - ["browser.contentblocking.report.vpn.enabled", true], - ["browser.contentblocking.report.vpn_regions", "us,ca,nz,sg,my,gb,cn"], - ["browser.contentblocking.report.vpn_platforms", "win"], - ["browser.contentblocking.report.hide_vpn_banner", true], - ["browser.contentblocking.report.vpn-android.url", ""], - ["browser.contentblocking.report.vpn-ios.url", ""], - ["browser.contentblocking.report.vpn.url", ""], - ], - }); - Services.locale.availableLocales = ["en-US"]; - Services.locale.requestedLocales = ["en-US"]; - Region._setHomeRegion("US", false); - - let tab = await BrowserTestUtils.openNewForegroundTab({ - url: "about:protections", - gBrowser, - }); - - info("checking for vpn link"); - await SpecialPowers.spawn(tab.linkedBrowser, [], async function() { - const getVPNLink = await ContentTaskUtils.waitForCondition(() => { - return content.document.getElementById("get-vpn-link"); - }, "get vpn link exists"); - await ContentTaskUtils.waitForCondition( - () => ContentTaskUtils.is_visible(getVPNLink), - "get vpn link is visible" - ); - await EventUtils.synthesizeMouseAtCenter(getVPNLink, {}, content); - }); - - let events = await waitForTelemetryEventCount(2); - events = events.filter( - e => - e[1] == "security.ui.protections" && - e[2] == "click" && - e[3] == "vpn_card_link" - ); - is( - events.length, - 1, - `recorded telemetry for vpn_card_link when user is not subscribed` - ); - - // User is subscribed to VPN - AboutProtectionsParent.setTestOverride(getVPNOverrides(true, "us")); - await reloadTab(tab); - await SpecialPowers.spawn(tab.linkedBrowser, [], async function() { - const androidVPNLink = await ContentTaskUtils.waitForCondition(() => { - return content.document.getElementById("vpn-google-playstore-link"); - }, "android vpn link exists"); - await ContentTaskUtils.waitForCondition( - () => ContentTaskUtils.is_visible(androidVPNLink), - "android vpn link is visible" - ); - await ContentTaskUtils.waitForCondition(() => { - return content.document - .querySelector(".vpn-card") - .classList.contains("subscribed"); - }, "subscribed class is added to the vpn card"); - - await EventUtils.synthesizeMouseAtCenter(androidVPNLink, {}, content); - }); - - events = await waitForTelemetryEventCount(5); - events = events.filter( - e => - e[1] == "security.ui.protections" && - e[2] == "click" && - e[3] == "vpn_app_link_android" - ); - is(events.length, 1, `recorded telemetry for vpn_app_link_android link`); - - await SpecialPowers.spawn(tab.linkedBrowser, [], async function() { - const iosVPNLink = await ContentTaskUtils.waitForCondition(() => { - return content.document.getElementById("vpn-app-store-link"); - }, "ios vpn link exists"); - await ContentTaskUtils.waitForCondition( - () => ContentTaskUtils.is_visible(iosVPNLink), - "ios vpn link is visible" - ); - await ContentTaskUtils.waitForCondition(() => { - return content.document - .querySelector(".vpn-card") - .classList.contains("subscribed"); - }, "subscribed class is added to the vpn card"); - - await EventUtils.synthesizeMouseAtCenter(iosVPNLink, {}, content); - }); - - events = await waitForTelemetryEventCount(6); - events = events.filter( - e => - e[1] == "security.ui.protections" && - e[2] == "click" && - e[3] == "vpn_app_link_ios" - ); - is(events.length, 1, `recorded telemetry for vpn_app_link_ios link`); - - // Clean up. - await BrowserTestUtils.removeTab(tab); -}); - -// Test that telemetry is sent from the vpn banner -add_task(async function checkTelemetryEventsVPNBanner() { - if (!navigator.platform.startsWith("Win")) { - ok(true, "User is on an unsupported platform, the vpn card will not show"); - return; - } - AboutProtectionsParent.setTestOverride(getVPNOverrides(false, "us")); - await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.contentblocking.database.enabled", false], - ["browser.contentblocking.report.monitor.enabled", false], - ["browser.contentblocking.report.lockwise.enabled", false], - ["browser.contentblocking.report.proxy.enabled", false], - ["browser.contentblocking.report.vpn.enabled", true], - ["browser.contentblocking.report.vpn_regions", "us,ca,nz,sg,my,gb"], - ["browser.contentblocking.report.vpn_platforms", "win"], - ["browser.contentblocking.report.hide_vpn_banner", false], - ["browser.contentblocking.report.vpn-promo.url", ""], - ], - }); - await addArbitraryTimeout(); - - // The VPN banner only shows if the user is in en* - Services.locale.availableLocales = ["en-US"]; - Services.locale.requestedLocales = ["en-US"]; - - // Clear everything. - Services.telemetry.clearEvents(); - await TestUtils.waitForCondition(() => { - let events = Services.telemetry.snapshotEvents( - Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS, - true - ).content; - return !events || !events.length; - }); - - Services.telemetry.setEventRecordingEnabled("security.ui.protections", true); - // User is not subscribed to VPN - AboutProtectionsParent.setTestOverride(getVPNOverrides(false, "us")); - - let tab = await BrowserTestUtils.openNewForegroundTab({ - url: "about:protections", - gBrowser, - }); - - await SpecialPowers.spawn(tab.linkedBrowser, [], async function() { - const bannerVPNLink = await ContentTaskUtils.waitForCondition(() => { - return content.document.getElementById("vpn-banner-link"); - }, "vpn banner link exists"); - await ContentTaskUtils.waitForCondition( - () => ContentTaskUtils.is_visible(bannerVPNLink), - "vpn banner link is visible" - ); - await EventUtils.synthesizeMouseAtCenter(bannerVPNLink, {}, content); - }); - - let events = await waitForTelemetryEventCount(3); - events = events.filter( - e => - e[1] == "security.ui.protections" && - e[2] == "click" && - e[3] == "vpn_banner_link" - ); - is(events.length, 1, `recorded telemetry for vpn_banner_link`); - - // VPN Banner flips this pref each time it shows, flip back between each instruction. - await SpecialPowers.pushPrefEnv({ - set: [["browser.contentblocking.report.hide_vpn_banner", false]], - }); - - await reloadTab(tab); - await SpecialPowers.spawn(tab.linkedBrowser, [], async function() { - const bannerExitLink = await ContentTaskUtils.waitForCondition(() => { - return content.document.querySelector(".vpn-banner .exit-icon"); - }, "vpn banner exit link exists"); - await ContentTaskUtils.waitForCondition( - () => ContentTaskUtils.is_visible(bannerExitLink), - "vpn banner exit link is visible" - ); - await EventUtils.synthesizeMouseAtCenter(bannerExitLink, {}, content); - }); - - events = await waitForTelemetryEventCount(7); - events = events.filter( - e => - e[1] == "security.ui.protections" && - e[2] == "click" && - e[3] == "vpn_banner_close" - ); - is(events.length, 1, `recorded telemetry for vpn_banner_close`); - - // Clean up. - await BrowserTestUtils.removeTab(tab); -}); diff --git a/browser/components/protections/test/browser/browser_protections_vpn.js b/browser/components/protections/test/browser/browser_protections_vpn.js deleted file mode 100644 index 68e8eb6726f1..000000000000 --- a/browser/components/protections/test/browser/browser_protections_vpn.js +++ /dev/null @@ -1,283 +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/. */ - -"use strict"; - -XPCOMUtils.defineLazyModuleGetters(this, { - Region: "resource://gre/modules/Region.jsm", -}); - -const { AboutProtectionsParent } = ChromeUtils.import( - "resource:///actors/AboutProtectionsParent.jsm" -); - -add_task(async function setup() { - await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.contentblocking.report.monitor.enabled", false], - ["browser.contentblocking.report.lockwise.enabled", false], - ["browser.contentblocking.report.vpn.enabled", true], - ], - }); - AboutProtectionsParent.setTestOverride(getVPNOverrides(false, "us")); - const avLocales = Services.locale.availableLocales; - - registerCleanupFunction(() => { - Services.locale.availableLocales = avLocales; - }); -}); - -add_task(async function testVPNCardVisibility() { - if (!navigator.platform.startsWith("Win")) { - ok(true, "User is on an unsupported platform, the vpn card will not show"); - return; - } - AboutProtectionsParent.setTestOverride(getVPNOverrides(false, "my")); - Region._setHomeRegion("my", false); - - let tab = await BrowserTestUtils.openNewForegroundTab({ - url: "about:protections", - gBrowser, - }); - - info("Enable showing the VPN card"); - await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.contentblocking.report.vpn.enabled", true], - ["browser.contentblocking.report.vpn_regions", "us,ca,nz,sg,my,gb"], - ["browser.contentblocking.report.vpn_platforms", "win"], - ], - }); - - info("Check that vpn card is hidden if user's language is not en*"); - Services.locale.availableLocales = ["ko-KR", "ar"]; - Services.locale.requestedLocales = ["ko-KR"]; - await reloadTab(tab); - await checkVPNCardVisibility(tab, true); - - info("Check that vpn card is shown if user's language is en*"); - // Set language back to en-US - Services.locale.availableLocales = ["en-US"]; - Services.locale.requestedLocales = ["en-US"]; - await reloadTab(tab); - await checkVPNCardVisibility(tab, false); - - info( - "Check that vpn card is hidden if user's location is not on the regions list." - ); - AboutProtectionsParent.setTestOverride(getVPNOverrides(false, "ls")); - await reloadTab(tab); - await checkVPNCardVisibility(tab, true); - - info( - "Check that vpn card shows a different version if user has subscribed to Mozilla vpn." - ); - AboutProtectionsParent.setTestOverride(getVPNOverrides(true, "us")); - await reloadTab(tab); - await checkVPNCardVisibility(tab, false, true); - - info( - "VPN card should be hidden when vpn not enabled, though all other conditions are true" - ); - await SpecialPowers.pushPrefEnv({ - set: [["browser.contentblocking.report.vpn.enabled", false]], - }); - await reloadTab(tab); - await checkVPNCardVisibility(tab, true); - - await BrowserTestUtils.removeTab(tab); -}); - -async function checkVPNCardVisibility(tab, shouldBeHidden, subscribed = false) { - await SpecialPowers.spawn( - tab.linkedBrowser, - [{ _shouldBeHidden: shouldBeHidden, _subscribed: subscribed }], - async function({ _shouldBeHidden, _subscribed }) { - await ContentTaskUtils.waitForCondition(() => { - const vpnCard = content.document.querySelector(".vpn-card"); - const subscribedStateCorrect = - vpnCard.classList.contains("subscribed") == _subscribed; - return ( - ContentTaskUtils.is_hidden(vpnCard) === _shouldBeHidden && - subscribedStateCorrect - ); - }); - - const visibilityState = _shouldBeHidden ? "hidden" : "shown"; - ok(true, `VPN card is ${visibilityState}.`); - } - ); -} - -add_task(async function testVPNPromoBanner() { - if (!navigator.platform.startsWith("Win")) { - ok( - true, - "User is on an unsupported platform, the vpn banner will not show" - ); - return; - } - AboutProtectionsParent.setTestOverride(getVPNOverrides(false, "us")); - - let tab = await BrowserTestUtils.openNewForegroundTab({ - url: "about:protections", - gBrowser, - }); - - info("Enable showing the VPN card and banner"); - await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.contentblocking.report.vpn.enabled", true], - ["browser.contentblocking.report.vpn_regions", "us,ca,nz,sg,my,gb"], - ["browser.contentblocking.report.vpn_platforms", "win"], - ["browser.contentblocking.report.hide_vpn_banner", false], - ], - }); - - info("Check that vpn banner is hidden if user's language is not en*"); - Services.locale.availableLocales = ["de"]; - Services.locale.requestedLocales = ["de"]; - await reloadTab(tab); - await checkVPNPromoBannerVisibility(tab, true); - - // VPN Banner flips this pref each time it shows, flip back between each instruction. - await SpecialPowers.pushPrefEnv({ - set: [["browser.contentblocking.report.hide_vpn_banner", false]], - }); - - info("Check that vpn banner is shown if user's language is en*"); - // Set language back to en-US - Services.locale.availableLocales = ["en-US"]; - Services.locale.requestedLocales = ["en-US"]; - await reloadTab(tab); - await checkVPNPromoBannerVisibility(tab, false); - - is( - Services.prefs.getBoolPref( - "browser.contentblocking.report.hide_vpn_banner", - false - ), - true, - "After showing the banner once, the pref to hide the VPN banner is flipped" - ); - info("The banner does not show when the pref to hide it is flipped"); - await reloadTab(tab); - await checkVPNPromoBannerVisibility(tab, true); - - // VPN Banner flips this pref each time it shows, flip back between each instruction. - await SpecialPowers.pushPrefEnv({ - set: [["browser.contentblocking.report.hide_vpn_banner", false]], - }); - - info( - "Check that VPN banner is hidden if user's location is not on the regions list." - ); - AboutProtectionsParent.setTestOverride(getVPNOverrides(false, "ls")); - await reloadTab(tab); - await checkVPNPromoBannerVisibility(tab, true); - - info( - "VPN banner should be hidden when vpn not enabled, though all other conditions are true" - ); - await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.contentblocking.report.vpn.enabled", false], - ["browser.contentblocking.report.hide_vpn_banner", false], - ], - }); - await reloadTab(tab); - await checkVPNPromoBannerVisibility(tab, true); - - await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.contentblocking.report.vpn.enabled", true], - ["browser.contentblocking.report.hide_vpn_banner", false], - ], - }); - - info("If user is subscribed to VPN already the promo banner should not show"); - AboutProtectionsParent.setTestOverride(getVPNOverrides(true, "us")); - - await reloadTab(tab); - await checkVPNPromoBannerVisibility(tab, true); - - await BrowserTestUtils.removeTab(tab); -}); - -async function checkVPNPromoBannerVisibility(tab, shouldBeHidden) { - await SpecialPowers.spawn( - tab.linkedBrowser, - [{ _shouldBeHidden: shouldBeHidden }], - async function({ _shouldBeHidden }) { - await ContentTaskUtils.waitForCondition(() => { - const vpnBanner = content.document.querySelector(".vpn-banner"); - return ContentTaskUtils.is_hidden(vpnBanner) === _shouldBeHidden; - }); - - const visibilityState = _shouldBeHidden ? "hidden" : "shown"; - ok(true, `VPN banner is ${visibilityState}.`); - } - ); -} - -// Expect the vpn card and banner to not show as we are expressly excluding China. Even when cn is in the supported region pref. -add_task(async function testVPNDoesNotShowChina() { - if (!navigator.platform.startsWith("Win")) { - ok( - true, - "User is on an unsupported platform, the vpn banner and card will not show" - ); - return; - } - AboutProtectionsParent.setTestOverride(getVPNOverrides(false, "us")); - let tab = await BrowserTestUtils.openNewForegroundTab({ - url: "about:protections", - gBrowser, - }); - - info("Enable showing the VPN card"); - await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.contentblocking.report.vpn.enabled", true], - ["browser.contentblocking.report.vpn_regions", "us,ca,nz,sg,my,gb,cn"], - ["browser.contentblocking.report.vpn_platforms", "win"], - ["browser.contentblocking.report.hide_vpn_banner", false], - ], - }); - - info("Check that vpn banner and card are able to show when conditions allow"); - Region._setHomeRegion("US", false); - Services.locale.availableLocales = ["en-US"]; - Services.locale.requestedLocales = ["en-US"]; - await reloadTab(tab); - await checkVPNCardVisibility(tab, false); - await checkVPNPromoBannerVisibility(tab, false); - - // VPN Banner flips this pref each time it shows, flip back between each instruction. - await SpecialPowers.pushPrefEnv({ - set: [["browser.contentblocking.report.hide_vpn_banner", false]], - }); - - info( - "set home location to China, even though user is currently in the US, expect vpn card to be hidden" - ); - Region._setHomeRegion("CN", false); - await reloadTab(tab); - await checkVPNCardVisibility(tab, true); - await checkVPNPromoBannerVisibility(tab, true); - - // VPN Banner flips this pref each time it shows, flip back between each instruction. - await SpecialPowers.pushPrefEnv({ - set: [["browser.contentblocking.report.hide_vpn_banner", false]], - }); - - info("home region is US, but current location is China"); - Region._setHomeRegion("US", false); - AboutProtectionsParent.setTestOverride(getVPNOverrides(false, "cn")); - await reloadTab(tab); - await checkVPNCardVisibility(tab, true); - await checkVPNPromoBannerVisibility(tab, true); - - await BrowserTestUtils.removeTab(tab); -}); diff --git a/browser/components/protections/test/browser/head.js b/browser/components/protections/test/browser/head.js index 7ccea5fb8ae8..1f9b8e90e424 100644 --- a/browser/components/protections/test/browser/head.js +++ b/browser/components/protections/test/browser/head.js @@ -77,15 +77,3 @@ const mockGetMonitorData = data => { registerCleanupFunction(function head_cleanup() { Services.logins.removeAllLogins(); }); - -// Used to replace AboutProtectionsParent.VPNSubStatus and Region.current -const getVPNOverrides = (hasSubscription = false, location = "us") => { - return { - vpnOverrides: () => { - return { - hasSubscription, - location, - }; - }, - }; -}; diff --git a/toolkit/components/telemetry/Events.yaml b/toolkit/components/telemetry/Events.yaml index e1cfbd54ede5..733434fccd9b 100644 --- a/toolkit/components/telemetry/Events.yaml +++ b/toolkit/components/telemetry/Events.yaml @@ -1835,16 +1835,14 @@ security.ui.protections: show: objects: [ "protection_report", - "vpn_banner", ] bug_numbers: - 1557050 - 1610897 - 1643428 - 1650468 - - 1661756 description: > - User arrived on the protection report. This also includes a 'value' attribute which defaults to 'direct' or will be the value that a referring website addds to the url. This also indicates if the vpn banner has been seen. + User arrived on the protection report. This also includes a 'value' attribute which defaults to 'direct' or will be the value that a referring website addds to the url. expiry_version: "86" record_in_processes: ["content"] release_channel_collection: opt-out @@ -1887,7 +1885,6 @@ security.ui.protections: - 1612091 - 1637615 - 1643428 - - 1661756 description: > User interaction by click events on the protection report. objects: [ @@ -1900,11 +1897,6 @@ security.ui.protections: "trackers_about_link", "mobile_app_link", "settings_link", - "vpn_banner_link", - "vpn_banner_close", - "vpn_card_link", - "vpn_app_link_android", - "vpn_app_link_ios", ] expiry_version: "86" record_in_processes: ["content"] diff --git a/toolkit/modules/AsyncPrefs.jsm b/toolkit/modules/AsyncPrefs.jsm index 307fbb295488..dd375122b622 100644 --- a/toolkit/modules/AsyncPrefs.jsm +++ b/toolkit/modules/AsyncPrefs.jsm @@ -18,10 +18,6 @@ const kAllowedPrefs = new Set([ "testing.allowed-prefs.some-char-pref", "testing.allowed-prefs.some-int-pref", - "browser.contentblocking.report.hide_lockwise_app", - "browser.contentblocking.report.hide_vpn_banner", - "browser.contentblocking.report.show_mobile_app", - "narrate.rate", "narrate.voice", @@ -62,6 +58,8 @@ const kAllowedPrefs = new Set([ "security.ssl.errorReporting.automatic", "security.tls.version.enable-deprecated", "security.xfocsp.errorReporting.automatic", + "browser.contentblocking.report.hide_lockwise_app", + "browser.contentblocking.report.show_mobile_app", ]); const kPrefTypeMap = new Map([ diff --git a/toolkit/modules/RemotePageAccessManager.jsm b/toolkit/modules/RemotePageAccessManager.jsm index c9983151407a..7490ce32420c 100644 --- a/toolkit/modules/RemotePageAccessManager.jsm +++ b/toolkit/modules/RemotePageAccessManager.jsm @@ -143,15 +143,12 @@ let RemotePageAccessManager = { "FetchMobileDeviceConnected", "GetShowProxyCard", "FetchEntryPoint", - "FetchVPNSubStatus", - "FetchShowVPNCard", ], RPMAddMessageListener: ["*"], RPMRemoveMessageListener: ["*"], RPMSetBoolPref: [ "browser.contentblocking.report.hide_lockwise_app", "browser.contentblocking.report.show_mobile_app", - "browser.contentblocking.report.hide_vpn_banner", ], RPMGetBoolPref: [ "browser.contentblocking.report.lockwise.enabled", @@ -164,8 +161,6 @@ let RemotePageAccessManager = { "privacy.trackingprotection.socialtracking.enabled", "browser.contentblocking.report.hide_lockwise_app", "browser.contentblocking.report.show_mobile_app", - "browser.contentblocking.report.hide_vpn_banner", - "browser.contentblocking.report.vpn.enabled", ], RPMGetStringPref: [ "browser.contentblocking.category", @@ -177,11 +172,6 @@ let RemotePageAccessManager = { "browser.contentblocking.report.lockwise.mobile-ios.url", "browser.contentblocking.report.mobile-ios.url", "browser.contentblocking.report.mobile-android.url", - "browser.contentblocking.report.vpn.url", - "browser.contentblocking.report.vpn-promo.url", - "browser.contentblocking.report.vpn-android.url", - "browser.contentblocking.report.vpn-ios.url", - "browser.contentblocking.report.vpn_platforms", ], RPMGetIntPref: ["network.cookie.cookieBehavior"], RPMGetFormatURLPref: [