[tor-commits] [torbutton/master] Bug 31520: Remove monthly giving banner from Tor Browser

gk at torproject.org gk at torproject.org
Tue Aug 27 11:43:54 UTC 2019


commit 133eb64aee4bd929f792b5e91d9a73e35f826161
Author: Alex Catarineu <acat at torproject.org>
Date:   Tue Aug 27 13:31:25 2019 +0200

    Bug 31520: Remove monthly giving banner from Tor Browser
    
    This reverts commit 676f9b37aa8a74c4fb0e2d624d7e4b2a73082352.
---
 chrome/content/aboutTor/aboutTor-content.js |  19 -------
 chrome/content/aboutTor/aboutTor.xhtml      |  13 -----
 chrome/content/torbutton.js                 |  17 ------
 chrome/locale/en-US/aboutTor.dtd            |   3 -
 chrome/skin/aboutTor.css                    |  83 ----------------------------
 chrome/skin/icon_monthly_donors.png         | Bin 3093 -> 0 bytes
 defaults/preferences/preferences.js         |   1 -
 7 files changed, 136 deletions(-)

diff --git a/chrome/content/aboutTor/aboutTor-content.js b/chrome/content/aboutTor/aboutTor-content.js
index 01b4c2c7..4a77af53 100644
--- a/chrome/content/aboutTor/aboutTor-content.js
+++ b/chrome/content/aboutTor/aboutTor-content.js
@@ -22,7 +22,6 @@ let { bindPrefAndInit, show_torbrowser_manual } = ChromeUtils.import("resource:/
 var AboutTorListener = {
   kAboutTorLoadedMessage: "AboutTor:Loaded",
   kAboutTorChromeDataMessage: "AboutTor:ChromeData",
-  kAboutTorHideDonationBanner: "AboutTor:HideDonationBanner",
 
   get isAboutTor() {
     return content.document.documentURI.toLowerCase() == "about:tor";
@@ -57,22 +56,6 @@ var AboutTorListener = {
     }
   },
 
-  setupBannerClosing: function () {
-    let that = this;
-    let closer = content.document.getElementById("donation-banner-closer");
-    closer.addEventListener("click", function () {
-      sendAsyncMessage(that.kAboutTorHideDonationBanner);
-    });
-
-    bindPrefAndInit("extensions.torbutton.donation_banner_countdown3",
-                    countdown => {
-                      if (content.document && content.document.body) {
-                        content.document.body.setAttribute(
-                          "show-donation-banner", countdown > 0);
-                      }
-                    });
-  },
-
   onPageLoad: function() {
     // Arrange to update localized text and links.
     bindPrefAndInit("intl.locale.requested", aNewVal => {
@@ -81,8 +64,6 @@ var AboutTorListener = {
       }
     });
 
-    this.setupBannerClosing();
-
     // Add message and event listeners.
     addMessageListener(this.kAboutTorChromeDataMessage, this);
     addEventListener("pagehide", this, false);
diff --git a/chrome/content/aboutTor/aboutTor.xhtml b/chrome/content/aboutTor/aboutTor.xhtml
index 106bd936..4736f653 100644
--- a/chrome/content/aboutTor/aboutTor.xhtml
+++ b/chrome/content/aboutTor/aboutTor.xhtml
@@ -34,19 +34,6 @@ window.addEventListener("pageshow", function() {
 </script>
 </head>
 <body dir="&locale.dir;">
-  <div id="donation-banner">
-    <div><!--EMPTY SPACER DIV--></div>
-    <div id="donation-banner-message">
-      <div id="donation-banner-icon"></div>
-      <div>&aboutTor.donationBanner3.line1;
-        <a href="https://donate.torproject.org/monthly-giving">
-          &aboutTor.donationBanner3.line2;
-        </a>
-      </div>
-    </div>
-    <div id="donation-banner-closer">×</div>
-  </div>
-
   <div class="torcontent-container">
     <div id="torbrowser-info">
       <div id="torbrowser-version"/>
diff --git a/chrome/content/torbutton.js b/chrome/content/torbutton.js
index 0ad9d620..756c2c7c 100644
--- a/chrome/content/torbutton.js
+++ b/chrome/content/torbutton.js
@@ -26,7 +26,6 @@ const k_tb_last_browser_version_pref = "extensions.torbutton.lastBrowserVersion"
 const k_tb_browser_update_needed_pref = "extensions.torbutton.updateNeeded";
 const k_tb_last_update_check_pref = "extensions.torbutton.lastUpdateCheck";
 const k_tb_tor_check_failed_topic = "Torbutton:TorCheckFailed";
-const k_tb_donation_banner_countdown = "extensions.torbutton.donation_banner_countdown3";
 
 var m_tb_prefs = Services.prefs;
 
@@ -217,14 +216,6 @@ function torbutton_init_toolbutton()
     }
 }
 
-// Show the donation banner a finite number of times.
-function torbutton_donation_banner_countdown() {
-  let count = m_tb_prefs.getIntPref(k_tb_donation_banner_countdown, 0);
-  if (count > 0) {
-    m_tb_prefs.setIntPref(k_tb_donation_banner_countdown, count - 1);
-  }
-}
-
 function torbutton_is_mobile() {
     return Services.appinfo.OS === "Android";
 }
@@ -339,10 +330,6 @@ function torbutton_init() {
     // Add about:tor IPC message listener.
     window.messageManager.addMessageListener("AboutTor:Loaded",
                                    torbutton_abouttor_message_handler);
-    window.messageManager.addMessageListener("AboutTor:HideDonationBanner",
-                                   torbutton_abouttor_message_handler);
-
-    torbutton_donation_banner_countdown();
 
     setupPreferencesForMobile();
 
@@ -457,10 +444,6 @@ var torbutton_abouttor_message_handler = {
         aMessage.target.messageManager.sendAsyncMessage("AboutTor:ChromeData",
                                                     this.getChromeData(true));
         break;
-      case "AboutTor:HideDonationBanner":
-        torbutton_log(5, "message AboutTor:HideDonationBanner received");
-        m_tb_prefs.setIntPref(k_tb_donation_banner_countdown, 0);
-        break;
     }
   },
 
diff --git a/chrome/locale/en-US/aboutTor.dtd b/chrome/locale/en-US/aboutTor.dtd
index 5757fae4..c4273ad2 100644
--- a/chrome/locale/en-US/aboutTor.dtd
+++ b/chrome/locale/en-US/aboutTor.dtd
@@ -30,6 +30,3 @@
 <!ENTITY aboutTor.newsletter.link_text "Sign up for Tor News.">
 <!ENTITY aboutTor.donationBanner.line2e "Keep Tor strong.">
 <!ENTITY aboutTor.donationBanner.buttonA "Donate Now">
-
-<!ENTITY aboutTor.donationBanner3.line1 "Automatic monthly donations keep Tor strong.">
-<!ENTITY aboutTor.donationBanner3.line2 "Become a Defender of Privacy today.">
diff --git a/chrome/skin/aboutTor.css b/chrome/skin/aboutTor.css
index 09f6208d..baa92b42 100644
--- a/chrome/skin/aboutTor.css
+++ b/chrome/skin/aboutTor.css
@@ -137,12 +137,6 @@ body:not([showmanual]) .showForManual {
   margin-top: 10vh;
 }
 
-/* Reducing this on mobile to avoid vertical overflow
- * on small screens when showing donation banner */
-body[mobile] #bottom {
-  margin-top: 3vh;
-}
-
 #bottom p {
   font-size: 10px;
   text-align: start;
@@ -310,83 +304,6 @@ body[mobile] #bottom {
   border-radius: 50px 50px 0 0;
 }
 
-/* Donation Banner
- * While this banner is present, we need to
- * offset the elements normally at the top of
- * the window.
- */
-
-#donation-banner {
-  display: flex;
-  align-items: stretch;
-  background-color: white;
-  color: var(--abouttor-bg-toron-color);
-  font-size: 16px;
-  height: 70px;
-  justify-content: center;
-  left: 0px;
-  right: 0px;
-  top: 0px;
-  position: absolute;
-  transform: translateY(-70px);
-  transition: transform 200ms;
-  z-index: 1;
-  padding-right:38px;
-}
-
-body[mobile] #donation-banner {
-  font-size: 14px;
-}
-
-body[show-donation-banner="true"] #donation-banner {
-  transform: translateY(0px);
-  transition: transform 0ms;
-}
-
-#donation-banner-message {
-  align-items: center;
-  display: flex;
-  justify-content: center;
-}
-
-#donation-banner-message a {
-  color: var(--abouttor-bg-toron-color);
-}
-
-#donation-banner-icon {
-  background: url('chrome://torbutton/skin/icon_monthly_donors.png') no-repeat center center;
-  background-size: contain;
-  background-position: bottom;
-  height: 56px;
-  margin: 14px 16px 0px 16px;
-  width: 65px;
-}
-
-#donation-banner-closer {
-  display: flex;
-  align-items: center;
-  font-size: 20px;
-  height: 22px;
-  justify-content: center;
-  margin: 4px;
-  padding: 4px;
-  position: absolute;
-  offset-inline-end: 0px;
-  top: 0px;
-  width: 22px;
-  -moz-user-select: none;
-}
-
-#donation-banner-closer:hover {
-  background-color: gray;
-  cursor: pointer;
-}
-
-body[show-donation-banner="true"] #onboarding-overlay-button-container,
-body[show-donation-banner="true"] .torcontent-container {
-  margin-top: 72px;
-}
-
 /*
  * Mobile specific css
  */
diff --git a/chrome/skin/icon_monthly_donors.png b/chrome/skin/icon_monthly_donors.png
deleted file mode 100644
index 9505f471..00000000
Binary files a/chrome/skin/icon_monthly_donors.png and /dev/null differ
diff --git a/defaults/preferences/preferences.js b/defaults/preferences/preferences.js
index 3a2cdcd3..e5d66d55 100644
--- a/defaults/preferences/preferences.js
+++ b/defaults/preferences/preferences.js
@@ -6,7 +6,6 @@ pref("extensions.torbutton.logmethod",1); // 0=stdout, 1=errorconsole, 2=debuglo
 pref("extensions.torbutton.display_circuit", true);
 pref("extensions.torbutton at torproject.org.description", "chrome://torbutton/locale/torbutton.properties");
 pref("extensions.torbutton.updateNeeded", false);
-pref("extensions.torbutton.donation_banner_countdown3", 4);
 
 // Tor check and proxy prefs
 pref("extensions.torbutton.test_enabled",true);



More information about the tor-commits mailing list