[tbb-commits] [Git][tpo/applications/tor-browser][tor-browser-115.8.0esr-13.5-1] fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in...

richard (@richard) git at gitlab.torproject.org
Thu Feb 22 16:50:53 UTC 2024



richard pushed to branch tor-browser-115.8.0esr-13.5-1 at The Tor Project / Applications / Tor Browser


Commits:
cab718d4 by Henry Wilkes at 2024-02-22T16:50:41+00:00
fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection

Bug 42421: Hide the option to remove individual Lox bridges.

We also adjust the "Remove all bridges" callback to simply set the
"TorSettings.bridge.source" to be "Invalid" since this is more
source-independent, and TorSettings will handle clearing the bridge
strings for us.

- - - - -


1 changed file:

- browser/components/torpreferences/content/connectionPane.js


Changes:

=====================================
browser/components/torpreferences/content/connectionPane.js
=====================================
@@ -730,11 +730,15 @@ const gBridgeGrid = {
     const qrItem = row.menu.querySelector(
       ".tor-bridges-options-qr-one-menu-item"
     );
+    const removeItem = row.menu.querySelector(
+      ".tor-bridges-options-remove-one-menu-item"
+    );
     row.menu.addEventListener("showing", () => {
-      qrItem.hidden = !(
+      const show =
         this._bridgeSource === TorBridgeSource.UserProvided ||
-        this._bridgeSource === TorBridgeSource.BridgeDB
-      );
+        this._bridgeSource === TorBridgeSource.BridgeDB;
+      qrItem.hidden = !show;
+      removeItem.hidden = !show;
     });
 
     qrItem.addEventListener("click", () => {
@@ -752,21 +756,19 @@ const gBridgeGrid = {
         ].getService(Ci.nsIClipboardHelper);
         clipboard.copyString(row.bridgeLine);
       });
-    row.menu
-      .querySelector(".tor-bridges-options-remove-one-menu-item")
-      .addEventListener("click", () => {
-        const bridgeLine = row.bridgeLine;
-        const strings = TorSettings.bridges.bridge_strings;
-        const index = strings.indexOf(bridgeLine);
-        if (index === -1) {
-          return;
-        }
-        strings.splice(index, 1);
+    removeItem.addEventListener("click", () => {
+      const bridgeLine = row.bridgeLine;
+      const strings = TorSettings.bridges.bridge_strings;
+      const index = strings.indexOf(bridgeLine);
+      if (index === -1) {
+        return;
+      }
+      strings.splice(index, 1);
 
-        setTorSettings(() => {
-          TorSettings.bridges.bridge_strings = strings;
-        });
+      setTorSettings(() => {
+        TorSettings.bridges.bridge_strings = strings;
       });
+    });
   },
 
   /**
@@ -2016,7 +2018,7 @@ const gBridgeSettings = {
         setTorSettings(() => {
           // This should always have the side effect of disabling bridges as
           // well.
-          TorSettings.bridges.bridge_strings = [];
+          TorSettings.bridges.source = TorBridgeSource.Invalid;
         });
       });
 



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/cab718d4169ce4ee5e1b625aee80779b8939f624

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/cab718d4169ce4ee5e1b625aee80779b8939f624
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20240222/b7954186/attachment-0001.htm>


More information about the tbb-commits mailing list