... |
... |
@@ -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
|
|