tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

proxy-card.mjs (778B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 const PROXY_EXTENSION_URL = RPMGetStringPref(
      6  "browser.contentblocking.report.proxy_extension.url",
      7  ""
      8 );
      9 
     10 export default class ProxyCard {
     11  constructor(doc) {
     12    this.doc = doc;
     13  }
     14 
     15  init() {
     16    const proxyExtensionLink = this.doc.getElementById(
     17      "get-proxy-extension-link"
     18    );
     19    proxyExtensionLink.href = PROXY_EXTENSION_URL;
     20 
     21    // Show the Proxy card
     22    RPMSendQuery("GetShowProxyCard", {}).then(shouldShow => {
     23      const proxyCard = this.doc.querySelector(".proxy-card");
     24      proxyCard.classList.toggle("hidden", !shouldShow);
     25    });
     26  }
     27 }