mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-24 02:13:43 +03:00
Add troubleshoot, no debug, lint, visual changes
This commit is contained in:
parent
c6d0de4798
commit
bcf647d684
|
@ -1,5 +1,5 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"extends": ["eslint:recommended", "google"],
|
"extends": ["google"],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
//"hapi"
|
//"hapi"
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const IF_DEBUG = true;
|
const IF_DEBUG = false;
|
||||||
|
|
||||||
if (!IF_DEBUG) {
|
if (!IF_DEBUG) {
|
||||||
// I believe logging objects precludes them from being GCed.
|
// I believe logging objects precludes them from being GCed.
|
||||||
|
@ -8,13 +8,24 @@ if (!IF_DEBUG) {
|
||||||
// (though no one sent me logs so far).
|
// (though no one sent me logs so far).
|
||||||
['log', 'warn', 'error'].forEach( (meth) => {
|
['log', 'warn', 'error'].forEach( (meth) => {
|
||||||
const _meth = window.console[meth].bind(console);
|
const _meth = window.console[meth].bind(console);
|
||||||
window.console[meth] = function(...args) { _meth(...args.map((a) => '' + a)) }
|
window.console[meth] = function(...args) {
|
||||||
|
|
||||||
|
_meth(...args.map((a) => '' + a));
|
||||||
|
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
window.utils = {
|
window.utils = {
|
||||||
|
|
||||||
|
mandatory() {
|
||||||
|
|
||||||
|
throw new TypeError('Missing required argument. ' +
|
||||||
|
'Be explicit if you swallow errors.');
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
areSettingsNotControlledFor(details) {
|
areSettingsNotControlledFor(details) {
|
||||||
|
|
||||||
return ['controlled_by_other', 'not_controllable']
|
return ['controlled_by_other', 'not_controllable']
|
||||||
|
|
|
@ -78,13 +78,18 @@
|
||||||
|
|
||||||
window.apis.errorHandlers = {
|
window.apis.errorHandlers = {
|
||||||
|
|
||||||
viewErrorVoid(errId) {
|
viewErrorVoid(type = window.utils.mandatory(), err) {
|
||||||
|
|
||||||
const errors = this.idToError;
|
let errors = {};
|
||||||
|
if (err) {
|
||||||
|
errors[type] = err;
|
||||||
|
} else {
|
||||||
|
errors = this.idToError;
|
||||||
|
}
|
||||||
const json = JSON.stringify(errors, errorJsonReplacer, 0);
|
const json = JSON.stringify(errors, errorJsonReplacer, 0);
|
||||||
openAndFocus(
|
openAndFocus(
|
||||||
'http://rebrand.ly/ac-error/?json=' + encodeURIComponent(json) +
|
'http://rebrand.ly/ac-error/?json=' + encodeURIComponent(json) +
|
||||||
'&type=' + encodeURIComponent(errId) +
|
(type ? '&type=' + encodeURIComponent(type) : '') +
|
||||||
'&version=' + chrome.runtime.getManifest().version
|
'&version=' + chrome.runtime.getManifest().version
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -142,7 +147,7 @@
|
||||||
{
|
{
|
||||||
icon = 'default-128.png',
|
icon = 'default-128.png',
|
||||||
context = extName,
|
context = extName,
|
||||||
ifSticky = true
|
ifSticky = true,
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
@ -248,7 +253,7 @@
|
||||||
noCon,
|
noCon,
|
||||||
chrome.i18n.getMessage('noControl'),
|
chrome.i18n.getMessage('noControl'),
|
||||||
chrome.i18n.getMessage('which'),
|
chrome.i18n.getMessage('which'),
|
||||||
{icon:'no-control-128.png', ifSticky: false}
|
{icon: 'no-control-128.png', ifSticky: false}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
chrome.notifications.clear( noCon );
|
chrome.notifications.clear( noCon );
|
||||||
|
|
|
@ -21,12 +21,7 @@
|
||||||
|
|
||||||
{ // Private namespace starts.
|
{ // Private namespace starts.
|
||||||
|
|
||||||
const mandatory = function mandatory() {
|
const mandatory = window.utils.mandatory;
|
||||||
|
|
||||||
throw new TypeError('Missing required argument. ' +
|
|
||||||
'Be explicit if you swallow errors.');
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
const throwIfError = function throwIfError(err) {
|
const throwIfError = function throwIfError(err) {
|
||||||
|
|
||||||
|
@ -99,7 +94,10 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const clarify = function clarify(err = mandatory(), message = mandatory(), {data} = {}) {
|
const clarify = function clarify(
|
||||||
|
err = mandatory(),
|
||||||
|
message = mandatory(),
|
||||||
|
{data} = {}) {
|
||||||
|
|
||||||
err.clarification = new Clarification(message, err.clarification);
|
err.clarification = new Clarification(message, err.clarification);
|
||||||
if (data) {
|
if (data) {
|
||||||
|
@ -144,8 +142,7 @@
|
||||||
|
|
||||||
console.warn('Failed, other extension is in control.');
|
console.warn('Failed, other extension is in control.');
|
||||||
return cb(
|
return cb(
|
||||||
null, null,
|
new Warning( window.utils.messages.whichExtensionHtml() )
|
||||||
[new Warning( window.utils.messages.whichExtensionHtml() )]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -163,17 +160,22 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const clarifyFetchErrorThen = (cb) => clarifyErrorThen('Что-то не так с сетью, проверьте соединение.', cb);
|
const clarifyFetchErrorThen = (cb) =>
|
||||||
|
clarifyErrorThen('Что-то не так с сетью, проверьте соединение.', cb);
|
||||||
|
|
||||||
const ifModifiedSince = function ifModifiedSince(url = mandatory(), lastModified = mandatory(), cb = mandatory()) {
|
const ifModifiedSince = function ifModifiedSince(
|
||||||
|
url = mandatory(),
|
||||||
|
lastModified = mandatory(),
|
||||||
|
cb = mandatory()
|
||||||
|
) {
|
||||||
|
|
||||||
const wasModified = new Date(0).toUTCString();
|
const wasModified = new Date(0).toUTCString();
|
||||||
const notModifiedCode = 304;
|
const notModifiedCode = 304;
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: 'HEAD',
|
method: 'HEAD',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'If-Modified-Since': lastModified
|
'If-Modified-Since': lastModified,
|
||||||
})
|
}),
|
||||||
}).then(
|
}).then(
|
||||||
(res) => {
|
(res) => {
|
||||||
cb(
|
cb(
|
||||||
|
@ -242,7 +244,10 @@
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
err = clarify(e, 'Сервер (текст): ' + res, err ? {data: err} : null)
|
err = clarify(
|
||||||
|
e,
|
||||||
|
'Сервер (текст): ' + res, err ? {data: err} : null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resolve([err, res]);
|
resolve([err, res]);
|
||||||
|
@ -271,7 +276,10 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const updatePacProxyIps = function updatePacProxyIps(provider, cb = throwIfError) {
|
const updatePacProxyIps = function updatePacProxyIps(
|
||||||
|
provider,
|
||||||
|
cb = throwIfError
|
||||||
|
) {
|
||||||
|
|
||||||
cb = asyncLogGroup(
|
cb = asyncLogGroup(
|
||||||
'Getting IP for '+ provider.proxyHosts.join(', ') + '...',
|
'Getting IP for '+ provider.proxyHosts.join(', ') + '...',
|
||||||
|
@ -312,7 +320,7 @@
|
||||||
);
|
);
|
||||||
errorsCount === hostsProcessed
|
errorsCount === hostsProcessed
|
||||||
? cb(failure)
|
? cb(failure)
|
||||||
: cb(null, null, [failure])
|
: cb(null, null, [failure]);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -335,7 +343,10 @@
|
||||||
return cb(
|
return cb(
|
||||||
null,
|
null,
|
||||||
{lastModified},
|
{lastModified},
|
||||||
[new Warning('Ваш PAC-скрипт не нуждается в обновлении. Его дата: ' + lastModified)]
|
[new Warning(
|
||||||
|
'Ваш PAC-скрипт не нуждается в обновлении. Его дата: ' +
|
||||||
|
lastModified
|
||||||
|
)]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,8 +392,6 @@
|
||||||
|
|
||||||
version: chrome.runtime.getManifest().version,
|
version: chrome.runtime.getManifest().version,
|
||||||
|
|
||||||
throwAsync() { throw new Error('ABC') }, // TODO: delete
|
|
||||||
|
|
||||||
pacProviders: {
|
pacProviders: {
|
||||||
Антизапрет: {
|
Антизапрет: {
|
||||||
label: 'Антизапрет',
|
label: 'Антизапрет',
|
||||||
|
@ -404,8 +413,9 @@
|
||||||
Антицензорити: {
|
Антицензорити: {
|
||||||
label: 'Антицензорити',
|
label: 'Антицензорити',
|
||||||
desc: 'Основной PAC-скрипт от автора расширения.' +
|
desc: 'Основной PAC-скрипт от автора расширения.' +
|
||||||
' Блокировка определятся по доменному имени или IP адресу. Работает на switch-ах.' +
|
' Блокировка определятся по доменному имени или IP адресу.' +
|
||||||
' <br/><a href="https://rebrand.ly/ac-wiki">Страница проекта</a>.',
|
' Работает на switch-ах. <br/>' +
|
||||||
|
' <a href="https://rebrand.ly/anticensority">Страница проекта</a>.',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Don't use in system configs! Because Windows does poor caching.
|
Don't use in system configs! Because Windows does poor caching.
|
||||||
|
@ -416,11 +426,11 @@
|
||||||
// Official, Cloud Flare with caching:
|
// Official, Cloud Flare with caching:
|
||||||
'https://anticensorship-russia.tk/generated-pac-scripts/anticensority.pac',
|
'https://anticensorship-russia.tk/generated-pac-scripts/anticensority.pac',
|
||||||
// GitHub.io:
|
// GitHub.io:
|
||||||
'\x68\x74\x74\x70\x73\x3a\x2f\x2f\x61\x6e\x74\x69\x63\x65\x6e\x73\x6f\x72\x73\x68\x69\x70\x2d\x72\x75\x73\x73\x69\x61\x2e\x67\x69\x74\x68\x75\x62\x2e\x69\x6f\x2f\x67\x65\x6e\x65\x72\x61\x74\x65\x64\x2d\x70\x61\x63\x2d\x73\x63\x72\x69\x70\x74\x73\x2f\x61\x6e\x74\x69\x63\x65\x6e\x73\x6f\x72\x69\x74\x79\x2e\x70\x61\x63',
|
'\x68\x74\x74\x70\x73\x3a\x2f\x2f\x61\x6e\x74\x69\x63\x65\x6e\x73\x6f\x72\x73\x68\x69\x70\x2d\x72\x75\x73\x73\x69\x61\x2e\x67\x69\x74\x68\x75\x62\x2e\x69\x6f\x2f\x67\x65\x6e\x65\x72\x61\x74\x65\x64\x2d\x70\x61\x63\x2d\x73\x63\x72\x69\x70\x74\x73\x2f\x61\x6e\x74\x69\x63\x65\x6e\x73\x6f\x72\x69\x74\x79\x2e\x70\x61\x63', // eslint-disable-line max-len
|
||||||
// GitHub repo:
|
// GitHub repo:
|
||||||
'\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\x73\x68\x69\x70\x2d\x72\x75\x73\x73\x69\x61\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',
|
'\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\x73\x68\x69\x70\x2d\x72\x75\x73\x73\x69\x61\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', // eslint-disable-line max-len
|
||||||
// Google Drive (0.17):
|
// Google Drive (0.17):
|
||||||
'\x68\x74\x74\x70\x73\x3a\x2f\x2f\x64\x72\x69\x76\x65\x2e\x67\x6f\x6f\x67\x6c\x65\x2e\x63\x6f\x6d\x2f\x75\x63\x3f\x65\x78\x70\x6f\x72\x74\x3d\x64\x6f\x77\x6e\x6c\x6f\x61\x64\x26\x69\x64\x3d\x30\x42\x2d\x5a\x43\x56\x53\x76\x75\x4e\x57\x66\x30\x54\x44\x46\x52\x4f\x47\x35\x46\x62\x55\x39\x4f\x64\x44\x67'],
|
'\x68\x74\x74\x70\x73\x3a\x2f\x2f\x64\x72\x69\x76\x65\x2e\x67\x6f\x6f\x67\x6c\x65\x2e\x63\x6f\x6d\x2f\x75\x63\x3f\x65\x78\x70\x6f\x72\x74\x3d\x64\x6f\x77\x6e\x6c\x6f\x61\x64\x26\x69\x64\x3d\x30\x42\x2d\x5a\x43\x56\x53\x76\x75\x4e\x57\x66\x30\x54\x44\x46\x52\x4f\x47\x35\x46\x62\x55\x39\x4f\x64\x44\x67'], // eslint-disable-line max-len
|
||||||
proxyHosts: ['proxy.antizapret.prostovpn.org'],
|
proxyHosts: ['proxy.antizapret.prostovpn.org'],
|
||||||
proxyIps: {
|
proxyIps: {
|
||||||
'195.123.209.38': 'proxy.antizapret.prostovpn.org',
|
'195.123.209.38': 'proxy.antizapret.prostovpn.org',
|
||||||
|
@ -479,7 +489,10 @@
|
||||||
return this._currentPacProviderKey;
|
return this._currentPacProviderKey;
|
||||||
|
|
||||||
},
|
},
|
||||||
setCurrentPacProviderKey(newKey = mandatory(), lastModified = new Date().toUTCString()) {
|
setCurrentPacProviderKey(
|
||||||
|
newKey = mandatory(),
|
||||||
|
lastModified = new Date().toUTCString()
|
||||||
|
) {
|
||||||
|
|
||||||
this.mustBeKey(newKey);
|
this.mustBeKey(newKey);
|
||||||
this._currentPacProviderKey = newKey;
|
this._currentPacProviderKey = newKey;
|
||||||
|
@ -742,7 +755,7 @@
|
||||||
key !== null &&
|
key !== null &&
|
||||||
!Object.keys(antiCensorRu.pacProviders).includes(key)
|
!Object.keys(antiCensorRu.pacProviders).includes(key)
|
||||||
) {
|
) {
|
||||||
antiCensorRu._currentPacProviderKey = 'Антицензорити'
|
antiCensorRu._currentPacProviderKey = 'Антицензорити';
|
||||||
}
|
}
|
||||||
console.log('Extension updated.');
|
console.log('Extension updated.');
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,6 @@
|
||||||
input:checked ~ .checked-radio-panel {
|
input:checked ~ .checked-radio-panel {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
footer {
|
|
||||||
margin: 2em 1em 1em;
|
|
||||||
}
|
|
||||||
hr {
|
hr {
|
||||||
border-width: 1px 0 0 0;
|
border-width: 1px 0 0 0;
|
||||||
margin: 0.6em 0;
|
margin: 0.6em 0;
|
||||||
|
@ -62,70 +59,21 @@
|
||||||
li.provider {
|
li.provider {
|
||||||
display: table;
|
display: table;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.desc i {
|
.desc i {
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
/* Source: https://jsfiddle.net/greypants/zgCb7/ */
|
/* Source: https://jsfiddle.net/greypants/zgCb7/ */
|
||||||
.tooltip {
|
|
||||||
display: none;
|
|
||||||
white-space: initial;
|
|
||||||
padding: 1em;
|
|
||||||
}
|
|
||||||
.desc {
|
.desc {
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
color: var(--ribbon-color);
|
color: var(--ribbon-color);
|
||||||
cursor: help;
|
cursor: help;
|
||||||
|
width: 1%;
|
||||||
}
|
}
|
||||||
.desc:hover br .tooltip {
|
.tooltip {
|
||||||
display: block;
|
|
||||||
text-align: left;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
right: 2.6em;
|
|
||||||
background-color: var(--ribbon-color);
|
|
||||||
color: white;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
.tooltip a {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* CSS Triangles - courtesy of Trevor */
|
|
||||||
.desc .tooltip:after {
|
|
||||||
border-top: solid transparent 7px;
|
|
||||||
border-bottom: solid transparent 7px;
|
|
||||||
border-left: solid var(--ribbon-color) 7px;
|
|
||||||
right: -7px;
|
|
||||||
content: "";
|
|
||||||
width: 0;
|
|
||||||
top: 7px;
|
|
||||||
margin-top: -13px;
|
|
||||||
position: absolute;
|
|
||||||
height: 0;
|
|
||||||
}
|
|
||||||
/* This bridges the gap so you can mouse into the tooltip without it disappearing
|
|
||||||
.desc .tooltip:before {
|
|
||||||
position: absolute;
|
|
||||||
right: -14px;
|
|
||||||
content: " ";
|
|
||||||
display: block;
|
|
||||||
width: 14px;
|
|
||||||
top: 0;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
li.provider {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.xyz {
|
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
white-space: initial;
|
white-space: initial;
|
||||||
|
@ -139,31 +87,35 @@
|
||||||
color: white;
|
color: white;
|
||||||
text-align: initial;
|
text-align: initial;
|
||||||
}
|
}
|
||||||
.desc:hover .xyz {
|
.desc:hover .tooltip {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.xyz a {
|
.tooltip a {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
.desc .xyz:after {
|
.desc .tooltip:after {
|
||||||
border-left: solid transparent 7px;
|
border-left: solid transparent 0.5em;
|
||||||
border-bottom: solid var(--ribbon-color) 7px;
|
border-bottom: solid var(--ribbon-color) 0.5em;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -7px;
|
top: -0.5em;
|
||||||
content: "";
|
content: "";
|
||||||
width: 0;
|
width: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
}
|
}
|
||||||
/* This bridges the gap so you can mouse into the tooltip without it disappearing */
|
/* This bridges the gap so you can mouse into the tooltip without it disappearing */
|
||||||
.desc .xyz:before {
|
.desc .tooltip:before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -14px;
|
top: -1em;
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
height: 22px;
|
height: 1.8em;
|
||||||
left: 0;
|
left: 75%;
|
||||||
width: calc(100% + 0.6em);
|
width: calc(25% + 0.6em);
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
margin: 2em 0 1em 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
@ -185,10 +137,13 @@
|
||||||
<ul id="list-of-handlers">
|
<ul id="list-of-handlers">
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer style="display: table; width: 100%;">
|
||||||
<input type="button" value="Готово" class="close-button"> <a href="../debug/index.html" style="text-decoration: none; margin-left: 1em;">Отладка</a>
|
<input type="button" value="Готово" class="close-button" style="display: table-cell">
|
||||||
|
<a href="../troubleshoot/index.html" style="text-decoration: none; margin-left: 1em; display: table-cell; text-align: right;">
|
||||||
|
Проблемы?
|
||||||
|
</a>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="./index.js"></script>
|
<script src="./index.js"></script>
|
||||||
<script src="./keep-links-clickable.js"></script>
|
<script src="../lib/keep-links-clickable.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
chrome.runtime.getBackgroundPage( (backgroundPage) =>
|
chrome.runtime.getBackgroundPage( (backgroundPage) =>
|
||||||
backgroundPage.apis.errorHandlers.installListenersOnAsync(
|
backgroundPage.apis.errorHandlers.installListenersOnAsync(
|
||||||
window, 'POPUP', () => {
|
window, 'PUP', () => {
|
||||||
|
|
||||||
const getStatus = () => document.querySelector('#status');
|
const getStatus = () => document.querySelector('#status');
|
||||||
|
|
||||||
|
@ -72,7 +72,10 @@ chrome.runtime.getBackgroundPage( (backgroundPage) =>
|
||||||
|
|
||||||
warns = warns || [];
|
warns = warns || [];
|
||||||
const warning = warns
|
const warning = warns
|
||||||
.map( (w) => '✘ ' + (w.clarification && w.clarification.message || w.message || '') )
|
.map(
|
||||||
|
(w) => '✘ ' +
|
||||||
|
(w.clarification && w.clarification.message || w.message || '')
|
||||||
|
)
|
||||||
.join('<br/>');
|
.join('<br/>');
|
||||||
|
|
||||||
let message = '';
|
let message = '';
|
||||||
|
@ -81,7 +84,8 @@ chrome.runtime.getBackgroundPage( (backgroundPage) =>
|
||||||
message = err.message || '';
|
message = err.message || '';
|
||||||
|
|
||||||
while( clarification ) {
|
while( clarification ) {
|
||||||
message = (clarification && (clarification.message + ' ')) + message;
|
message = (clarification && (clarification.message + ' ')) +
|
||||||
|
message;
|
||||||
clarification = clarification.prev;
|
clarification = clarification.prev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,7 +104,7 @@ chrome.runtime.getBackgroundPage( (backgroundPage) =>
|
||||||
if (err) {
|
if (err) {
|
||||||
getStatus().querySelector('.link-button').onclick = function() {
|
getStatus().querySelector('.link-button').onclick = function() {
|
||||||
|
|
||||||
errorHandlers.viewErrorVoid(err);
|
errorHandlers.viewErrorVoid('pup-ext-err', err);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -149,11 +153,9 @@ chrome.runtime.getBackgroundPage( (backgroundPage) =>
|
||||||
<a href class="link-button checked-radio-panel"
|
<a href class="link-button checked-radio-panel"
|
||||||
id="update-${providerKey}"> [обновить]</a>
|
id="update-${providerKey}"> [обновить]</a>
|
||||||
<div class="desc">
|
<div class="desc">
|
||||||
<i class="fa fa-question-circle" aria-hidden="true"></i>
|
<i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||||
<div class="tooltip">${provider.desc}</div>
|
<div class="tooltip">${provider.desc}</div>
|
||||||
<div class="xyz">${provider.desc}</div>
|
</div>`;
|
||||||
</div>
|
|
||||||
`
|
|
||||||
li.querySelector('.link-button').onclick =
|
li.querySelector('.link-button').onclick =
|
||||||
() => {
|
() => {
|
||||||
conduct(
|
conduct(
|
||||||
|
@ -173,7 +175,9 @@ chrome.runtime.getBackgroundPage( (backgroundPage) =>
|
||||||
radio.onclick = function(event) {
|
radio.onclick = function(event) {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
event.target.id === (antiCensorRu.getCurrentPacProviderKey() || 'none')
|
event.target.id === (
|
||||||
|
antiCensorRu.getCurrentPacProviderKey() || 'none'
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Устранение проблем</title>
|
||||||
|
</head>
|
||||||
|
<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>
|
||||||
|
</ol>
|
||||||
|
<h2>Для продвинутых</h2>
|
||||||
|
<ol>
|
||||||
|
<li><a href="https://rebrand.ly/ac-logs">Как прочитать логи?</a></li>
|
||||||
|
<li><a href="../debug/index.html">Отладка PAC-скрипта</a></li>
|
||||||
|
</ol>
|
||||||
|
<script src="./index.js"></script>
|
||||||
|
<script src="../lib/keep-links-clickable.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,18 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
chrome.runtime.getBackgroundPage( (backgroundPage) =>
|
||||||
|
backgroundPage.apis.errorHandlers.installListenersOnAsync(
|
||||||
|
window, 'TRBL', () => {
|
||||||
|
|
||||||
|
document.getElementById('reset-settings').onclick = () => {
|
||||||
|
|
||||||
|
backgroundPage.localStorage.clear();
|
||||||
|
chrome.storage.local.clear( () => chrome.runtime.reload() );
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
document.getElementById('view-errors').onclick = () =>
|
||||||
|
backgroundPage.apis.errorHandlers.viewErrorVoid('all');
|
||||||
|
|
||||||
|
})
|
||||||
|
);
|
Loading…
Reference in New Issue
Block a user