Use data-url instead of blob. Remove debug logs. Remove ccahiha.

This commit is contained in:
ilyaigpetrov 2020-10-16 15:00:09 +00:00
parent 94aefc8ddc
commit 5278c65c90
3 changed files with 3 additions and 19 deletions

View File

@ -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',

View File

@ -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,
),
);
};

View File

@ -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 }}), {