mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2025-03-01 10:20:32 +03:00
Merge branch 'development' into to-esm-modules
This commit is contained in:
commit
7dc4330320
README.md
extensions/chromium/runet-censorship-bypass
README.md
src
extension-common
37-sync-pac-script-with-pac-provider-api.tmpl.mjs70-menu-items.mjsFOR-REVIEWERS.mdREADME.mdmanifest.tmpl.json
pages/troubleshoot
extension-full
templates-data.js
12
README.md
12
README.md
|
@ -17,14 +17,16 @@ This extension uses pac scripts, one of which (anticensority) is generated by th
|
|||
|
||||
## Install / Установка
|
||||
|
||||
1. [Chrome Web Store](https://rebrand.ly/ac-webstore)
|
||||
2. [Chrome Web Store (MINI)](https://rebrand.ly/ac-webstore-mini)
|
||||
3. [Microsoft Edge Add-ons](https://rebrand.ly/ac-msstore)
|
||||
4. [Microsoft Edge Add-ons (MINI)](https://rebrand.ly/ac-msstore-mini)
|
||||
5. [FireFox Add-ons (Beta)](https://rebrand.ly/ac-firefox)
|
||||
1. [Chrome Web Store](https://chrome.google.com/webstore/detail/обход-блокировок-рунета/npgcnondjocldhldegnakemclmfkngch)
|
||||
2. [Chrome Web Store (MINI)](https://chrome.google.com/webstore/detail/обход-блокировок-рунета-м/gnknjnebjldmkpmlhjipalimhjofpgho)
|
||||
3. [Microsoft Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/обход-блокировок-рунета/ajgpnodjpffiagcfmifildjpoaeiobfh)
|
||||
4. [Microsoft Edge Add-ons (MINI)](https://microsoftedge.microsoft.com/addons/detail/обход-блокировок-рунета-м/cjppllmpmkpjfchbaoebeneghcbmlibj)
|
||||
5. [FireFox Add-ons (Beta)](https://addons.mozilla.org/ru/firefox/addon/обход-блокировок-рунета/)
|
||||
6. Opera: сначала [установщик расширений из WebStore](https://addons.opera.com/ru/extensions/details/install-chrome-extensions/) (от команды Opera), затем см. пункты 1 и 2 выше.
|
||||
7. Пакеты для автономной (offline) установки: https://github.com/anticensority/runet-censorship-bypass/releases.
|
||||
|
||||
Из-за блокировок адресов Google расширение может не устанавливаться из WebStore. Подробности и способы установки см. https://github.com/anticensority/runet-censorship-bypass/wiki/Автономная-установка-расширения.
|
||||
|
||||
## Why I do This
|
||||
|
||||
See [my arguments against censorship (ru)](https://rebrand.ly/ac-arguments)
|
||||
|
|
|
@ -23,19 +23,7 @@ npm start
|
|||
|
||||
# For Reviewers
|
||||
|
||||
Steps to reproduce the same zip:
|
||||
```
|
||||
npm ci
|
||||
cd src/extension-common/pages/options/
|
||||
npm ci
|
||||
cd -
|
||||
npm start
|
||||
# See ./build/extension-full
|
||||
cd ./build/extension-full
|
||||
zip -r runet-censorship-bypass-full.zip ./*
|
||||
```
|
||||
|
||||
https://antizapret.prostovpn.org/proxy.pac is generated by https://bitbucket.org/anticensority/antizapret-pac-generator-light/, reviewers may find justifications related to this PAC-script in that repo.
|
||||
See ./src/extension-common/FOR-REVIEWERS.md.
|
||||
|
||||
# Release Instructions
|
||||
|
||||
|
|
|
@ -136,7 +136,10 @@
|
|||
|
||||
if (err) {
|
||||
if (err.message === 'proxy.settings requires private browsing permission.') {
|
||||
<<<<<<< HEAD:extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.mjs
|
||||
// globalThis.utils.openAndFocus('https://rebrand.ly/ac-allow-private-globalThiss');
|
||||
=======
|
||||
>>>>>>> development:extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js
|
||||
clarifyThen(
|
||||
chrome.i18n.getMessage('AllowExtensionToRunInPrivateglobalThiss'),
|
||||
cb,
|
||||
|
@ -228,7 +231,7 @@
|
|||
);
|
||||
return (ifUnattended
|
||||
? tryPromiseSeveralTimesAsync(tryAllUrlsAsync, [20, 40, 60])
|
||||
: tryAllUrlsAsync()
|
||||
: tryAllUrlsAsync()
|
||||
).catch(
|
||||
(err) => Promise.reject(clarify(
|
||||
err,
|
||||
|
@ -274,6 +277,8 @@
|
|||
\`,
|
||||
order: 0,
|
||||
pacUrls: [
|
||||
'https://antizapret.prostovpn.org:8443/proxy.pac',
|
||||
'https://antizapret.prostovpn.org:18443/proxy.pac',
|
||||
'https://antizapret.prostovpn.org/proxy.pac',
|
||||
'https://rebrand.ly/ac-antizapret-pac',
|
||||
],
|
||||
|
@ -586,6 +591,7 @@
|
|||
'handlers-ext-error',
|
||||
'handlers-no-control',
|
||||
];
|
||||
<<<<<<< HEAD:extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.mjs
|
||||
|
||||
if (!Object.keys(oldAntiCensorRu).length) {
|
||||
const storage = await globalThis.utils.promisedLocalStorage.get(null);
|
||||
|
@ -614,6 +620,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
=======
|
||||
>>>>>>> development:extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js
|
||||
/*
|
||||
Event handlers that ALWAYS work (even if installation is not done
|
||||
or failed).
|
||||
|
@ -704,6 +712,7 @@
|
|||
|
||||
console.log('Updating from', oldAntiCensorRu.version, 'to', antiCensorRu.version);
|
||||
try {
|
||||
<<<<<<< HEAD:extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.mjs
|
||||
if (globalThis.apis.version.isLeq(oldAntiCensorRu.version, '0.0.1.5')) {
|
||||
|
||||
// Change semicolons to semicolons followed by newlines in proxy string (raw).
|
||||
|
@ -752,6 +761,15 @@
|
|||
}),
|
||||
);
|
||||
|
||||
=======
|
||||
if (window.apis.version.isLeq(oldAntiCensorRu.version, '0.0.1.57')) {
|
||||
const azWithPort = 'https://antizapret.prostovpn.org:8443/proxy.pac';
|
||||
const azWithPortAlt = 'https://antizapret.prostovpn.org:18443/proxy.pac';
|
||||
const urls = window.apis.antiCensorRu.pacProviders['Антизапрет'].pacUrls;
|
||||
urls[0] = 'https://antizapret.prostovpn.org/proxy.pac';
|
||||
urls.unshift(azWithPort, azWithPortAlt);
|
||||
console.log('Successfully updated to 0.0.1.58.');
|
||||
>>>>>>> development:extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js
|
||||
}
|
||||
} catch (e) {
|
||||
// Log update error.
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
otherUnblock: {
|
||||
title: 'Разблокировать по-другому',
|
||||
getUrl: (blockedUrl) => ('https://rebrand.ly/ac-unblock#' + blockedUrl),
|
||||
getUrl: (blockedUrl) => ('https://anticensority.github.io/unblock#' + blockedUrl),
|
||||
order: 3,
|
||||
},
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
|||
|
||||
support: {
|
||||
title: 'Документация / Помощь / Поддержка',
|
||||
getUrl: (blockedUrl) => 'https://git.io/ac-wiki',
|
||||
getUrl: (blockedUrl) => 'https://github.com/anticensority/runet-censorship-bypass/wiki',
|
||||
order: 99,
|
||||
},
|
||||
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
# For Reviewers
|
||||
|
||||
## Prerequirements
|
||||
|
||||
You need a globally installed `gulp-cli@2.3.0`.
|
||||
See https://gulpjs.com/docs/en/getting-started/quick-start#install-the-gulp-command-line-utility.
|
||||
|
||||
## Steps
|
||||
|
||||
Steps to reproduce the same zip:
|
||||
```
|
||||
npm ci
|
||||
cd src/extension-common/pages/options/
|
||||
npm ci
|
||||
cd -
|
||||
npm start
|
||||
# See ./build/extension-full
|
||||
cd ./build/extension-full
|
||||
zip -r runet-censorship-bypass-full.zip ./*
|
||||
```
|
||||
|
||||
## Minified Files
|
||||
|
||||
### Ace Editor
|
||||
|
||||
https://ace.c9.io -> https://github.com/ajaxorg/ace -> Building Ace -> "The ace-builds repository endeavours to maintain the latest build" -> https://github.com/ajaxorg/ace-builds/ -> Select tag of 1.2.5, open https://github.com/ajaxorg/ace-builds/tree/v1.2.5/src-min and download the files you want to check.
|
||||
|
||||
|
||||
```
|
||||
mkdir downloaded
|
||||
cd downloaded
|
||||
wget https://raw.githubusercontent.com/ajaxorg/ace-builds/v1.2.5/src-min/ace.js
|
||||
wget https://raw.githubusercontent.com/ajaxorg/ace-builds/v1.2.5/src-min/ext-searchbox.js
|
||||
wget https://raw.githubusercontent.com/ajaxorg/ace-builds/v1.2.5/src-min/mode-javascript.js
|
||||
wget https://raw.githubusercontent.com/ajaxorg/ace-builds/v1.2.5/src-min/worker-javascript.js
|
||||
|
||||
downloaded$ for i in ./*; do md5sum "$i"; done
|
||||
2b9a1157bb3ba711a0402b6751d9ac71 ./ace.js
|
||||
1f73efaff2853571af0e701c5e9a15ee ./ext-searchbox.js
|
||||
e5eebd85c4e66667c28f124e6a07e3ed ./mode-javascript.js
|
||||
f0d1342102d16ab7abe319b2683d10ea ./worker-javascript.js
|
||||
```
|
||||
|
||||
## PAC-Script AntiZapret
|
||||
|
||||
https://antizapret.prostovpn.org/proxy.pac is generated by https://bitbucket.org/anticensority/antizapret-pac-generator-light/, reviewers may find justifications related to this PAC-script in that repo.
|
|
@ -1 +0,0 @@
|
|||
Files of this directory must be copied into final build without modifications.
|
|
@ -30,16 +30,28 @@
|
|||
"strict_min_version": "91.1.0"
|
||||
}
|
||||
},
|
||||
"commands": {
|
||||
"toggle-pac-script": {
|
||||
"suggested_key": {
|
||||
"default": "Alt+P"
|
||||
},
|
||||
"description": "Turn on/off current PAC-script"
|
||||
}
|
||||
},
|
||||
|
||||
<<<<<<< HEAD
|
||||
${background},
|
||||
=======
|
||||
"background": {
|
||||
${persistent}
|
||||
"scripts": [
|
||||
"00-init-apis.js"
|
||||
${scripts_0x}
|
||||
, "11-error-handlers-api.js"
|
||||
, "12-errors-lib.js"
|
||||
, "13-http-lib.js"
|
||||
, "15-firefox-proxy-settings.js"
|
||||
${scripts_2x}
|
||||
, "35-pac-kitchen-api.js"
|
||||
, "37-sync-pac-script-with-pac-provider-api.js"
|
||||
${scripts_8x}
|
||||
, "70-menu-items.js"
|
||||
, "75-context-menus.js"
|
||||
]
|
||||
},
|
||||
>>>>>>> development
|
||||
|
||||
"${action}": {
|
||||
"default_title": "Этот сайт благословлён | Версия ${version + versionSuffix}",
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
<ol>
|
||||
<li><a data-in-bg="false" href class="view-errors">Детали последних ошибок</a></li>
|
||||
<li><a data-in-bg="false" href class="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>
|
||||
<li><a data-in-bg="false" href="https://github.com/anticensority/runet-censorship-bypass/wiki/Если-расширение-не-работает" target="_blank">Файл самопомощи</a></li>
|
||||
<li><a data-in-bg="false" href="https://groups.google.com/g/anticensority">Напишите нам!</a></li>
|
||||
</ol>
|
||||
<h2>Для продвинутых</h2>
|
||||
<ol>
|
||||
<li><a data-in-bg="false" href="https://rebrand.ly/ac-logs">Как прочитать логи?</a></li>
|
||||
<li><a data-in-bg="false" href="https://github.com/anticensority/runet-censorship-bypass/wiki/Как-прочитать-логи%3F-%28для-продвинутых%29">Как прочитать логи?</a></li>
|
||||
<li><a data-in-bg="false" href="../debug/index.html">Отладка PAC-скрипта</a></li>
|
||||
</ol>
|
||||
<hr/>
|
||||
|
@ -23,12 +23,12 @@
|
|||
<ol>
|
||||
<li><a data-in-bg="false" href class="view-errors">Details of last errors</a></li>
|
||||
<li><a data-in-bg="false" href class="reset-settings">Reset settings</a></li>
|
||||
<li><a data-in-bg="false" href="https://rebrand.ly/ac-support" target="_blank">Troubleshoot guide (ru)</a></li>
|
||||
<li><a data-in-bg="false" href="https://rebrand.ly/ac-contact">Write to us!</a></li>
|
||||
<li><a data-in-bg="false" href="https://github.com/anticensority/runet-censorship-bypass/wiki/Если-расширение-не-работает" target="_blank">Troubleshoot guide (ru)</a></li>
|
||||
<li><a data-in-bg="false" href="https://groups.google.com/g/anticensority">Write to us!</a></li>
|
||||
</ol>
|
||||
<h2>Advanced</h2>
|
||||
<ol>
|
||||
<li><a data-in-bg="false" href="https://rebrand.ly/ac-logs">How to read logs?</a></li>
|
||||
<li><a data-in-bg="false" href="https://github.com/anticensority/runet-censorship-bypass/wiki/Как-прочитать-логи%3F-%28для-продвинутых%29">How to read logs?</a></li>
|
||||
<li><a data-in-bg="false" href="../debug/index.html">PAC-script debugging</a></li>
|
||||
</ol>
|
||||
<script src="./index.js"></script>
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
'proxy.antizapret.prostovpn.org',
|
||||
'proxy-ssl.antizapret.prostovpn.org',
|
||||
'proxy-nossl.antizapret.prostovpn.org',
|
||||
'proxy-fbtw-ssl.antizapret.prostovpn.org',
|
||||
].reduce((acc, hostname) => Object.assign(acc, { [hostname]: { host: hostname }}), {
|
||||
// Defaults:
|
||||
localhost: { host: 'localhost' },
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
'use strict';
|
||||
|
||||
const pacUrls = [
|
||||
// GitHub.io (anticensority), cached:
|
||||
'https://anticensority.github.io/generated-pac-scripts/anticensority.pac',
|
||||
// GitHub repo (anticensority), cached:
|
||||
'https://raw.githubusercontent.com/anticensority/generated-pac-scripts/master/anticensority.pac',
|
||||
// First official, shortened, not cached:
|
||||
'https://rebrand.ly/ac-chrome-anticensority-pac',
|
||||
];
|
||||
|
||||
const commonContext = {
|
||||
version: '1.60',
|
||||
anticensorityPacUrls: [
|
||||
...pacUrls,
|
||||
],
|
||||
};
|
||||
|
||||
exports.contexts = {};
|
||||
|
||||
const extra_permissions = ', "webRequest", "webRequestBlocking", "webNavigation"';
|
||||
|
||||
exports.contexts.full = Object.assign({}, commonContext, {
|
||||
versionSuffix: '',
|
||||
nameSuffixEn: '',
|
||||
nameSuffixRu: '',
|
||||
extra_permissions,
|
||||
persistent: '',
|
||||
scripts_0x: '',
|
||||
scripts_2x: ', "20-ip-to-host-api.js"',
|
||||
scripts_8x: ', "80-error-menu.js", "83-last-errors.js", "85-block-informer.js"',
|
||||
});
|
||||
|
||||
exports.contexts.mini = Object.assign({}, commonContext, {
|
||||
versionSuffix: '-mini',
|
||||
nameSuffixEn: ' MINI',
|
||||
nameSuffixRu: ' МИНИ',
|
||||
extra_permissions: '',
|
||||
persistent: '"persistent": false,',
|
||||
scripts_0x: '',
|
||||
scripts_2x: ', "20-for-mini-only.js"',
|
||||
scripts_8x: '',
|
||||
});
|
||||
|
||||
exports.contexts.firefox = Object.assign({}, commonContext, {
|
||||
versionSuffix: '',
|
||||
nameSuffixEn: '',
|
||||
nameSuffixRu: '',
|
||||
extra_permissions,
|
||||
persistent: '',
|
||||
scripts_0x: ', "01-chrome-proxy-settings.js"',
|
||||
scripts_2x: ', "20-ip-to-host-api.js"',
|
||||
scripts_8x: ', "80-error-menu.js", "83-last-errors.js", "85-block-informer.js"',
|
||||
});
|
||||
|
||||
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',
|
||||
],
|
||||
version: '1.14',
|
||||
versionSuffix: '',
|
||||
nameSuffixEn: ' FOR TESTING',
|
||||
nameSuffixRu: ' ДЛЯ ТЕСТОВ',
|
||||
extra_permissions,
|
||||
persistent: '',
|
||||
scripts_0x: '',
|
||||
scripts_2x: ', "20-ip-to-host-api.js"',
|
||||
scripts_8x: ', "80-error-menu.js", "83-last-errors.js", "85-block-informer.js"',
|
||||
});
|
Loading…
Reference in New Issue
Block a user