From 34c94eb3d398c3633aac30309ff647d45f8d9c68 Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Thu, 22 Dec 2016 15:49:53 +0000 Subject: [PATCH] Counter abuse, add locales, change description, add utils.messages, change disabling to warning message if no-control, add mask and grayscale icons --- .../extension/00-init-apis.js | 21 ++++++++- .../extension/11-api-error-handlers.js | 24 ++++++---- ...2-api-sync-pac-script-with-pac-provider.js | 15 ++++-- .../extension/30-block-informer.js | 3 +- .../extension/_locales/en/messages.json | 17 +++++++ .../extension/_locales/ru/messages.json | 17 +++++++ .../extension/icons/default-grayscale-128.png | Bin 0 -> 5348 bytes .../extension/icons/default-mask-128.png | Bin 0 -> 10072 bytes .../extension/manifest.json | 15 ++++-- .../pages/choose-pac-provider/index.html | 19 ++++++-- .../pages/choose-pac-provider/index.js | 37 ++++++++------- .../keep-links-clickable.js | 44 ++++++++++-------- 12 files changed, 154 insertions(+), 58 deletions(-) create mode 100644 extensions/chromium/minimalistic-pac-setter/extension/_locales/en/messages.json create mode 100644 extensions/chromium/minimalistic-pac-setter/extension/_locales/ru/messages.json create mode 100644 extensions/chromium/minimalistic-pac-setter/extension/icons/default-grayscale-128.png create mode 100644 extensions/chromium/minimalistic-pac-setter/extension/icons/default-mask-128.png diff --git a/extensions/chromium/minimalistic-pac-setter/extension/00-init-apis.js b/extensions/chromium/minimalistic-pac-setter/extension/00-init-apis.js index 3f9787c..e429962 100644 --- a/extensions/chromium/minimalistic-pac-setter/extension/00-init-apis.js +++ b/extensions/chromium/minimalistic-pac-setter/extension/00-init-apis.js @@ -4,11 +4,30 @@ window.utils = { areSettingsNotControlledFor(details) { - return ['controlled_by_other', 'not_controllable'] + return ['controlled_by_other', 'not_controllable'] .some( (prefix) => details.levelOfControl.startsWith(prefix) ); }, + messages: { + + searchSettingsUrlFor(niddle) { + + return 'chrome://settings/search#' + (chrome.i18n.getMessage(niddle) || niddle); + + }, + + whichExtensionHtml() { + + return chrome.i18n.getMessage('noControl') + + ` + ${ chrome.i18n.getMessage('which') } + `; + + }, + + }, + }; window.apis = {}; diff --git a/extensions/chromium/minimalistic-pac-setter/extension/11-api-error-handlers.js b/extensions/chromium/minimalistic-pac-setter/extension/11-api-error-handlers.js index dead60c..8346058 100644 --- a/extensions/chromium/minimalistic-pac-setter/extension/11-api-error-handlers.js +++ b/extensions/chromium/minimalistic-pac-setter/extension/11-api-error-handlers.js @@ -22,6 +22,7 @@ for(const prop in value) { if (/^[A-Z]/.test(prop)) { + console.log(prop); continue; } alt[prop] = value[prop]; @@ -80,7 +81,7 @@ viewError(err) { openAndFocus( - 'https://rebrand.ly/ac-error/?' + JSON.stringify(err, errorJsonReplacer, 0) + 'https://rebrand.ly/ac-error/?' + btoa(JSON.stringify(err, errorJsonReplacer, 0)) ); }, @@ -120,9 +121,9 @@ this.ifNotControlled = window.utils.areSettingsNotControlledFor(details); if (this.ifNotControlled) { - chrome.browserAction.disable(); + chrome.browserAction.setIcon( {path: './icons/default-grayscale-128.png'} ); } else { - chrome.browserAction.enable(); + chrome.browserAction.setIcon( {path: './icons/default-128.png'} ); } return this.ifNotControlled; @@ -150,6 +151,7 @@ requireInteraction: true, type: 'basic', iconUrl: './icons/' + icon, + appIconMaskUrl: './icons/default-mask-128.png', isClickable: true, } ); @@ -186,7 +188,9 @@ const handlers = window.apis.errorHandlers; - // INIT + // INITIALIZATION + // ============== + chrome.proxy.settings.get( {}, (details) => handlers.isNotControlled(details) @@ -196,7 +200,7 @@ chrome.notifications.clear(notId); if(notId === 'no-control') { - return openAndFocus('chrome://settings/#proxy'); + return openAndFocus( window.utils.messages.searchSettingsUrlFor('proxy') ); } const errors = handlers.idToError; handlers.viewError(errors); @@ -230,10 +234,12 @@ console.log('Proxy settings changed.', details); const noCon = 'no-control'; if ( handlers.isNotControlled(details) ) { - console.log(details); - handlers.mayNotify(noCon, 'Другое расширение контролирует прокси', - 'Какое?', - 'no-control-128.png'); + handlers.mayNotify( + noCon, + chrome.i18n.getMessage('noControl'), + chrome.i18n.getMessage('which'), + 'no-control-128.png' + ); } else { chrome.notifications.clear( noCon ); } diff --git a/extensions/chromium/minimalistic-pac-setter/extension/12-api-sync-pac-script-with-pac-provider.js b/extensions/chromium/minimalistic-pac-setter/extension/12-api-sync-pac-script-with-pac-provider.js index 05bc2d9..5dfef0f 100644 --- a/extensions/chromium/minimalistic-pac-setter/extension/12-api-sync-pac-script-with-pac-provider.js +++ b/extensions/chromium/minimalistic-pac-setter/extension/12-api-sync-pac-script-with-pac-provider.js @@ -109,8 +109,12 @@ }, }, Оба_и_на_свитчах: { - // pacUrl: 'https://drive.google.com/uc?export=download&id=0B-ZCVSvuNWf0akpCOURNS2VCTmc', // 0.14 - pacUrl: 'https://drive.google.com/uc?export=download&id=0B-ZCVSvuNWf0bzNUR2F4RF8wOU0', // 0.15 + /* + Don't use in system configs! Because Win does poor caching. + Url is encoded to counter abuse. + Version: 0.15 + */ + pacUrl: '\x68\x74\x74\x70\x73\x3a\x2f\x2f\x64\x72\x69\x76\x65\x2e\x67\x6f\x6f\x67\x6c\x65\x2e\x63\x6f\x6d\x2f\x75\x63\x3f\x65\x78\x70\x6f\x72\x74\x3d\x64\x6f\x77\x6e\x6c\x6f\x61\x64\x26\x69\x64\x3d\x30\x42\x2d\x5a\x43\x56\x53\x76\x75\x4e\x57\x66\x30\x62\x7a\x4e\x55\x52\x32\x46\x34\x52\x46\x38\x77\x4f\x55\x30', proxyHosts: ['proxy.antizapret.prostovpn.org', 'gw2.anticenz.org'], proxyIps: { '195.123.209.38': 'proxy.antizapret.prostovpn.org', @@ -267,6 +271,11 @@ }, _pacUpdatePeriodInMinutes: 12*60, + get pacUpdatePeriodInMinutes() { + + return this._pacUpdatePeriodInMinutes; + + }, setAlarms() { @@ -454,7 +463,7 @@ if ( window.utils.areSettingsNotControlledFor( details ) ) { console.warn('Failed, other extension is in control.'); - return cb({clarification: {message: 'Настройки прокси контролирует другое расширение. Какое?'}}); + return cb({clarification: {message: window.utils.messages.whichExtensionHtml() }}); } console.log('Successfuly set PAC in proxy settings..'); cb(); diff --git a/extensions/chromium/minimalistic-pac-setter/extension/30-block-informer.js b/extensions/chromium/minimalistic-pac-setter/extension/30-block-informer.js index 93f50cb..9369518 100644 --- a/extensions/chromium/minimalistic-pac-setter/extension/30-block-informer.js +++ b/extensions/chromium/minimalistic-pac-setter/extension/30-block-informer.js @@ -48,8 +48,7 @@ window.tabWithError2ip = {}; // For errors only: Error? -> Check this IP! chrome.webRequest.onErrorOccurred.addListener( (requestDetails) => isInsideTabWithIp(requestDetails) - && isProxiedAndInformed(requestDetails) - , + && isProxiedAndInformed(requestDetails), {urls: ['']} ); diff --git a/extensions/chromium/minimalistic-pac-setter/extension/_locales/en/messages.json b/extensions/chromium/minimalistic-pac-setter/extension/_locales/en/messages.json new file mode 100644 index 0000000..c9d800a --- /dev/null +++ b/extensions/chromium/minimalistic-pac-setter/extension/_locales/en/messages.json @@ -0,0 +1,17 @@ +{ + "extName": { + "message": "Runet Censorship Bypass" + }, + "extDesc": { + "message": "Circumvent Russian internet censorship:" + }, + "proxy": { + "message": "proxy" + }, + "noControl": { + "message": "Other extension controls proxy!" + }, + "which": { + "message": "Which?" + } +} diff --git a/extensions/chromium/minimalistic-pac-setter/extension/_locales/ru/messages.json b/extensions/chromium/minimalistic-pac-setter/extension/_locales/ru/messages.json new file mode 100644 index 0000000..53784a1 --- /dev/null +++ b/extensions/chromium/minimalistic-pac-setter/extension/_locales/ru/messages.json @@ -0,0 +1,17 @@ +{ + "extName": { + "message": "Обход блокировок Рунета" + }, + "extDesc": { + "message": "Обход интернет-цензуры в России:" + }, + "proxy": { + "message": "прокси" + }, + "noControl": { + "message": "Другое расширение контролирует настройки прокси!" + }, + "which": { + "message": "Какое?" + } +} diff --git a/extensions/chromium/minimalistic-pac-setter/extension/icons/default-grayscale-128.png b/extensions/chromium/minimalistic-pac-setter/extension/icons/default-grayscale-128.png new file mode 100644 index 0000000000000000000000000000000000000000..277056bd4aa386da1428e91f14ddb38fa97b16cd GIT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^_q1U`2I=I@E`&D9qRW;^(PR06| zT@kN>TR|}XXDMztO9Y*nfaKRc$RNf1K{MB)%c048 zkAwemY#eKozPa}GWG!W*NaR|6=U@2SWlA&f^0UCb{O+{Oo^{j$Z@&g%o#ldc@)VyI zFwo#DVo0E)n-mj$emIs2ku#c8B@nX$r6$|Tog4*%XHM4ie80CkWLEi)tNQzvop{`K zZ?ygXw6(KI!aW}do9pdMvkK0xJi=sVs}RVkPX0-?s@GM7;p5=rACI4dJ=b4>_q2?u zF;V}Jx+_&km`#=(Y0}$X%XfMGY#Ywt$iK|hV9ceT`Md)FQ;Xbp|9By*F16h5nw4O~M!)DX zck3lG-Nm`j=r-()12{|kNDi{ zSm@Bd%ut6`WPii2<1Apm-J3I=o#Yg!u8#TR!*5NuBao9+6tczb)hVuLmz{r4&ucmW znEth~ar%jF#(ny{nsEPBb5?1Q?~Fy6GZ(pgum`K`q6rbM({O93*!{P(6-Skm(^n4# zXdOQZJ?mlz>W8VYbxX9jJYG{b*J$2u4iyUKYQ(dL-j$=W-?lSCaDnh2lQ&DHoMj - + Выбор провайдера PAC + + +
+
Обновлялись: ...
-
Загрузка...
+ Загрузка...
Я ❤️ уведомления:
diff --git a/extensions/chromium/minimalistic-pac-setter/extension/pages/choose-pac-provider/index.js b/extensions/chromium/minimalistic-pac-setter/extension/pages/choose-pac-provider/index.js index 82f42f4..f197da4 100755 --- a/extensions/chromium/minimalistic-pac-setter/extension/pages/choose-pac-provider/index.js +++ b/extensions/chromium/minimalistic-pac-setter/extension/pages/choose-pac-provider/index.js @@ -7,17 +7,12 @@ chrome.runtime.getBackgroundPage( (backgroundPage) => const setStatusTo = (msg) => { - const status = getStatus(); - if (msg) { - status.classList.remove('off'); - status.innerHTML = msg; - } else { - status.classList.add('off'); - } + getStatus().innerHTML = msg; }; const antiCensorRu = backgroundPage.apis.antiCensorRu; + const errorHandlers = backgroundPage.apis.errorHandlers; // SET DATE @@ -26,15 +21,14 @@ chrome.runtime.getBackgroundPage( (backgroundPage) => let dateForUser = 'никогда'; if( antiCensorRu.lastPacUpdateStamp ) { let diff = Date.now() - antiCensorRu.lastPacUpdateStamp; - let units = ' мс'; + let units = 'мс'; const gauges = [ - [1000, ' с'], - [60, ' мин'], - [60, ' ч'], - [24, ' дн'], + [1000, 'с'], + [60, 'мин'], + [60, 'ч'], + [24, 'дн'], [7, ' недель'], [4, ' месяцев'], - [12, ' г'], ]; for(const g of gauges) { const diffy = Math.floor(diff / g[0]); @@ -47,7 +41,7 @@ chrome.runtime.getBackgroundPage( (backgroundPage) => } const dateElement = document.querySelector('.update-date'); - dateElement.innerText = dateForUser; + dateElement.innerText = dateForUser + ' / T=' + (antiCensorRu.pacUpdatePeriodInMinutes/60) + 'ч'; dateElement.title = new Date(antiCensorRu.lastPacUpdateStamp) .toLocaleString('ru-RU'); @@ -95,7 +89,7 @@ chrome.runtime.getBackgroundPage( (backgroundPage) => ); getStatus().querySelector('.link-button').onclick = function() { - backgroundPage.apis.errorHandlers.viewError(err); + errorHandlers.viewError(err); return false; }; @@ -180,7 +174,7 @@ chrome.runtime.getBackgroundPage( (backgroundPage) => } const conpanel = document.getElementById('list-of-handlers'); - backgroundPage.apis.errorHandlers.getEventsMap().forEach( (value, name) => { + errorHandlers.getEventsMap().forEach( (value, name) => { const li = document.createElement('li'); li.innerHTML = ` @@ -201,11 +195,22 @@ chrome.runtime.getBackgroundPage( (backgroundPage) => }); + if( errorHandlers.ifNotControlled ) { + console.log('ADDING'); + document.getElementById('which-extension').innerHTML = backgroundPage.utils.messages.whichExtensionHtml(); + document.querySelectorAll('.if-not-controlled').forEach( (node) => { + + node.style.display = 'block'; + + }); + } setStatusTo(''); + if (antiCensorRu.ifFirstInstall) { const id = antiCensorRu.currentPacProviderKey || 'none'; document.querySelector('#update-' + id).click(); } + document.documentElement.style.display = ''; }) ); diff --git a/extensions/chromium/minimalistic-pac-setter/extension/pages/choose-pac-provider/keep-links-clickable.js b/extensions/chromium/minimalistic-pac-setter/extension/pages/choose-pac-provider/keep-links-clickable.js index 31ce3c5..509abd3 100644 --- a/extensions/chromium/minimalistic-pac-setter/extension/pages/choose-pac-provider/keep-links-clickable.js +++ b/extensions/chromium/minimalistic-pac-setter/extension/pages/choose-pac-provider/keep-links-clickable.js @@ -4,31 +4,35 @@ In popup links are not clickable at all, fix it. On other pages "chrome://" links are not clickable, fix it. Use only if really required because of performance penalty. */ +{ -const target = document.getElementById('status'); + const target = document.documentElement; -const updateLinks = () => { + const updateLinks = () => { - const links = document.querySelectorAll('a:not([href=""])'); - for (let i = 0; i < links.length; i++) { - const ln = links[i]; - const location = ln.href; - ln.onclick = function() { + console.log('UPDATE'); + const links = document.querySelectorAll('a:not([href=""])'); + for (let i = 0; i < links.length; i++) { + const ln = links[i]; + const location = ln.href; + ln.onclick = function() { - chrome.tabs.create({active: !this.dataset.inBg, url: location}); - return false; + chrome.tabs.create({active: !this.dataset.inBg, url: location}); + return false; - }; - } + }; + } -}; + }; -new MutationObserver( updateLinks ) - .observe(target, { - attributes: false, - subtree: true, - childList: true, - characterData: false, - }); + new MutationObserver( updateLinks ) + .observe(target, { + attributes: true, + subtree: true, + childList: true, + characterData: false, + }); -document.addEventListener('DOMContentLoaded', updateLinks); + document.addEventListener('DOMContentLoaded', updateLinks); + +}