diff --git a/extensions/chromium/runet-censorship-bypass/extension/11-api-error-handlers.js b/extensions/chromium/runet-censorship-bypass/extension/11-api-error-handlers.js index 7aa0c55..54376ae 100644 --- a/extensions/chromium/runet-censorship-bypass/extension/11-api-error-handlers.js +++ b/extensions/chromium/runet-censorship-bypass/extension/11-api-error-handlers.js @@ -78,11 +78,14 @@ window.apis.errorHandlers = { - viewErrorVoid(err) { + viewErrorVoid(errId) { - const json = JSON.stringify(err, errorJsonReplacer, 0); + const errors = this.idToError; + const json = JSON.stringify(errors, errorJsonReplacer, 0); openAndFocus( - 'http://rebrand.ly/ac-error/?json=' + encodeURIComponent(json) + '&version=' + chrome.runtime.getManifest().version + 'http://rebrand.ly/ac-error/?json=' + encodeURIComponent(json) + + '&type=' + encodeURIComponent(errId) + + '&version=' + chrome.runtime.getManifest().version ); }, @@ -194,7 +197,7 @@ const handlers = window.apis.errorHandlers; - // INITIALIZATION + // Initialization // ============== chrome.proxy.settings.get( @@ -210,8 +213,7 @@ window.utils.messages.searchSettingsForUrl('proxy') ); } - const errors = handlers.idToError; - handlers.viewErrorVoid(errors); + handlers.viewErrorVoid(notId); }); diff --git a/extensions/chromium/runet-censorship-bypass/extension/12-api-sync-pac-script-with-pac-provider.js b/extensions/chromium/runet-censorship-bypass/extension/12-api-sync-pac-script-with-pac-provider.js index dd67a4a..8f66318 100644 --- a/extensions/chromium/runet-censorship-bypass/extension/12-api-sync-pac-script-with-pac-provider.js +++ b/extensions/chromium/runet-censorship-bypass/extension/12-api-sync-pac-script-with-pac-provider.js @@ -718,16 +718,24 @@ new Date(antiCensorRu.lastPacUpdateStamp).toLocaleString('ru-RU') ); - const ifUpdating = antiCensorRu.version !== oldStorage.version; - console.log('IF_UPD?', ifUpdating, antiCensorRu.version, 'vs', oldStorage.version); - const pushOnUpdate = () => ifUpdating ? antiCensorRu.pushToStorageAsync() : null; + /* + 1. There is no way to check that chrome.runtime.onInstalled wasn't fired + except timeout. + Otherwise we could put storage migration code only there. + 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; if (!ifUpdating) { + // LAUNCH, RELOAD, ENABLE antiCensorRu.pacProviders = oldStorage.pacProviders; console.log('Extension launched, reloaded or enabled.'); + } else { + // UPDATE & MIGRATION const key = antiCensorRu._currentPacProviderKey; if ( @@ -737,44 +745,35 @@ antiCensorRu._currentPacProviderKey = 'Антицензорити' } console.log('Extension updated.'); + } - if (!antiCensorRu.getPacProvider()) { - /* - In case of UPDATE: - 1. new providers will still be shown. - 2. new version won't be pushed to storage - */ - console.log('No PAC provider set. Do nothing.'); - return pushOnUpdate(); + if (antiCensorRu.getPacProvider()) { + + const ifAlarmTriggered = antiCensorRu.setAlarms(); + + if (ifAlarmTriggered) { + return; // Already pushed. + } + } - - /* - 1. There is no way to check that chrome.runtime.onInstalled wasn't fired - except timeout. - Otherwise we could put storage migration code only there. - 2. We have to check storage for migration before using it. - Better on each launch then on each pull. - */ - - const ifAlarmTriggered = antiCensorRu.setAlarms(); - - if (!ifAlarmTriggered) { - return pushOnUpdate(); + if( ifUpdating ) { + antiCensorRu.pushToStorageAsync(); } /* History of Changes to Storage (Migration Guide) ----------------------------------------------- Version 0.0.0.17: - * "Антиценз" removed. - * "Оба_и_на_свитчах" renamed to "Антицензорити". + * Remove "Антиценз". + * Rename "Оба_и_на_свитчах" to "Антицензорити" + * Add provider.label and provider.desc. Version 0.0.0.10: - * Added this.version. - * PacProvider.proxyIps changed from {ip -> Boolean} to {ip -> hostname}. + * Add this.version. + * Change PacProvider.proxyIps from {ip -> Boolean} to {ip -> hostname}. Version 0.0.0.8-9: - * Changed storage.ifNotInstalled to storage.ifFirstInstall. - * Added storage.lastPacUpdateStamp. + * Change storage.ifNotInstalled to storage.ifFirstInstall. + * Add storage.lastPacUpdateStamp. **/ }); diff --git a/extensions/chromium/runet-censorship-bypass/extension/manifest.json b/extensions/chromium/runet-censorship-bypass/extension/manifest.json index ff2dd1a..23a89ea 100755 --- a/extensions/chromium/runet-censorship-bypass/extension/manifest.json +++ b/extensions/chromium/runet-censorship-bypass/extension/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, - "name": "__MSG_extName__ 0.16", + "name": "__MSG_extName__ 0.17", "default_locale": "ru", "description": "__MSG_extDesc__", "version": "0.0.0.17", diff --git a/extensions/chromium/runet-censorship-bypass/extension/pages/choose-pac-provider/index.html b/extensions/chromium/runet-censorship-bypass/extension/pages/choose-pac-provider/index.html index 22bb727..9165a39 100755 --- a/extensions/chromium/runet-censorship-bypass/extension/pages/choose-pac-provider/index.html +++ b/extensions/chromium/runet-censorship-bypass/extension/pages/choose-pac-provider/index.html @@ -2,7 +2,7 @@ Выбор провайдера PAC - +