Skip to content

Commit 745b630

Browse files
authored
Add 'locked' attribute to stored update channels (EFForg#19308)
1 parent 362c537 commit 745b630

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

chromium/pages/options/ux.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ document.addEventListener("DOMContentLoaded", () => {
9191
});
9292
});
9393

94-
function create_update_channel_element(update_channel, last_updated, pinned) {
94+
function create_update_channel_element(update_channel, last_updated, locked) {
9595
let ruleset_version_string;
9696

9797
if(last_updated) {
@@ -126,7 +126,7 @@ document.addEventListener("DOMContentLoaded", () => {
126126
const update_channel_jwk = document.createElement('textarea');
127127
update_channel_jwk.className = "update-channel-jwk";
128128
update_channel_jwk.setAttribute("data-name", update_channel.name);
129-
update_channel_jwk.disabled = pinned;
129+
update_channel_jwk.disabled = locked;
130130
update_channel_jwk.innerText = JSON.stringify(update_channel.jwk);
131131
update_channel_jwk_column_right.appendChild(update_channel_jwk);
132132

@@ -144,7 +144,7 @@ document.addEventListener("DOMContentLoaded", () => {
144144
update_channel_path_prefix.setAttribute("type", "text");
145145
update_channel_path_prefix.className = "update-channel-path-prefix";
146146
update_channel_path_prefix.setAttribute("data-name", update_channel.name);
147-
update_channel_path_prefix.disabled = pinned;
147+
update_channel_path_prefix.disabled = locked;
148148
update_channel_path_prefix.value = update_channel.update_path_prefix;
149149
update_channel_path_prefix_column_right.appendChild(update_channel_path_prefix);
150150

@@ -166,7 +166,7 @@ document.addEventListener("DOMContentLoaded", () => {
166166
update_channel_scope.setAttribute("type", "text");
167167
update_channel_scope.className = "update-channel-scope";
168168
update_channel_scope.setAttribute("data-name", update_channel.name);
169-
update_channel_scope.disabled = pinned;
169+
update_channel_scope.disabled = locked;
170170
update_channel_scope.value = update_channel.scope;
171171
update_channel_scope_column_right.appendChild(update_channel_scope);
172172

@@ -183,13 +183,13 @@ document.addEventListener("DOMContentLoaded", () => {
183183
const update_channel_update = document.createElement('button');
184184
update_channel_update.className = "update-channel-update";
185185
update_channel_update.setAttribute("data-name", update_channel.name);
186-
update_channel_update.disabled = pinned;
186+
update_channel_update.disabled = locked;
187187
update_channel_update.innerText = chrome.i18n.getMessage("options_update");
188188
update_channel_controls_column_right.appendChild(update_channel_update);
189189
const update_channel_delete = document.createElement('button');
190190
update_channel_delete.className = "update-channel-update";
191191
update_channel_delete.setAttribute("data-name", update_channel.name);
192-
update_channel_delete.disabled = pinned;
192+
update_channel_delete.disabled = locked;
193193
update_channel_delete.innerText = chrome.i18n.getMessage("options_delete");
194194
update_channel_controls_column_right.appendChild(update_channel_delete);
195195

@@ -229,7 +229,7 @@ document.addEventListener("DOMContentLoaded", () => {
229229
create_update_channel_element(
230230
update_channel,
231231
item.last_updated[update_channel.name],
232-
true
232+
true,
233233
)
234234
);
235235

@@ -242,7 +242,7 @@ document.addEventListener("DOMContentLoaded", () => {
242242
create_update_channel_element(
243243
update_channel,
244244
item.last_updated[update_channel.name],
245-
false
245+
update_channel.locked === true,
246246
)
247247
);
248248
}

docs/en_US/ruleset-update-channels.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Update channels can be found in [`chromium/background-scripts/update_channels.js
2929
2. A `jwk` object, which defines the RSA public key to use when verifying downloaded rulesets
3030
3. A `update_path_prefix` string, which tells the extension where to look for new rulesets
3131
4. A `scope` string, which is used to construct a JavaScript `RegExp` object
32+
5. A `replaces_default_rulesets` boolean, which tells the extension whether to overwrite the rulesets bundled with the extension
3233

3334
Every 24 hours, the extension checks the URL contained in `update_path_prefix` appended with `/latest-rulesets-timestamp` (in the case of `EFF (Full)`, `https://www.https-rulesets.org/v1//latest-rulesets-timestamp`). If it discovers the timestamp has updated since the last time it fetched the rulesets, it will download a new ruleset, following the format `update_path_prefix` appended with `default.rulesets.XXXXXXXXXX.gz`, where `XXXXXXXXXX` is the timestamp discovered in the previous request. At the same time, a corresponding signature for that file is downloaded, `update_path_prefix` appended with `rulesets-signature.XXXXXXXXXX.sha256`, again with the timestamp replacing the `XXXXXXXXXX`.
3435

0 commit comments

Comments
 (0)