From a4b83d100c329cf19899de6ddfbb5d848559a3ed Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Tue, 26 Jan 2016 21:05:23 +0500 Subject: [PATCH] better startup logs --- .../sync-pac-script-with-pac-provider.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/extensions/chromium/minimalistic-pac-setter/extnesion/sync-pac-script-with-pac-provider.js b/extensions/chromium/minimalistic-pac-setter/extnesion/sync-pac-script-with-pac-provider.js index be66b8e..0ee7f42 100755 --- a/extensions/chromium/minimalistic-pac-setter/extnesion/sync-pac-script-with-pac-provider.js +++ b/extensions/chromium/minimalistic-pac-setter/extnesion/sync-pac-script-with-pac-provider.js @@ -68,7 +68,7 @@ window.antiCensorRu = { for(var key of Object.keys(storage)) this[key] = storage[key]; - console.log('Pulled from storage, any callback?', !!cb); + console.log('Synced with storage, any callback?', !!cb); if (cb) cb(chrome.runtime.lastError, storage); }); @@ -146,17 +146,25 @@ window.storageSyncedPromise.then( } } ); - console.log('Installed alarm listener.'); + console.log('Alarm listener installed. We won\'t miss any PAC update.'); + + chrome.alarms.get( + window.antiCensorRu._periodicUpdateAlarmReason, + alarm => alarm && console.log( + 'Next update is scheduled on', new Date(alarm.scheduledTime).toLocaleString('ru-RU') + ) + ); } ); chrome.runtime.onInstalled.addListener( details => { - console.log('Installing, reason:', details.reason); + console.log('Extension just installed, reason:', details.reason); window.storageSyncedPromise.then( storage => { switch(details.reason) { case 'update': - window.antiCensorRu.installPac(); + console.log('Ah, it\'s just an update or reload. Do nothing.'); + //window.antiCensorRu.installPac(); break; case 'install': window.antiCensorRu.ifNotInstalled = true;