updateProxyInputs()

in src/js/popup.js [1684:1709]


      updateProxyInputs(proxyInfo) {
        const resetProxyStorageEls = () => {
          [this.proxyAddressInput, this.cityNameInput, this.countryCodeInput, this.mozProxyEnabledInput].forEach(el => {
            el.value = "";

          });
          this.advancedProxyAddress.textContent = "";
        };

        resetProxyStorageEls();

        if (typeof(proxyInfo) === "undefined" || typeof(proxyInfo.type) === "undefined") {
          // no custom proxy is set
          return;
        }

        this.cityNameInput.value = proxyInfo.cityName;
        this.countryCodeInput.value = proxyInfo.countryCode;
        this.mozProxyEnabledInput.value = proxyInfo.mozProxyEnabled;
        this.proxyAddressInput.value = `${proxyInfo.type}://${proxyInfo.host}:${proxyInfo.port}`;

        if (typeof(proxyInfo.countryCode) === "undefined" && proxyInfo.type) {
          // Set custom proxy URL below 'Advanced proxy settings' button label
          this.advancedProxyAddress.textContent = `${proxyInfo.type}://${proxyInfo.host}:${proxyInfo.port}`;
        }
      }