Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chromium/background-scripts/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async function getRulesetTimestamps() {
for(let update_channel of combined_update_channels) {
timestamp_promises.push(new Promise(async resolve => {
let timestamp = await store.local.get_promise('rulesets-stored-timestamp: ' + update_channel.name, 0);
resolve([update_channel.name, timestamp]);
resolve([update_channel, timestamp]);
}));
}
let timestamps = await Promise.all(timestamp_promises);
Expand Down
19 changes: 15 additions & 4 deletions chromium/pages/popup/ux.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,27 @@ document.addEventListener("DOMContentLoaded", function () {
version_info.innerText = the_manifest.version;

let rulesets_versions = e('rulesets-versions');

rulesets_versions.addSpan = function(update_channel_name, ruleset_version_string) {
let timestamp_span = document.createElement("span");
timestamp_span.className = "rulesets-version";
timestamp_span.innerText = `${chrome.i18n.getMessage("about_rulesets_version")} ${update_channel_name}: ${ruleset_version_string}`;
this.appendChild(timestamp_span);
}

sendMessage("get_ruleset_timestamps", null, timestamps => {
let replaces = timestamps.some(([update_channel, timestamp]) =>
update_channel.replaces_default_rulesets && timestamp > 0
);
if(!replaces) {
rulesets_versions.addSpan("EFF (Full, Bundled)", the_manifest.version);
}
for(let [update_channel, timestamp] of timestamps) {
if(timestamp > 0) {
let ruleset_date = new Date(timestamp * 1000);
let ruleset_version_string = ruleset_date.getUTCFullYear() + "." + (ruleset_date.getUTCMonth() + 1) + "." + ruleset_date.getUTCDate();

let timestamp_span = document.createElement("span");
timestamp_span.className = "rulesets-version";
timestamp_span.innerText = chrome.i18n.getMessage("about_rulesets_version") + " " + update_channel + ": " + ruleset_version_string;
rulesets_versions.appendChild(timestamp_span);
rulesets_versions.addSpan(update_channel.name, ruleset_version_string);
}
}
});
Expand Down