diff --git a/extensions/chromium/runet-censorship-bypass/extension/11-api-error-handlers.js b/extensions/chromium/runet-censorship-bypass/extension/11-api-error-handlers.js index ab42735..1fbc973 100644 --- a/extensions/chromium/runet-censorship-bypass/extension/11-api-error-handlers.js +++ b/extensions/chromium/runet-censorship-bypass/extension/11-api-error-handlers.js @@ -47,7 +47,7 @@ } - const openAndFocus = (url) => { + const openAndFocus = function openAndFocus(url) { chrome.tabs.create( {url: url}, diff --git a/extensions/chromium/runet-censorship-bypass/extension/15-api-sync-pac-script-with-pac-provider.js b/extensions/chromium/runet-censorship-bypass/extension/15-api-sync-pac-script-with-pac-provider.js index a1beec4..55da50b 100644 --- a/extensions/chromium/runet-censorship-bypass/extension/15-api-sync-pac-script-with-pac-provider.js +++ b/extensions/chromium/runet-censorship-bypass/extension/15-api-sync-pac-script-with-pac-provider.js @@ -225,13 +225,13 @@ return cb(v4err, v4res); } const ips = v4res; - let warns = null; + let warns = []; if (!v6err) { ips.push(...v6res); } else { warns = [v6err]; } - cb(null, ips, warns); + cb(null, ips, ...warns); } ); @@ -254,7 +254,7 @@ provider.proxyHosts.forEach( (proxyHost) => getIpsFor( proxyHost, - (err, ips, warns) => { + (err, ips, ...warns) => { if (!err) { provider.proxyIps = provider.proxyIps || {}; @@ -262,7 +262,7 @@ (ip) => provider.proxyIps[ip] = proxyHost ); } - if (err || warns) { + if (err || warns.length) { failure.errors[proxyHost] = err || warns; } @@ -282,7 +282,7 @@ ); errorsCount === hostsProcessed ? cb(failure) - : cb(null, null, [failure]); + : cb(null, null, failure); } ) ); @@ -305,10 +305,10 @@ return cb( null, {lastModified}, - [new Warning( + new Warning( 'Ваш PAC-скрипт не нуждается в обновлении. Его дата: ' + lastModified - )] + ) ); } @@ -519,7 +519,7 @@ (resolve, reject) => setPacScriptFromProviderAsync( pacProvider, this.getLastModifiedForKey(key), - (err, res, warns) => { + (err, res, ...warns) => { if (!err) { this.setCurrentPacProviderKey(key, res.lastModified); @@ -528,7 +528,7 @@ this.setAlarms(); } - resolve([err, null, warns]); + resolve([err, null, ...warns]); } ) @@ -542,17 +542,17 @@ ); Promise.all([pacSetPromise, ipsErrorPromise]).then( - ([[pacErr, pacRes, pacWarns], ipsErr]) => { + ([[pacErr, pacRes, ...pacWarns], ipsErr]) => { if (pacErr && ipsErr) { return cb(pacErr, pacRes); } - let warns = [...(pacWarns || []), ipsErr].filter( (_) => _ ); - if (!warns.length) { - warns = null; + const warns = pacWarns; + if (ipsErr) { + warns.push(ipsErr) } this.pushToStorageAsync( - (pushErr) => cb(pacErr || pushErr, null, warns) + (pushErr) => cb(pacErr || pushErr, null, ...warns) ); }, diff --git a/extensions/chromium/runet-censorship-bypass/extension/20-api-fixes.js b/extensions/chromium/runet-censorship-bypass/extension/20-api-fixes.js index 4fe6358..18b51ec 100644 --- a/extensions/chromium/runet-censorship-bypass/extension/20-api-fixes.js +++ b/extensions/chromium/runet-censorship-bypass/extension/20-api-fixes.js @@ -4,7 +4,8 @@ (e.g. popup) to background window, so we may catch errors in bg error handlers. More: https://bugs.chromium.org/p/chromium/issues/detail?id=357568 - setTimeout is applied to Async methods only (name ends with Async) + setTimeout is applied to Async/Void methods + only (name ends with Async/Void) */ // Fix error context of methods of all APIs. diff --git a/extensions/chromium/runet-censorship-bypass/extension/pages/choose-pac-provider/index.html b/extensions/chromium/runet-censorship-bypass/extension/pages/choose-pac-provider/index.html index 24663cf..4e5b6d5 100755 --- a/extensions/chromium/runet-censorship-bypass/extension/pages/choose-pac-provider/index.html +++ b/extensions/chromium/runet-censorship-bypass/extension/pages/choose-pac-provider/index.html @@ -30,6 +30,7 @@ input[type="radio"], label { cursor: pointer; } + .link-button, .link-button:visited { color: #0000EE; text-decoration: none; @@ -37,6 +38,7 @@ .link-button:hover { text-decoration: underline; } + .checked-radio-panel { visibility: hidden; } @@ -132,6 +134,7 @@ #custom-proxy-string-raw:not(:checked) ~ textarea { display: none; } + .control-row { display: table; width: 100%; @@ -141,7 +144,6 @@ display: table-cell; } .control-row a:nth-child(2) { - text-decoration: none; margin-left: 1em; text-align: right; } @@ -164,7 +166,7 @@
@@ -176,7 +178,7 @@ diff --git a/extensions/chromium/runet-censorship-bypass/extension/pages/choose-pac-provider/index.js b/extensions/chromium/runet-censorship-bypass/extension/pages/choose-pac-provider/index.js index e94bc25..c244c62 100755 --- a/extensions/chromium/runet-censorship-bypass/extension/pages/choose-pac-provider/index.js +++ b/extensions/chromium/runet-censorship-bypass/extension/pages/choose-pac-provider/index.js @@ -76,15 +76,15 @@ chrome.runtime.getBackgroundPage( (backgroundPage) => }; const checkChosenProvider = () => currentProviderRadio().checked = true; - const showErrors = (err, warns) => { + const showErrors = (err, ...warns) => { - warns = warns || []; - backgroundPage.console.log('eeeEEEEE',warns) const warning = warns .map( - (w) => '✘ ' + - (w && w.clarification && w.clarification.message || w.message || '') + (w) => + (w && (w.clarification && w.clarification.message || w.message) || '') ) + .filter( (m) => m ) + .map( (m) => '✘ ' + m ) .join('