mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-10 19:46:34 +03:00
Clean from debug msgs
This commit is contained in:
parent
ec692851d4
commit
88a3810199
|
@ -12,39 +12,22 @@
|
|||
const ifIncontinence = 'if-incontinence';
|
||||
const modsKey = 'mods';
|
||||
|
||||
window.proxyHostToCredsList = {
|
||||
// One host may be used several times with different creds.
|
||||
/*
|
||||
'blablabla:6110': [
|
||||
{ username: 'foo', password: 'bar' },
|
||||
{ username: 'foo1', password: 'bar' },
|
||||
{ username: 'foo2', password: 'bar' },
|
||||
{ username: 'foo3', password: 'bar' },
|
||||
{ username: 'foo4', password: 'bar' },
|
||||
{ username: 'foo5', password: 'bar' },
|
||||
{ username: 'foo6', password: 'bar' },
|
||||
],
|
||||
*/
|
||||
};
|
||||
let proxyHostToCredsList = {};
|
||||
const ifAuthSupported = chrome.webRequest && chrome.webRequest.onAuthRequired && !window.apis.version.ifMini;
|
||||
if (ifAuthSupported) {
|
||||
|
||||
console.log('WebRequest is supported!');
|
||||
const requestIdToTries = {};
|
||||
|
||||
chrome.webRequest.onAuthRequired.addListener(
|
||||
(details) => {
|
||||
|
||||
console.log('AUTH REQUIRED.');
|
||||
if (!details.isProxy) {
|
||||
console.log('Not from proxy.');
|
||||
return {};
|
||||
}
|
||||
|
||||
const proxyHost = `${details.challenger.host}:${details.challenger.port}`;
|
||||
const credsList = proxyHostToCredsList[proxyHost];
|
||||
if (!credsList) {
|
||||
console.log('Creds list is empty.');
|
||||
return {}; // No creds found for this proxy.
|
||||
}
|
||||
const requestId = details.requestId;
|
||||
|
@ -53,7 +36,6 @@
|
|||
return {}; // All creds for this proxy were tried already.
|
||||
}
|
||||
requestIdToTries[requestId] = tries + 1;
|
||||
console.log('TRIES=', tries, 'for', requestId, 'CREDS', credsList[tries]);
|
||||
return {
|
||||
authCredentials: credsList[tries],
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user