From 5278c65c90e76926fdc87b17ac00300b0fe6c8a3 Mon Sep 17 00:00:00 2001 From: ilyaigpetrov Date: Fri, 16 Oct 2020 15:00:09 +0000 Subject: [PATCH] Use data-url instead of blob. Remove debug logs. Remove ccahiha. --- .../src/extension-common/35-pac-kitchen-api.js | 7 +------ ...7-sync-pac-script-with-pac-provider-api.tmpl.js | 14 ++------------ .../src/extension-full/20-ip-to-host-api.js | 1 - 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/35-pac-kitchen-api.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/35-pac-kitchen-api.js index a45d442..75103bf 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/35-pac-kitchen-api.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/35-pac-kitchen-api.js @@ -541,11 +541,9 @@ ${ ).then((details) => { - console.log('DEEETAILS:', details); // TODO: if ( details && details.levelOfControl === 'controlled_by_this_extension' ) { - console.log('TODODOODODODOD:', details); // TODO: const pac = window.utils.getProp(details, 'value.pacScript'); if (pac && pac.data) { return chrome.proxy.settings.set(details, chromified(cb)); @@ -553,7 +551,6 @@ ${ } kitchenState(ifIncontinence, true); - console.log('TYYYYPE ERRROR'); cb(null, null, new TypeError( 'Не найдено активного PAC-скрипта! Изменения будут применены при возвращении контроля настроек прокси или установке нового PAC-скрипта.' )); @@ -652,9 +649,7 @@ ${ }; if (window.apis.platform.ifFirefox) { - const autoConfigUrl = URL.createObjectURL(new Blob([cookedData], { - type: 'application/x-ns-proxy-autoconfig', - })); + const autoConfigUrl = `data:application/x-ns-proxy-autoconfig,${escape(cookedData)}`; return originalSet({ value: { proxyType: 'autoConfig', diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js index c3789fd..0dfd8c0 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js @@ -99,7 +99,6 @@ console.log('Setting chrome proxy settings...'); chrome.proxy.settings.set( { value: config }, chromified((err) => { - console.log('ERRORR?:', err); if (err) { return cb(err); } @@ -183,21 +182,18 @@ ), ), Promise.reject(), - )/* + ) .catch( clarifyThen( chrome.i18n.getMessage('FailedToDownloadPacScriptFromAddresses') + ': [ ' + provider.pacUrls.join(' , ') + ' ].', cb, ), - ) - */ + ), ); pacDataPromise.then( - (pacData) => { - setPacAsync( pacData, (err, res) => cb( @@ -206,12 +202,6 @@ ), ); }, - - clarifyThen( - chrome.i18n.getMessage('FailedToDownloadPacScriptFromAddresses') + ': [ ' - + provider.pacUrls.join(' , ') + ' ].', - cb, - ), ); }; diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-full/20-ip-to-host-api.js b/extensions/chromium/runet-censorship-bypass/src/extension-full/20-ip-to-host-api.js index a7088d7..ddc69dc 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-full/20-ip-to-host-api.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-full/20-ip-to-host-api.js @@ -75,7 +75,6 @@ privates._strToHostObj = [ // antizapret.prostovpn.org: '\x70\x72\x6f\x78\x79\x2e\x61\x6e\x74\x69\x7a\x61\x70\x72\x65\x74\x2e\x70\x72\x6f\x73\x74\x6f\x76\x70\x6e\x2e\x6f\x72\x67', // Antizapret old. - '\x63\x63\x61\x68\x69\x68\x61\x2e\x61\x6e\x74\x69\x7a\x61\x70\x72\x65\x74\x2e\x70\x72\x6f\x73\x74\x6f\x76\x70\x6e\x2e\x6f\x72\x67', // Antizapret for ranges. '\x70\x72\x6f\x78\x79\x2d\x73\x73\x6c\x2e\x61\x6e\x74\x69\x7a\x61\x70\x72\x65\x74\x2e\x70\x72\x6f\x73\x74\x6f\x76\x70\x6e\x2e\x6f\x72\x67', // Antizapret SSL. '\x70\x72\x6f\x78\x79\x2d\x6e\x6f\x73\x73\x6c\x2e\x61\x6e\x74\x69\x7a\x61\x70\x72\x65\x74\x2e\x70\x72\x6f\x73\x74\x6f\x76\x70\x6e\x2e\x6f\x72\x67', // Antizapret w/o SSL. ].reduce((acc, hostname) => Object.assign(acc, { [hostname]: { host: hostname }}), {