Commits:
-
e35aaaa8
by Henry Wilkes at 2023-08-24T20:21:48+00:00
fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
Bug 42047: Remove sizing hacks for tor dialogs. We can just wait until
DOMContentLoaded to call _populateXUL. Then the subDialog code will take
care of the sizing for us.
13 changed files:
Changes:
browser/components/torpreferences/content/bridgeQrDialog.jsm
... |
... |
@@ -34,10 +34,7 @@ class BridgeQrDialog { |
34
|
34
|
}
|
35
|
35
|
|
36
|
36
|
init(window, dialog) {
|
37
|
|
- // Defer to later until Firefox has populated the dialog with all our elements
|
38
|
|
- window.setTimeout(() => {
|
39
|
|
- this._populateXUL(window, dialog);
|
40
|
|
- }, 0);
|
|
37
|
+ this._populateXUL(window, dialog);
|
41
|
38
|
}
|
42
|
39
|
|
43
|
40
|
openDialog(gSubDialog, bridgeString) {
|
browser/components/torpreferences/content/bridgeQrDialog.xhtml
... |
... |
@@ -21,8 +21,10 @@ |
21
|
21
|
"use strict";
|
22
|
22
|
|
23
|
23
|
let dialogObject = window.arguments[0];
|
24
|
|
- let dialogElement = document.getElementById("bridgeQr-dialog");
|
25
|
|
- dialogObject.init(window, dialogElement);
|
|
24
|
+ document.addEventListener("DOMContentLoaded", () => {
|
|
25
|
+ let dialogElement = document.getElementById("bridgeQr-dialog");
|
|
26
|
+ dialogObject.init(window, dialogElement);
|
|
27
|
+ });
|
26
|
28
|
]]>
|
27
|
29
|
</script>
|
28
|
30
|
</dialog>
|
browser/components/torpreferences/content/builtinBridgeDialog.jsm
... |
... |
@@ -95,10 +95,6 @@ class BuiltinBridgeDialog { |
95
|
95
|
);
|
96
|
96
|
});
|
97
|
97
|
|
98
|
|
- // Hack: see the CSS
|
99
|
|
- dialog.style.minWidth = "0";
|
100
|
|
- dialog.style.minHeight = "0";
|
101
|
|
-
|
102
|
98
|
this._acceptButton = dialog.getButton("accept");
|
103
|
99
|
|
104
|
100
|
Services.obs.addObserver(this, TorConnectTopics.StateChange);
|
... |
... |
@@ -129,10 +125,7 @@ class BuiltinBridgeDialog { |
129
|
125
|
}
|
130
|
126
|
|
131
|
127
|
init(window, aDialog) {
|
132
|
|
- // defer to later until firefox has populated the dialog with all our elements
|
133
|
|
- window.setTimeout(() => {
|
134
|
|
- this._populateXUL(window, aDialog);
|
135
|
|
- }, 0);
|
|
128
|
+ this._populateXUL(window, aDialog);
|
136
|
129
|
}
|
137
|
130
|
|
138
|
131
|
close() {
|
browser/components/torpreferences/content/builtinBridgeDialog.xhtml
... |
... |
@@ -83,8 +83,10 @@ |
83
|
83
|
"use strict";
|
84
|
84
|
|
85
|
85
|
let builtinBridgeDialog = window.arguments[0];
|
86
|
|
- let dialog = document.getElementById("torPreferences-builtinBridge-dialog");
|
87
|
|
- builtinBridgeDialog.init(window, dialog);
|
|
86
|
+ document.addEventListener("DOMContentLoaded", () => {
|
|
87
|
+ let dialog = document.getElementById("torPreferences-builtinBridge-dialog");
|
|
88
|
+ builtinBridgeDialog.init(window, dialog);
|
|
89
|
+ });
|
88
|
90
|
]]>
|
89
|
91
|
</script>
|
90
|
92
|
</dialog>
|
browser/components/torpreferences/content/connectionSettingsDialog.jsm
... |
... |
@@ -213,10 +213,6 @@ class ConnectionSettingsDialog { |
213
|
213
|
this._dialog.addEventListener("dialogaccept", e => {
|
214
|
214
|
this._applySettings();
|
215
|
215
|
});
|
216
|
|
-
|
217
|
|
- // Hack: see the CSS
|
218
|
|
- this._dialog.style.minWidth = "0";
|
219
|
|
- this._dialog.style.minHeight = "0";
|
220
|
216
|
}
|
221
|
217
|
|
222
|
218
|
// callback when proxy is toggled
|
... |
... |
@@ -380,10 +376,7 @@ class ConnectionSettingsDialog { |
380
|
376
|
}
|
381
|
377
|
|
382
|
378
|
init(window, aDialog) {
|
383
|
|
- // defer to later until firefox has populated the dialog with all our elements
|
384
|
|
- window.setTimeout(() => {
|
385
|
|
- this._populateXUL(window, aDialog);
|
386
|
|
- }, 0);
|
|
379
|
+ this._populateXUL(window, aDialog);
|
387
|
380
|
}
|
388
|
381
|
|
389
|
382
|
openDialog(gSubDialog) {
|
browser/components/torpreferences/content/connectionSettingsDialog.xhtml
... |
... |
@@ -83,8 +83,10 @@ |
83
|
83
|
"use strict";
|
84
|
84
|
|
85
|
85
|
let connectionSettingsDialog = window.arguments[0];
|
86
|
|
- let dialog = document.getElementById("torPreferences-connection-dialog");
|
87
|
|
- connectionSettingsDialog.init(window, dialog);
|
|
86
|
+ document.addEventListener("DOMContentLoaded", () => {
|
|
87
|
+ let dialog = document.getElementById("torPreferences-connection-dialog");
|
|
88
|
+ connectionSettingsDialog.init(window, dialog);
|
|
89
|
+ });
|
88
|
90
|
]]>
|
89
|
91
|
</script>
|
90
|
92
|
</dialog>
|
browser/components/torpreferences/content/provideBridgeDialog.jsm
... |
... |
@@ -99,10 +99,7 @@ class ProvideBridgeDialog { |
99
|
99
|
}
|
100
|
100
|
|
101
|
101
|
init(window, aDialog) {
|
102
|
|
- // defer to later until firefox has populated the dialog with all our elements
|
103
|
|
- window.setTimeout(() => {
|
104
|
|
- this._populateXUL(window, aDialog);
|
105
|
|
- }, 0);
|
|
102
|
+ this._populateXUL(window, aDialog);
|
106
|
103
|
}
|
107
|
104
|
|
108
|
105
|
close() {
|
browser/components/torpreferences/content/provideBridgeDialog.xhtml
... |
... |
@@ -24,8 +24,10 @@ |
24
|
24
|
"use strict";
|
25
|
25
|
|
26
|
26
|
let provideBridgeDialog = window.arguments[0];
|
27
|
|
- let dialog = document.getElementById("torPreferences-provideBridge-dialog");
|
28
|
|
- provideBridgeDialog.init(window, dialog);
|
|
27
|
+ document.addEventListener("DOMContentLoaded", () => {
|
|
28
|
+ let dialog = document.getElementById("torPreferences-provideBridge-dialog");
|
|
29
|
+ provideBridgeDialog.init(window, dialog);
|
|
30
|
+ });
|
29
|
31
|
]]>
|
30
|
32
|
</script>
|
31
|
33
|
</dialog>
|
browser/components/torpreferences/content/requestBridgeDialog.jsm
... |
... |
@@ -157,10 +157,7 @@ class RequestBridgeDialog { |
157
|
157
|
}
|
158
|
158
|
|
159
|
159
|
init(window, dialog) {
|
160
|
|
- // defer to later until firefox has populated the dialog with all our elements
|
161
|
|
- window.setTimeout(() => {
|
162
|
|
- this._populateXUL(window, dialog);
|
163
|
|
- }, 0);
|
|
160
|
+ this._populateXUL(window, dialog);
|
164
|
161
|
}
|
165
|
162
|
|
166
|
163
|
close() {
|
browser/components/torpreferences/content/requestBridgeDialog.xhtml
... |
... |
@@ -35,8 +35,10 @@ |
35
|
35
|
"use strict";
|
36
|
36
|
|
37
|
37
|
let requestBridgeDialog = window.arguments[0];
|
38
|
|
- let dialog = document.getElementById("torPreferences-requestBridge-dialog");
|
39
|
|
- requestBridgeDialog.init(window, dialog);
|
|
38
|
+ document.addEventListener("DOMContentLoaded", () => {
|
|
39
|
+ let dialog = document.getElementById("torPreferences-requestBridge-dialog");
|
|
40
|
+ requestBridgeDialog.init(window, dialog);
|
|
41
|
+ });
|
40
|
42
|
]]>
|
41
|
43
|
</script>
|
42
|
44
|
</dialog>
|
browser/components/torpreferences/content/torLogDialog.jsm
... |
... |
@@ -60,10 +60,7 @@ class TorLogDialog { |
60
|
60
|
}
|
61
|
61
|
|
62
|
62
|
init(window, aDialog) {
|
63
|
|
- // defer to later until firefox has populated the dialog with all our elements
|
64
|
|
- window.setTimeout(() => {
|
65
|
|
- this._populateXUL(aDialog);
|
66
|
|
- }, 0);
|
|
63
|
+ this._populateXUL(aDialog);
|
67
|
64
|
}
|
68
|
65
|
|
69
|
66
|
copyTorLog() {
|
browser/components/torpreferences/content/torLogDialog.xhtml
... |
... |
@@ -19,8 +19,10 @@ |
19
|
19
|
"use strict";
|
20
|
20
|
|
21
|
21
|
let torLogDialog = window.arguments[0];
|
22
|
|
- let dialog = document.getElementById("torPreferences-torLog-dialog");
|
23
|
|
- torLogDialog.init(window, dialog);
|
|
22
|
+ document.addEventListener("DOMContentLoaded", () => {
|
|
23
|
+ let dialog = document.getElementById("torPreferences-torLog-dialog");
|
|
24
|
+ torLogDialog.init(window, dialog);
|
|
25
|
+ });
|
24
|
26
|
]]>
|
25
|
27
|
</script>
|
26
|
28
|
</dialog>
|
browser/components/torpreferences/content/torPreferences.css
... |
... |
@@ -441,22 +441,6 @@ dialog#torPreferences-requestBridge-dialog > hbox { |
441
|
441
|
}
|
442
|
442
|
|
443
|
443
|
/* Builtin bridge dialog */
|
444
|
|
-#torPreferences-builtinBridge-dialog {
|
445
|
|
- /* Hack: ask XUL to load with a lot of space, then we will remove the minimum
|
446
|
|
- sizes after we populate the string. Users with high resolutions should see a
|
447
|
|
- big dialog, but with all the needed buttons, users with small resolutions
|
448
|
|
- should see scrollbars.
|
449
|
|
- Known problems:
|
450
|
|
- 1) the hack works only if a window is *already* small: if it is big, and then
|
451
|
|
- it is resized, the dialog will not shrink;
|
452
|
|
- 2) horizontal scrollbars are never added.
|
453
|
|
- The proper solution for this will be loading the localized string with
|
454
|
|
- Mozilla's way.
|
455
|
|
- See also https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/41044 */
|
456
|
|
- min-width: 700px;
|
457
|
|
- min-height: 550px;
|
458
|
|
-}
|
459
|
|
-
|
460
|
444
|
#torPreferences-builtinBridge-header {
|
461
|
445
|
margin: 8px 0 10px 0;
|
462
|
446
|
}
|
... |
... |
@@ -504,12 +488,6 @@ groupbox#torPreferences-bridges-group textarea { |
504
|
488
|
}
|
505
|
489
|
|
506
|
490
|
/* Connection settings dialog */
|
507
|
|
-#torPreferences-connection-dialog {
|
508
|
|
- /* Hack: like the built-in dialog */
|
509
|
|
- min-width: 700px;
|
510
|
|
- min-height: 550px;
|
511
|
|
-}
|
512
|
|
-
|
513
|
491
|
#torPreferences-connection-header {
|
514
|
492
|
margin: 4px 0 14px 0;
|
515
|
493
|
}
|
|