Merge branch 'development' into to-esm-modules

This commit is contained in:
ilyaigpetrov 2023-05-02 21:15:17 +05:00
commit 7dc4330320
10 changed files with 173 additions and 36 deletions

View File

@ -17,14 +17,16 @@ This extension uses pac scripts, one of which (anticensority) is generated by th
## Install / Установка ## Install / Установка
1. [Chrome Web Store](https://rebrand.ly/ac-webstore) 1. [Chrome Web Store](https://chrome.google.com/webstore/detail/обход-блокировок-рунета/npgcnondjocldhldegnakemclmfkngch)
2. [Chrome Web Store (MINI)](https://rebrand.ly/ac-webstore-mini) 2. [Chrome Web Store (MINI)](https://chrome.google.com/webstore/detail/обход-блокировок-рунета-м/gnknjnebjldmkpmlhjipalimhjofpgho)
3. [Microsoft Edge Add-ons](https://rebrand.ly/ac-msstore) 3. [Microsoft Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/обход-блокировок-рунета/ajgpnodjpffiagcfmifildjpoaeiobfh)
4. [Microsoft Edge Add-ons (MINI)](https://rebrand.ly/ac-msstore-mini) 4. [Microsoft Edge Add-ons (MINI)](https://microsoftedge.microsoft.com/addons/detail/обход-блокировок-рунета-м/cjppllmpmkpjfchbaoebeneghcbmlibj)
5. [FireFox Add-ons (Beta)](https://rebrand.ly/ac-firefox) 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 выше. 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. 7. Пакеты для автономной (offline) установки: https://github.com/anticensority/runet-censorship-bypass/releases.
Из-за блокировок адресов Google расширение может не устанавливаться из WebStore. Подробности и способы установки см. https://github.com/anticensority/runet-censorship-bypass/wiki/Автономная-установка-расширения.
## Why I do This ## Why I do This
See [my arguments against censorship (ru)](https://rebrand.ly/ac-arguments) See [my arguments against censorship (ru)](https://rebrand.ly/ac-arguments)

View File

@ -23,19 +23,7 @@ npm start
# For Reviewers # For Reviewers
Steps to reproduce the same zip: See ./src/extension-common/FOR-REVIEWERS.md.
```
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.
# Release Instructions # Release Instructions

View File

@ -136,7 +136,10 @@
if (err) { if (err) {
if (err.message === 'proxy.settings requires private browsing permission.') { 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'); // 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( clarifyThen(
chrome.i18n.getMessage('AllowExtensionToRunInPrivateglobalThiss'), chrome.i18n.getMessage('AllowExtensionToRunInPrivateglobalThiss'),
cb, cb,
@ -274,6 +277,8 @@
\`, \`,
order: 0, order: 0,
pacUrls: [ pacUrls: [
'https://antizapret.prostovpn.org:8443/proxy.pac',
'https://antizapret.prostovpn.org:18443/proxy.pac',
'https://antizapret.prostovpn.org/proxy.pac', 'https://antizapret.prostovpn.org/proxy.pac',
'https://rebrand.ly/ac-antizapret-pac', 'https://rebrand.ly/ac-antizapret-pac',
], ],
@ -586,6 +591,7 @@
'handlers-ext-error', 'handlers-ext-error',
'handlers-no-control', '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) { if (!Object.keys(oldAntiCensorRu).length) {
const storage = await globalThis.utils.promisedLocalStorage.get(null); 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 Event handlers that ALWAYS work (even if installation is not done
or failed). or failed).
@ -704,6 +712,7 @@
console.log('Updating from', oldAntiCensorRu.version, 'to', antiCensorRu.version); console.log('Updating from', oldAntiCensorRu.version, 'to', antiCensorRu.version);
try { 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')) { if (globalThis.apis.version.isLeq(oldAntiCensorRu.version, '0.0.1.5')) {
// Change semicolons to semicolons followed by newlines in proxy string (raw). // 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) { } catch (e) {
// Log update error. // Log update error.

View File

@ -27,7 +27,7 @@
otherUnblock: { otherUnblock: {
title: 'Разблокировать по-другому', title: 'Разблокировать по-другому',
getUrl: (blockedUrl) => ('https://rebrand.ly/ac-unblock#' + blockedUrl), getUrl: (blockedUrl) => ('https://anticensority.github.io/unblock#' + blockedUrl),
order: 3, order: 3,
}, },
@ -39,7 +39,7 @@
support: { support: {
title: 'Документация / Помощь / Поддержка', title: 'Документация / Помощь / Поддержка',
getUrl: (blockedUrl) => 'https://git.io/ac-wiki', getUrl: (blockedUrl) => 'https://github.com/anticensority/runet-censorship-bypass/wiki',
order: 99, order: 99,
}, },

View File

@ -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.

View File

@ -1 +0,0 @@
Files of this directory must be copied into final build without modifications.

View File

@ -30,16 +30,28 @@
"strict_min_version": "91.1.0" "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},
=======
"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}": { "${action}": {
"default_title": "Этот сайт благословлён | Версия ${version + versionSuffix}", "default_title": "Этот сайт благословлён | Версия ${version + versionSuffix}",

View File

@ -10,12 +10,12 @@
<ol> <ol>
<li><a data-in-bg="false" href class="view-errors">Детали последних ошибок</a></li> <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 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://github.com/anticensority/runet-censorship-bypass/wiki/Если-расширение-не-работает" 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://groups.google.com/g/anticensority">Напишите нам!</a></li>
</ol> </ol>
<h2>Для продвинутых</h2> <h2>Для продвинутых</h2>
<ol> <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> <li><a data-in-bg="false" href="../debug/index.html">Отладка PAC-скрипта</a></li>
</ol> </ol>
<hr/> <hr/>
@ -23,12 +23,12 @@
<ol> <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="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 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://github.com/anticensority/runet-censorship-bypass/wiki/Если-расширение-не-работает" 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://groups.google.com/g/anticensority">Write to us!</a></li>
</ol> </ol>
<h2>Advanced</h2> <h2>Advanced</h2>
<ol> <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> <li><a data-in-bg="false" href="../debug/index.html">PAC-script debugging</a></li>
</ol> </ol>
<script src="./index.js"></script> <script src="./index.js"></script>

View File

@ -75,6 +75,7 @@
'proxy.antizapret.prostovpn.org', 'proxy.antizapret.prostovpn.org',
'proxy-ssl.antizapret.prostovpn.org', 'proxy-ssl.antizapret.prostovpn.org',
'proxy-nossl.antizapret.prostovpn.org', 'proxy-nossl.antizapret.prostovpn.org',
'proxy-fbtw-ssl.antizapret.prostovpn.org',
].reduce((acc, hostname) => Object.assign(acc, { [hostname]: { host: hostname }}), { ].reduce((acc, hostname) => Object.assign(acc, { [hostname]: { host: hostname }}), {
// Defaults: // Defaults:
localhost: { host: 'localhost' }, localhost: { host: 'localhost' },

View File

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