Skip to content

Commit 92a329a

Browse files
rearrangement + rewording
#46 (comment)
1 parent c0949b1 commit 92a329a

File tree

6 files changed

+62
-51
lines changed

6 files changed

+62
-51
lines changed

src/bg/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const sAPI = {
8282
'maxWait': 0,
8383
'proxyCompat': false,
8484
'rememberSecureSites': true,
85-
'whitelist': {}
85+
'whitelist': {} // named Exclusions in the UI from 0.11.0 onwards
8686
},
8787
async getAll() {
8888
if (this.loading) await this.loading;

src/pages/httpz.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ input[type="checkbox"],
1212
input[type="radio"] {margin-right: 0 !important;}
1313
input[type="text"] {text-align-last: center !important;}
1414
x-fill {
15-
flex-grow: 10;
15+
flex: 10;
1616
min-height: 1em;
1717
min-width: 1em;
1818
}
19+
.flex {display: flex;}
20+
.col {flex-flow: column nowrap;}
21+
.row {flex-flow: row nowrap;}
22+
.align-center {align-items: center;}
23+
.justify-end {justify-content: end;}
24+
.justify-space-around {justify-content: space-around;}
25+
.justify-space-between {justify-content: space-between;}
1926
.info {
2027
background: #FFC;
2128
border-radius: 4px;

src/pages/options.css

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,8 @@ input[type="radio"] {margin-left: 1em;}
1010
textarea {
1111
font-weight: 100;
1212
resize: none;
13-
width: 75%;
14-
}
15-
.flex {display: flex;}
16-
.col {flex-flow: column nowrap;}
17-
.row {flex-flow: row nowrap;}
18-
.align-center {align-items: center;}
19-
.justify-end {justify-content: end;}
20-
.justify-space-around {justify-content: space-around;}
13+
width: 60%;
14+
}
2115
.num {width: 3.5em;}
2216
#main {
2317
border-radius: 5px;
@@ -32,6 +26,12 @@ textarea {
3226
#sidebar button:disabled {border: none;}
3327
#i_days {margin: 0 1em;}
3428
#save {font-weight: 700;}
29+
#b_clearIgnored,
30+
#b_clearWhitelist {
31+
margin: 0;
32+
min-width: initial;
33+
width: 3em;
34+
}
3535
#modalDialog {
3636
background: rgba(255,255,255,0.2);
3737
bottom: 0;
@@ -54,3 +54,4 @@ textarea {
5454
text-align: center;
5555
white-space: pre-line;
5656
}
57+
#modalDialog button {margin: auto 0.5em;}

src/pages/options.htm

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,42 @@
33
<head>
44
<meta charset="utf-8">
55
<link href="chrome://browser/content/extension.css" rel="stylesheet">
6-
<!-- healthy redundancy in case the page is opened directly -->
6+
<!-- healthy redundancy in case the page is opened directly -->
77
<link href="httpz.css" rel="stylesheet">
88
<link href="options.css" rel="stylesheet">
99
</head>
1010
<body class="flex row">
1111
<div id="main">
1212
<div id="d_general">
1313
<div class="browser-style flex row align-center">
14-
Enable Silent Fallback
14+
Fall back to HTTP without warning
1515
<span class="info" tabindex="0" data-info="HTTPZ's behavior whenever it fails to establish a secure communication with a server
16-
16+
1717
Enabled (default): will try an insecure communication (over HTTP) automatically
18-
18+
1919
Disabled: will show you a warning page asking you how to proceed">i</span>
2020
<x-fill></x-fill>
2121
<input id="i_autoDowngrade" type="checkbox">
2222
</div>
2323
<hr>
2424
<div class="browser-style flex row align-center">
25-
Ignore insecure sites...
26-
<span class="info" tabindex="0" data-info="After determining that a given site does not support HTTPS, HTTPZ will ignore subsequent requests to it for a certain period of time">i</span>
25+
Maximum wait before fallback (seconds)
26+
<span class="info" tabindex="0" data-info="The initial request to some sites that do not support HTTPS can take long to time out. HTTPZ will never wait longer than the time specified here before retrying requests over HTTP
27+
28+
Set to 0 to wait until the browser gives up (default)">i</span>
29+
<x-fill></x-fill>
30+
<input id="i_maxWait" type="text" class="browser-style num" pattern="^\d+$" required>
31+
</div>
32+
<hr>
33+
<div class="browser-style flex row">
34+
<div class="flex col">
35+
<div class="flex row align-center">
36+
Remember insecure sites...
37+
<span class="info" tabindex="0" data-info="After determining that a given site does not support HTTPS, HTTPZ will remember its hostname for a certain period of time in order to avoid making superfluous attempts over HTTPS">i</span>
38+
</div>
39+
<x-fill></x-fill>
40+
<button class="browser-style" type="button" id="b_clearIgnored">🗑️</button>
41+
</div>
2742
<x-fill></x-fill>
2843
<div>
2944
<div class="browser-style flex row align-center justify-end">
@@ -33,48 +48,36 @@
3348
<div class="browser-style flex row align-center justify-end">
3449
<label for="i_xdays">For</label>
3550
<div class="browser-style">
36-
<input id="i_days" type="text" class="browser-style num" pattern="^0*[1-9]\d*$" required><label></label>
51+
<input id="i_days" type="text" class="browser-style num" pattern="^0*[1-9]\d*$" required>
3752
</div>
3853
<label for="i_xdays">day(s)</label>
3954
<input id="i_xdays" name="period" type="radio" value=1>
4055
</div>
4156
<div class="browser-style flex row align-center justify-end">
42-
<label for="i_permanent">Permanently</label>
57+
<label for="i_permanent">Indefinitely</label>
4358
<input id="i_permanent" name="period" type="radio" value=-1>
4459
</div>
4560
</div>
4661
</div>
4762
<hr>
48-
<div class="browser-style flex row align-center">
49-
Maximum wait before fallback (seconds)
50-
<span class="info" tabindex="0" data-info="The initial request to some sites that do not support HTTPS can take long to time out. HTTPZ will never wait longer than the time specified here before retrying requests over HTTP
51-
52-
Set to 0 to wait until the browser gives up (default)">i</span>
53-
<x-fill></x-fill>
54-
<input id="i_maxWait" type="text" class="browser-style num" pattern="^\d+$" required>
55-
</div>
56-
<hr>
5763
<div class="flex row align-center">
58-
Whitelist
59-
<span class="info" tabindex="0" data-info="Whitelisted sites are ignored unconditionally
60-
61-
This list accepts hostnames only (e.g. www.example.com)">i</span>
64+
Exclusions
65+
<span class="info" tabindex="0" data-info="HTTPZ will never attempt to use HTTPS for sites in this list
66+
67+
Only hostnames are accepted (e.g. www.example.com)">i</span>
6268
<x-fill></x-fill>
6369
<textarea autocomplete="off" class="browser-style" id="t_whitelist" rows="1" spellcheck="false"></textarea>
64-
</div>
65-
<hr>
66-
<div class="flex row justify-space-around">
67-
<button class="browser-style" type="button" id="b_clearIgnored">Clear Ignore List</button>
68-
<button class="browser-style wide" type="button" id="b_clearWhitelist">Clear Whitelist</button>
70+
<x-fill></x-fill>
71+
<button class="browser-style wide" type="button" id="b_clearWhitelist">🗑️</button>
6972
</div>
7073
</div>
7174
<div id="d_advanced" hidden>
7275
<div class="browser-style flex row align-center">
7376
Intercept server-initiated redirections to HTTP
7477
<span class="info" tabindex="0" data-info="Enabled: HTTPZ will block any server-initiated downgrade attempts and display a warning page, allowing you to decide what to do
75-
78+
7679
Disabled (default): HTTPZ will add the site to the ignore list and let the browser proceed with the redirection
77-
80+
7881
💡 Note that a secure communication with a server needs to be established first for it to be able to ask the browser to downgrade this way">i</span>
7982
<x-fill></x-fill>
8083
<input id="i_interceptRedirects" type="checkbox">
@@ -88,9 +91,9 @@
8891
</div>
8992
<hr>
9093
<div class="browser-style flex row align-center">
91-
Enable Proxy-Compatible Mode
94+
Make compatible with proxies
9295
<span class="info" tabindex="0" data-info="Enable this if you connect through a forward proxy or gateway and HTTPZ causes it to respond with status codes 502 and/or 504 frequently
93-
96+
9497
HTTPZ will start treating those as errors and act accordingly">i</span>
9598
<x-fill></x-fill>
9699
<input id="i_proxyCompat" type="checkbox">
@@ -99,10 +102,10 @@
99102
<div class="browser-style flex row align-center">
100103
Honor private browsing
101104
<span class="info" tabindex="0" data-info="Enabled (default): potentially compromising information required by some features is not stored in the hard drive whenever it comes from a Private Browsing window. Such information is stored only in RAM instead. This includes:
102-
105+
103106
- ignored sites
104107
- known secure sites (see below)
105-
108+
106109
Disabled: data coming from Private Browsing windows is not given any special treatment">i</span>
107110
<x-fill></x-fill>
108111
<input id="i_honorPB" type="checkbox">
@@ -111,12 +114,12 @@
111114
<div class="browser-style flex row align-center">
112115
Remember secure sites
113116
<span class="info" tabindex="0" data-info="Every time that you navigate to a site that loads successfully over HTTPS, HTTPZ remembers its hostname, so as to avoid redirecting it back to HTTP if it ever fails in the future. This minimizes the risk of a Man-in-the-Middle being able to exploit the extension's behavior
114-
117+
115118
⚠️ Note that this information is stored unencrypted in HTTPZ's own local database in your hard drive. You may want to disable this if your threat model calls for it">i</span>
116119
<x-fill></x-fill>
117120
<input id="i_rememberSecureSites" type="checkbox">
118121
</div>
119-
</div>
122+
</div>
120123
</div>
121124
<div id="sidebar">
122125
<br><button class="browser-style" type="button" id="b_general" disabled>General</button><br>

src/pages/options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ ui.i_rememberSecureSites.addEventListener('change', e => {
177177
}
178178
});
179179
ui.b_clearIgnored.addEventListener('click', e => {
180-
showDialog('Are you sure you want to clear the ignore list?', true).then(r => {
180+
showDialog('Clear the list of insecure sites?', true).then(r => {
181181
if (!r) return;
182182
local.set({ignored: {}}).then(() => {
183183
setStatus(ui.b_clearIgnored, true);
@@ -213,7 +213,7 @@ ui.i_import.addEventListener('change', e => {
213213
reader.readAsText(ui.i_import.files[0]);
214214
});
215215
ui.b_clearWhitelist.addEventListener('click', e => {
216-
showDialog('Are you sure you want to clear the whitelist?', true).then(r => {
216+
showDialog('Clear the list of exclusions?', true).then(r => {
217217
if (!r) return;
218218
local.set({whitelist: {}, incognitoWhitelist: {}}).then(() => {
219219
ui.t_whitelist.value = '';

src/pages/popup.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ browser.tabs.query({active: true, currentWindow: true}).then(tabs => {
66
const tab = tabs[0];
77
const url = new URL(tab.url);
88
if (url.protocol === 'https:') {
9-
ui.info.textContent = `${url.hostname} was redirected to HTTPS. If you click the button below, HTTPZ will add this site to the whitelist and will attempt to reload it over HTTP`;
10-
ui.whitelist.textContent = 'add to whitelist';
9+
ui.info.textContent = `${url.hostname} was redirected to HTTPS. If you click the button below, HTTPZ will add this site to the list of exclusions and will attempt to reload it over HTTP`;
10+
ui.whitelist.textContent = 'Add to exclusions';
1111
const incognito = browser.extension.inIncognitoContext;
12-
if (incognito) ui.incognito.textContent = 'Note: sites added to the whitelist from a private window will not be visible in the options page';
12+
if (incognito) ui.incognito.textContent = 'Note: sites excluded from a private window will not be visible in the options page';
1313
ui.whitelist.onclick = e => {
1414
ui.whitelist.disabled = true;
1515
url.protocol = 'http:';
@@ -21,8 +21,8 @@ browser.tabs.query({active: true, currentWindow: true}).then(tabs => {
2121
}).then(() => {close();});
2222
};
2323
} else {
24-
ui.info.textContent = `HTTPZ did not try to redirect ${url.hostname} to HTTPS because it is in the whitelist. If you click the button below, this site will be removed from the whitelist and the tab will be reloaded`;
25-
ui.whitelist.textContent = 'remove from whitelist';
24+
ui.info.textContent = `HTTPZ did not try to redirect ${url.hostname} to HTTPS because it is in the list of exclusions. If you click the button below, this site will be removed from that list and the tab will be reloaded`;
25+
ui.whitelist.textContent = 'Remove from exclusions';
2626
ui.whitelist.onclick = e => {
2727
ui.whitelist.disabled = true;
2828
browser.runtime.sendMessage({

0 commit comments

Comments
 (0)