mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-27 20:03:45 +03:00
Keep update date in title
This commit is contained in:
parent
8ea949ac9d
commit
696983f863
|
@ -188,6 +188,7 @@
|
|||
window.apis = {
|
||||
version: {
|
||||
ifMini: false,
|
||||
build: chrome.runtime.getManifest().version.replace(/\d+\.\d+\./g, ''),
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
|
||||
const ifPrefix = 'if-on-';
|
||||
const extName = chrome.runtime.getManifest().name;
|
||||
const extVersion = chrome.runtime.getManifest().version.replace(/\d+\.\d+\./g, '');
|
||||
const extVersion = window.apis.version.build;
|
||||
|
||||
window.apis.errorHandlers = {
|
||||
|
||||
|
|
|
@ -225,6 +225,16 @@
|
|||
ifFirstInstall: false,
|
||||
lastPacUpdateStamp: 0,
|
||||
|
||||
setTitle() {
|
||||
|
||||
const upDate = new Date(this.lastPacUpdateStamp).toLocaleString('ru-RU')
|
||||
.replace(/:\d+$/, '');
|
||||
chrome.browserAction.setTitle({
|
||||
title: `Обновлялись ${upDate} | Версия ${window.apis.version.build}`,
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
_currentPacProviderLastModified: 0, // Not initialized.
|
||||
|
||||
getLastModifiedForKey(key = mandatory()) {
|
||||
|
@ -331,6 +341,7 @@
|
|||
this.lastPacUpdateStamp = Date.now();
|
||||
this.ifFirstInstall = false;
|
||||
this.setAlarms();
|
||||
this.setTitle();
|
||||
}
|
||||
|
||||
resolve([err, null, ...warns]);
|
||||
|
@ -509,10 +520,10 @@
|
|||
2. We have to check storage for migration before using it.
|
||||
Better on each launch then on each pull.
|
||||
*/
|
||||
const ifUpdating = antiCensorRu.version !== oldStorage.version;
|
||||
|
||||
await new Promise((resolve) => {
|
||||
|
||||
const ifUpdating = antiCensorRu.version !== oldStorage.version;
|
||||
if (!ifUpdating) {
|
||||
|
||||
// LAUNCH, RELOAD, ENABLE
|
||||
|
@ -549,6 +560,7 @@
|
|||
if (antiCensorRu.getPacProvider()) {
|
||||
antiCensorRu.setAlarms();
|
||||
}
|
||||
antiCensorRu.setTitle();
|
||||
|
||||
/*
|
||||
History of Changes to Storage (Migration Guide)
|
||||
|
|
Loading…
Reference in New Issue
Block a user