[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



Title: GitLab

Pier Angelo Vendrame pushed to branch tor-browser-115.5.0esr-13.5-1 at The Tor Project / Applications / Tor Browser

Commits:

  • 75ee8a08
    by Pier Angelo Vendrame at 2023-11-28T17:06:52+01:00
    fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
    
    Bug 42299: Unbreak about:preferences#connection when invalid bridge
    lines are supplied
    
    We switched to a shared bridge line parser. It might throw if an invalid
    bridge line is passed, but we do not handle the exception in
    connectionPane.js. As a result, the page breaks.
    
    As a workaround, we can simply ignore the errors, but a better solution
    would warn the user about that.
    A bridge card rework is expected to happen in the 13.5 cycle, so I think
    we can defer a proper fix to that moment.
    (This should also be the UX of 11.5, 12.0 and 12.5).
    

1 changed file:

Changes:

  • browser/components/torpreferences/content/connectionPane.js
    ... ... @@ -398,7 +398,7 @@ const gConnectionPane = (function () {
    398 398
           bridgeSwitch.addEventListener("toggle", () => {
    
    399 399
             TorSettings.bridges.enabled = bridgeSwitch.pressed;
    
    400 400
             TorSettings.saveToPrefs();
    
    401
    -        TorSettings.applySettings().then(result => {
    
    401
    +        TorSettings.applySettings().finally(() => {
    
    402 402
               this._populateBridgeCards();
    
    403 403
             });
    
    404 404
           });
    
    ... ... @@ -486,7 +486,12 @@ const gConnectionPane = (function () {
    486 486
             });
    
    487 487
             const idString = TorStrings.settings.bridgeId;
    
    488 488
             const id = card.querySelector(selectors.bridges.cardId);
    
    489
    -        const details = TorParsers.parseBridgeLine(bridgeString);
    
    489
    +        let details;
    
    490
    +        try {
    
    491
    +          details = TorParsers.parseBridgeLine(bridgeString);
    
    492
    +        } catch (e) {
    
    493
    +          console.error(`Detected invalid bridge line: ${bridgeString}`, e);
    
    494
    +        }
    
    490 495
             if (details && details.id !== undefined) {
    
    491 496
               card.setAttribute("data-bridge-id", details.id);
    
    492 497
             }
    
    ... ... @@ -529,7 +534,7 @@ const gConnectionPane = (function () {
    529 534
                     bridgeSwitch.pressed && !!strings.length;
    
    530 535
                   TorSettings.bridges.bridge_strings = strings.join("\n");
    
    531 536
                   TorSettings.saveToPrefs();
    
    532
    -              TorSettings.applySettings().then(result => {
    
    537
    +              TorSettings.applySettings().finally(() => {
    
    533 538
                     this._populateBridgeCards();
    
    534 539
                   });
    
    535 540
                 });
    
    ... ... @@ -1021,7 +1026,7 @@ const gConnectionPane = (function () {
    1021 1026
             TorSettings.bridges.builtin_type = "";
    
    1022 1027
           }
    
    1023 1028
           TorSettings.saveToPrefs();
    
    1024
    -      TorSettings.applySettings().then(result => {
    
    1029
    +      TorSettings.applySettings().finally(() => {
    
    1025 1030
             this._populateBridgeCards();
    
    1026 1031
           });
    
    1027 1032
         },
    
    ... ... @@ -1036,8 +1041,12 @@ const gConnectionPane = (function () {
    1036 1041
         async saveBridgeSettings(connect) {
    
    1037 1042
           TorSettings.saveToPrefs();
    
    1038 1043
           // FIXME: This can throw if the user adds a bridge manually with invalid
    
    1039
    -      // content. Should be addressed by tor-browser#40552.
    
    1040
    -      await TorSettings.applySettings();
    
    1044
    +      // content. Should be addressed by tor-browser#41913.
    
    1045
    +      try {
    
    1046
    +        await TorSettings.applySettings();
    
    1047
    +      } catch (e) {
    
    1048
    +        console.error("Applying settings failed", e);
    
    1049
    +      }
    
    1041 1050
     
    
    1042 1051
           this._populateBridgeCards();
    
    1043 1052
     
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits