mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2025-02-07 15:20:36 +03:00
Restyle
This commit is contained in:
parent
f98c81ff84
commit
44af8bd85a
|
@ -11,7 +11,9 @@
|
|||
const modsKey = 'mods';
|
||||
|
||||
let proxyHostToCredsList = {};
|
||||
const ifAuthSupported = chrome.webRequest && chrome.webRequest.onAuthRequired && !globalThis.apis.version.ifMini;
|
||||
const ifAuthSupported = chrome.webRequest &&
|
||||
chrome.webRequest.onAuthRequired &&
|
||||
!globalThis.apis.version.ifMini;
|
||||
if (ifAuthSupported) {
|
||||
|
||||
const requestIdToTries = {};
|
||||
|
@ -202,8 +204,8 @@
|
|||
.reduce((arr, key) => {
|
||||
|
||||
const conf = configs[key];
|
||||
if(typeof(conf.order) === 'number') {
|
||||
if(!category || category === (conf.category || 'general')) {
|
||||
if (typeof(conf.order) === 'number') {
|
||||
if (!category || category === (conf.category || 'general')) {
|
||||
conf.value = pacMods[key];
|
||||
conf.key = key;
|
||||
conf.category = category || 'general';
|
||||
|
@ -229,7 +231,8 @@
|
|||
Boolean(configs[dProp].dflt) !== Boolean(mods[dProp])
|
||||
)
|
||||
);
|
||||
const ifMods = configs[dProp].ifDfltMods; // If default value implies PAC-script modification.
|
||||
const ifMods = configs[dProp].ifDfltMods;
|
||||
// If default value implies PAC-script modification.
|
||||
return ifDflt ? !ifMods : ifMods;
|
||||
|
||||
});
|
||||
|
@ -279,7 +282,7 @@
|
|||
}
|
||||
|
||||
proxyHostToCredsList = {};
|
||||
protectedProxies.forEach(({ hostname, port, username, password }) => {
|
||||
protectedProxies.forEach(({hostname, port, username, password}) => {
|
||||
|
||||
proxyHostToCredsList[`${hostname}:${port}`] =
|
||||
proxyHostToCredsList[`${hostname}:${port}`] || [];
|
||||
|
@ -317,7 +320,7 @@
|
|||
if (self.ifMindExceptions && self.exceptions) {
|
||||
self.included = [];
|
||||
self.excluded = [];
|
||||
for(const host of Object.keys(self.exceptions)) {
|
||||
for (const host of Object.keys(self.exceptions)) {
|
||||
const ifProxy = self.exceptions[host] || false;
|
||||
if (ifProxy) {
|
||||
self.included.push(host);
|
||||
|
@ -335,7 +338,7 @@
|
|||
});
|
||||
if (self.included.length && !self.filteredCustomsString) {
|
||||
return [null, self, new TypeError(
|
||||
'Имеются сайты, добавленные вручную. Они проксироваться не будут, т.к. нет СВОИХ проски, удовлетворяющих вашим требованиям! Если прокси всё же имеются, то проверьте требования (модификаторы).'
|
||||
'Имеются сайты, добавленные вручную. Они проксироваться не будут, т.к. нет СВОИХ проски, удовлетворяющих вашим требованиям! Если прокси всё же имеются, то проверьте требования (модификаторы).',
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
@ -353,7 +356,7 @@
|
|||
|
||||
pacData = pacData.replace(
|
||||
new RegExp(kitchenStartsMark + '[\\s\\S]*$', 'g'),
|
||||
''
|
||||
'',
|
||||
);
|
||||
/a/.test('a'); // GC RegExp.input and friends.
|
||||
|
||||
|
@ -470,9 +473,9 @@
|
|||
/******/ return "DIRECT";
|
||||
/******/ }
|
||||
/******/ // Always proxy it!
|
||||
${ pacMods.filteredCustomsString
|
||||
? `/******/ return filteredCustomProxies + "; " + directIfAllowed;`
|
||||
: '/******/ /* No custom proxies -- continue. */'
|
||||
${ pacMods.filteredCustomsString ?
|
||||
`/******/ return filteredCustomProxies + "; " + directIfAllowed;` :
|
||||
'/******/ /* No custom proxies -- continue. */'
|
||||
}
|
||||
/******/ }
|
||||
/******/ /* EXCEPTIONS END */
|
||||
|
@ -484,7 +487,7 @@ ${ pacMods.filteredCustomsString
|
|||
? '.replace(/DIRECT/g, "")'
|
||||
: ' + "; " + directIfAllowed'
|
||||
};`;
|
||||
if(
|
||||
if (
|
||||
!pacMods.ifUseSecureProxiesOnly &&
|
||||
!pacMods.filteredCustomsString &&
|
||||
pacMods.ifUsePacScriptProxies
|
||||
|
@ -502,9 +505,9 @@ ${ pacMods.filteredCustomsString
|
|||
/******/ return "DIRECT";
|
||||
/******/ }
|
||||
/******/ return ` +
|
||||
((pacMods.filteredCustomsString && !pacMods.ifUseOwnProxiesOnlyForOwnSites)
|
||||
? 'filteredCustomProxies + "; " + '
|
||||
: ''
|
||||
((pacMods.filteredCustomsString && !pacMods.ifUseOwnProxiesOnlyForOwnSites) ?
|
||||
'filteredCustomProxies + "; " + ' :
|
||||
''
|
||||
) +
|
||||
function() {
|
||||
|
||||
|
@ -525,9 +528,9 @@ ${ pacMods.filteredCustomsString
|
|||
|
||||
/******/ };
|
||||
${
|
||||
!pacMods.replaceDirectWith
|
||||
? ''
|
||||
: `
|
||||
!pacMods.replaceDirectWith ?
|
||||
'' :
|
||||
`
|
||||
/******/ const oldTmp = tmp;
|
||||
/******/ tmp = function(url, host) {
|
||||
/******/ const ip = dnsResolve(host);
|
||||
|
@ -579,9 +582,9 @@ ${
|
|||
|
||||
new Promise((resolve) =>
|
||||
|
||||
details
|
||||
? resolve(details)
|
||||
: chrome.proxy.settings.get({}, timeouted(resolve) ),
|
||||
details ?
|
||||
resolve(details) :
|
||||
chrome.proxy.settings.get({}, timeouted(resolve) ),
|
||||
|
||||
).then((details) => {
|
||||
|
||||
|
@ -606,7 +609,11 @@ ${
|
|||
checkIncontinence(details) {
|
||||
|
||||
if ( kitchenState(ifIncontinence) ) {
|
||||
this.setNowAsync(details, (err) => { if (err) { throw err; } }); // TODO: suppress?
|
||||
this.setNowAsync(details, (err) => {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
}); // TODO: suppress?
|
||||
}
|
||||
|
||||
},
|
||||
|
|
|
@ -8,7 +8,7 @@ import getApp from './components/App';
|
|||
|
||||
chrome.runtime.getBackgroundPage( (bgWindow) =>
|
||||
bgWindow.apis.errorHandlers.installListenersOn(
|
||||
window, 'PUP', async() => {
|
||||
window, 'PUP', async () => {
|
||||
/*
|
||||
`Extension context invalidated` error is thrown if `window.closed` is true and call to
|
||||
`window.chrome.i18n` or other `window.chrome` api happens. Use bgWindow.chrome instead.
|
||||
|
|
Loading…
Reference in New Issue
Block a user