mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-23 18:03:44 +03:00
Merge branch 'development' into production
This commit is contained in:
commit
03a113119b
|
@ -1,5 +1,8 @@
|
|||
# Install
|
||||
|
||||
Nodejs 10 and gulp have [issues](https://github.com/nodejs/node/issues/20285),
|
||||
use nodejs 8 instead for a while.
|
||||
|
||||
```
|
||||
npm install
|
||||
cd src/extension-common/pages/options/
|
||||
|
|
|
@ -1 +1 @@
|
|||
grep -r "$@" ./src --exclude-dir=vendor --exclude-dir=node_modules --exclude-dir=dist
|
||||
grep -r "$@" ./*.js ./src --exclude-dir=vendor --exclude-dir=node_modules --exclude-dir=dist
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -14,13 +14,13 @@
|
|||
"author": "Ilya Ig. Petrov",
|
||||
"license": "GPLv3",
|
||||
"devDependencies": {
|
||||
"symlink-to": "^0.0.4",
|
||||
"chai": "^3.5.0",
|
||||
"eslint": "^3.15.0",
|
||||
"eslint-config-google": "^0.7.1",
|
||||
"gulp-changed": "^3.1.0",
|
||||
"mocha": "^3.3.0",
|
||||
"sinon-chrome": "^2.2.1"
|
||||
"gulp-changed": "^3.2.0",
|
||||
"mocha": "^3.5.3",
|
||||
"sinon-chrome": "^2.3.1",
|
||||
"symlink-to": "^0.0.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"del": "^2.2.2",
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
|
||||
searchSettingsForUrl(niddle) {
|
||||
|
||||
return 'chrome://settings/search#' + (chrome.i18n.getMessage(niddle) || niddle);
|
||||
return 'chrome://settings/?search=' + (chrome.i18n.getMessage(niddle) || niddle);
|
||||
|
||||
},
|
||||
|
||||
|
|
|
@ -109,40 +109,23 @@
|
|||
|
||||
const warnings = [];
|
||||
const originalCb = cb;
|
||||
cb = (...args) => originalCb(...args, ...warnings);
|
||||
cb = (err, res, ...warns) => originalCb(err, res, ...warns, ...warnings);
|
||||
const addWarning = (wText) => { warnings.push(new Warning(wText)) };
|
||||
|
||||
// TODO: dirty hack (labels should be UI related only)
|
||||
if (provider.label === 'Антицензорити') {
|
||||
const azUrl = window.apis.antiCensorRu.pacProviders['Антизапрет'].pacUrls[0];
|
||||
console.log('HEADing antizapret...');
|
||||
let headError = null;
|
||||
const numberOfTries = 2;
|
||||
let i = 0;
|
||||
while (i++ < numberOfTries) {
|
||||
await new Promise((resolve) =>
|
||||
httpLib.head(azUrl, (err) => {
|
||||
headError = err;
|
||||
if (!headError) {
|
||||
i = numberOfTries;
|
||||
}
|
||||
resolve();
|
||||
})
|
||||
if (provider.distinctKey === 'Anticensority') {
|
||||
|
||||
const pacMods = window.apis.pacKitchen.getPacMods();
|
||||
if (!pacMods.filteredCustomsString) {
|
||||
addWarning(
|
||||
\`
|
||||
Не найдено СВОИХ прокси. Этот PAC-скрипт
|
||||
<a href="https://github.com/anticensority/runet-censorship-bypass/issues/10#issuecomment-387436191">теперь</a>
|
||||
работает только со <a href="https://rebrand.ly/ac-own-proxy">СВОИМИ прокси</a>
|
||||
(по умолчанию используется локальный <a href="https://rebrand.ly/ac-tor">TOR</a> и прокси "Антизапрет", для их отключения: Свои прокси -> откл. "Использовать прокси PAC-скрипта").
|
||||
\`,
|
||||
);
|
||||
}
|
||||
if (headError) {
|
||||
const errText = \`\${azUrl} недоступен!
|
||||
<a href="https://rebrand.ly/ac-contact">Сообщите нам</a>, если повторяется!\`;
|
||||
console.log(errText);
|
||||
//addWarning(errText); // Uncomment when needed.
|
||||
/* Do nothing for now like it's not critical. Otherwise uncomment.
|
||||
clarifyThen(
|
||||
errText,
|
||||
cb,
|
||||
)(headError);
|
||||
return;
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
httpLib.ifModifiedSince(pacUrl, lastModifiedStr, (err, newLastModifiedStr) => {
|
||||
|
@ -192,7 +175,7 @@
|
|||
'Не удалось скачать PAC-скрипт с адресов: [ '
|
||||
+ provider.pacUrls.join(' , ') + ' ].',
|
||||
cb,
|
||||
)
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
|
@ -206,6 +189,9 @@
|
|||
|
||||
pacProviders: {
|
||||
Антизапрет: {
|
||||
// Distinct keys are needed if you want to check if a given
|
||||
// provider is this or that (distinct it from others).
|
||||
distinctKey: 'Antizapret',
|
||||
label: 'Антизапрет',
|
||||
desc: \`Альтернативный PAC-скрипт от стороннего разработчика.
|
||||
Охватывет меньше сайтов.
|
||||
|
@ -215,6 +201,7 @@
|
|||
pacUrls: ['https://antizapret.prostovpn.org/proxy.pac'],
|
||||
},
|
||||
Антицензорити: {
|
||||
distinctKey: 'Anticensority',
|
||||
label: 'Антицензорити',
|
||||
desc: \`Основной PAC-скрипт от автора расширения.
|
||||
Охватывает больше сайтов.
|
||||
|
@ -230,6 +217,7 @@
|
|||
pacUrls: ${JSON.stringify(anticensorityPacUrls, null, 2)},
|
||||
},
|
||||
onlyOwnSites: {
|
||||
distinctKey: 'onlyOwnSites',
|
||||
label: 'Только свои сайты и свои прокси',
|
||||
desc: 'Проксируются только добавленные вручную сайты через СВОИ вручную добавленные прокси или через локальный Tor.',
|
||||
order: 99,
|
||||
|
@ -245,7 +233,7 @@
|
|||
|
||||
},
|
||||
|
||||
_currentPacProviderKey: 'Антицензорити',
|
||||
_currentPacProviderKey: 'Антизапрет',
|
||||
|
||||
/* Is it the first time extension installed?
|
||||
Do something, e.g. initiate PAC sync.
|
||||
|
@ -585,8 +573,45 @@
|
|||
}
|
||||
|
||||
}
|
||||
if (window.apis.version.isLeq(oldStorage.version, '0.0.1.23')) {
|
||||
|
||||
console.log('Switch to Antizapret automatically, only from Anitcensority without own proxies.');
|
||||
const provKey = antiCensorRu.getCurrentPacProviderKey();
|
||||
if (provKey !== 'Антицензорити') {
|
||||
console.log('Current provider', provKey, '!== Anticensority');
|
||||
return; // Not Anticensority.
|
||||
}
|
||||
const pacMods = window.apis.pacKitchen.getPacMods();
|
||||
if (pacMods.filteredCustomsString) {
|
||||
console.log('Proxies found:', pacMods.filteredCustomsString);
|
||||
return; // Own proxies or Tor are used.
|
||||
}
|
||||
antiCensorRu.setCurrentPacProviderKey('Антизапрет');
|
||||
await new Promise((resolveSwitch) =>
|
||||
|
||||
antiCensorRu.syncWithPacProviderAsync((err, res, warns) => {
|
||||
|
||||
if (warns) {
|
||||
console.log(warns);
|
||||
}
|
||||
if (err) {
|
||||
console.log(
|
||||
'Ungraceful update from 1.23: couldn\\'t fetch Antizapret:',
|
||||
);
|
||||
console.error(err);
|
||||
} else {
|
||||
console.log('Update from 1.23 applied successfully.');
|
||||
}
|
||||
resolveSwitch();
|
||||
|
||||
}),
|
||||
);
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
// Swallow update error.
|
||||
// Log update error.
|
||||
console.log('UPDATE ERROR:');
|
||||
console.error(e);
|
||||
}
|
||||
ifUpdatedCb();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ Use only if really required because of performance penalty.
|
|||
const location = ln.href;
|
||||
ln.onclick = function() {
|
||||
|
||||
chrome.tabs.create({active: !this.dataset.inBg, url: location});
|
||||
chrome.tabs.create({active: this.dataset.inBg === "false", url: location});
|
||||
return false;
|
||||
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,16 +5,16 @@
|
|||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.24.1",
|
||||
"babel-loader": "^7.0.0",
|
||||
"babel-plugin-dynamic-import-webpack": "^1.0.1",
|
||||
"babel-loader": "^7.1.4",
|
||||
"babel-plugin-dynamic-import-webpack": "^1.0.2",
|
||||
"babel-preset-flow": "^6.23.0",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"concat-stream": "^1.6.0",
|
||||
"concat-stream": "^1.6.2",
|
||||
"csjs-inject": "^1.0.1",
|
||||
"flow-bin": "^0.45.0",
|
||||
"inferno": "~3.2.0",
|
||||
"inferno-component": "^3.1.2",
|
||||
"inferno-create-element": "^3.1.2",
|
||||
"inferno-component": "^3.10.1",
|
||||
"inferno-create-element": "^3.10.1",
|
||||
"webpack": "^2.5.1"
|
||||
},
|
||||
"scripts": {
|
||||
|
@ -27,6 +27,6 @@
|
|||
"start": "cd .. && npm start"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-plugin-inferno": "^3.2.0"
|
||||
"babel-plugin-inferno": "^3.5.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ export default function getExceptions(theState) {
|
|||
<InfoLi
|
||||
type="checkbox"
|
||||
conf={{
|
||||
label: '<span>Собирать <a href="../errors-to-exc/index.html">последние ошибки</a> сайтов</span>',
|
||||
label: '<span>Собирать <a data-in-bg="false" href="../errors-to-exc/index.html">последние ошибки</a> сайтов</span>',
|
||||
key: 'lookupLastErrors',
|
||||
desc: 'Собирать последние ошибки в запросах, чтобы вручную добавлять избранные из них в исключения.',
|
||||
}}
|
||||
|
|
|
@ -27,7 +27,7 @@ export default function getFooter() {
|
|||
|
||||
<footer class={scopedCss.controlRow + ' horFlex nowrap'}>
|
||||
<input type="button" value="Готово" disabled={props.ifInputsDisabled} onClick={() => window.close()} />
|
||||
<a href="../troubleshoot/index.html">
|
||||
<a data-in-bg="false" href="../troubleshoot/index.html">
|
||||
Проблемы?
|
||||
</a>
|
||||
</footer>
|
||||
|
|
|
@ -12,7 +12,12 @@ export default function append(document, { flags }) {
|
|||
--cr-icon-selected: #d7d7d7;
|
||||
--cr-popup-border: #bababa;
|
||||
--cr-grey-panel: #f2f2f2;
|
||||
${ flags.ifInsideOptionsPage ? '' : 'max-width: 24em;' }
|
||||
${ flags.ifInsideOptionsPage
|
||||
// Without this prop on the next line
|
||||
// options page width may be jerking
|
||||
// in size when scrolling is showed.
|
||||
? 'width: 20em'
|
||||
: 'max-width: 24em;' }
|
||||
}
|
||||
|
||||
/* BASE ELEMENTS */
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
<body>
|
||||
<h1>Устранение проблем</h1>
|
||||
<ol>
|
||||
<li><a href id="view-errors">Детали последних ошибок</a></li>
|
||||
<li><a href id="reset-settings">Сбросить настройки</a></li>
|
||||
<li><a href="https://rebrand.ly/ac-support" target="_blank">Файл самопомощи</a></li>
|
||||
<li><a href="https://rebrand.ly/ac-contact">Напишите нам!</a></li>
|
||||
<li><a data-in-bg="false" href id="view-errors">Детали последних ошибок</a></li>
|
||||
<li><a data-in-bg="false" href id="reset-settings">Сбросить настройки</a></li>
|
||||
<li><a data-in-bg="false" href="https://rebrand.ly/ac-support" target="_blank">Файл самопомощи</a></li>
|
||||
<li><a data-in-bg="false" href="https://rebrand.ly/ac-contact">Напишите нам!</a></li>
|
||||
</ol>
|
||||
<h2>Для продвинутых</h2>
|
||||
<ol>
|
||||
<li><a href="https://rebrand.ly/ac-logs">Как прочитать логи?</a></li>
|
||||
<li><a href="../debug/index.html">Отладка PAC-скрипта</a></li>
|
||||
<li><a data-in-bg="false" href="https://rebrand.ly/ac-logs">Как прочитать логи?</a></li>
|
||||
<li><a data-in-bg="false" href="../debug/index.html">Отладка PAC-скрипта</a></li>
|
||||
</ol>
|
||||
<script src="./index.js"></script>
|
||||
<script src="../lib/keep-links-clickable.js"></script>
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
privates._strToHostObj = {
|
||||
[_antizapret.host]: _antizapret,
|
||||
[proxyForRanges]: { host: proxyForRanges },
|
||||
['localhost']: { host: 'localhost' },
|
||||
};
|
||||
|
||||
privates._ipToHostObj = {};
|
||||
|
|
|
@ -7,12 +7,10 @@ const pacUrls = [
|
|||
'\x68\x74\x74\x70\x73\x3a\x2f\x2f\x72\x61\x77\x2e\x67\x69\x74\x68\x75\x62\x75\x73\x65\x72\x63\x6f\x6e\x74\x65\x6e\x74\x2e\x63\x6f\x6d\x2f\x61\x6e\x74\x69\x63\x65\x6e\x73\x6f\x72\x69\x74\x79\x2f\x67\x65\x6e\x65\x72\x61\x74\x65\x64\x2d\x70\x61\x63\x2d\x73\x63\x72\x69\x70\x74\x73\x2f\x6d\x61\x73\x74\x65\x72\x2f\x61\x6e\x74\x69\x63\x65\x6e\x73\x6f\x72\x69\x74\x79\x2e\x70\x61\x63',
|
||||
// First official, shortened, not cached:
|
||||
'https://rebrand.ly/ac-chrome-anticensority-pac',
|
||||
// Old, deprecated:
|
||||
'https://anticensorship-russia.tk/generated-pac-scripts/anticensority.pac',
|
||||
];
|
||||
|
||||
const commonContext = {
|
||||
version: '1.23',
|
||||
version: '1.24',
|
||||
anticensorityPacUrls: [
|
||||
...pacUrls,
|
||||
],
|
||||
|
@ -57,8 +55,9 @@ exports.contexts.firefox = Object.assign({}, commonContext, {
|
|||
|
||||
exports.contexts.beta = Object.assign({}, commonContext, {
|
||||
anticensorityPacUrls: [
|
||||
'https://raw.githubusercontent.com/anticensority/for-testing/master/anticensority.pac',
|
||||
'https://anticensority.github.io/for-testing/anticensority.pac',
|
||||
'https://rebrand.ly/ac-beta-pac',
|
||||
...pacUrls,
|
||||
],
|
||||
version: '1.14',
|
||||
versionSuffix: '',
|
||||
|
|
Loading…
Reference in New Issue
Block a user