diff --git a/README.md b/README.md index 7fcaf7b..2a19453 100644 --- a/README.md +++ b/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) diff --git a/extensions/chromium/runet-censorship-bypass/README.md b/extensions/chromium/runet-censorship-bypass/README.md index f0eac61..c073363 100644 --- a/extensions/chromium/runet-censorship-bypass/README.md +++ b/extensions/chromium/runet-censorship-bypass/README.md @@ -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 diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.mjs b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.mjs index f4f777c..71c55ce 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.mjs +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.mjs @@ -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. diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/70-menu-items.mjs b/extensions/chromium/runet-censorship-bypass/src/extension-common/70-menu-items.mjs index 4fb4d43..58df574 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/70-menu-items.mjs +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/70-menu-items.mjs @@ -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, }, diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/FOR-REVIEWERS.md b/extensions/chromium/runet-censorship-bypass/src/extension-common/FOR-REVIEWERS.md new file mode 100644 index 0000000..1e5943e --- /dev/null +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/FOR-REVIEWERS.md @@ -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. \ No newline at end of file diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/README.md b/extensions/chromium/runet-censorship-bypass/src/extension-common/README.md deleted file mode 100644 index 03f3faf..0000000 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/README.md +++ /dev/null @@ -1 +0,0 @@ -Files of this directory must be copied into final build without modifications. \ No newline at end of file diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/manifest.tmpl.json b/extensions/chromium/runet-censorship-bypass/src/extension-common/manifest.tmpl.json index 720e20d..b91d621 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/manifest.tmpl.json +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/manifest.tmpl.json @@ -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}", diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/troubleshoot/index.html b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/troubleshoot/index.html index 23eada7..1c8be1d 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/troubleshoot/index.html +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/troubleshoot/index.html @@ -10,12 +10,12 @@
  1. Детали последних ошибок
  2. Сбросить настройки
  3. -
  4. Файл самопомощи
  5. -
  6. Напишите нам!
  7. +
  8. Файл самопомощи
  9. +
  10. Напишите нам!

Для продвинутых

    -
  1. Как прочитать логи?
  2. +
  3. Как прочитать логи?
  4. Отладка PAC-скрипта

@@ -23,12 +23,12 @@
  1. Details of last errors
  2. Reset settings
  3. -
  4. Troubleshoot guide (ru)
  5. -
  6. Write to us!
  7. +
  8. Troubleshoot guide (ru)
  9. +
  10. Write to us!

Advanced

    -
  1. How to read logs?
  2. +
  3. How to read logs?
  4. PAC-script debugging
diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-full/20-ip-to-host-api.mjs b/extensions/chromium/runet-censorship-bypass/src/extension-full/20-ip-to-host-api.mjs index 91197aa..e59b69d 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-full/20-ip-to-host-api.mjs +++ b/extensions/chromium/runet-censorship-bypass/src/extension-full/20-ip-to-host-api.mjs @@ -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' }, diff --git a/extensions/chromium/runet-censorship-bypass/src/templates-data.js b/extensions/chromium/runet-censorship-bypass/src/templates-data.js new file mode 100644 index 0000000..60e2b0a --- /dev/null +++ b/extensions/chromium/runet-censorship-bypass/src/templates-data.js @@ -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"', +});