From 766529d8b9611578d144f59e1838fd0331bb463d Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Sat, 3 Jun 2017 19:54:40 +0500 Subject: [PATCH] Unmute errors-to-exc errors, fix one, mend UI --- .../src/extension-full/83-last-errors.js | 7 ++++--- .../src/extension-full/pages/errors-to-exc/index.html | 1 + .../src/extension-full/pages/errors-to-exc/index.js | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-full/83-last-errors.js b/extensions/chromium/runet-censorship-bypass/src/extension-full/83-last-errors.js index 2577903..96c8a91 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-full/83-last-errors.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-full/83-last-errors.js @@ -1,6 +1,7 @@ 'use strict'; { + const chromified = window.utils.chromified; const lastErrors = []; const lastErrorsLength = 20; @@ -10,7 +11,7 @@ get: () => lastErrors, } - chrome.webRequest.onErrorOccurred.addListener((details) => { + chrome.webRequest.onErrorOccurred.addListener(chromified((err/*Ignored*/, details) => { if (!that.ifCollecting || [ 'net::ERR_BLOCKED_BY_CLIENT', @@ -25,11 +26,11 @@ } lastErrors.unshift(details); - if (lastErrors.length > lastErrorsLenght) { + if (lastErrors.length > lastErrorsLength) { lastErrors.pop(); } - }, + }), {urls: ['']} ); diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-full/pages/errors-to-exc/index.html b/extensions/chromium/runet-censorship-bypass/src/extension-full/pages/errors-to-exc/index.html index 20be0e5..776f736 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-full/pages/errors-to-exc/index.html +++ b/extensions/chromium/runet-censorship-bypass/src/extension-full/pages/errors-to-exc/index.html @@ -41,6 +41,7 @@

Список последних ошибок

+ Новые сверху, количество ошибок ограничено 20тью. diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-full/pages/errors-to-exc/index.js b/extensions/chromium/runet-censorship-bypass/src/extension-full/pages/errors-to-exc/index.js index 3af7694..972747d 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-full/pages/errors-to-exc/index.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-full/pages/errors-to-exc/index.js @@ -13,6 +13,10 @@ chrome.runtime.getBackgroundPage( (bgWindow) => const exc = bgWindow.apis.pacKitchen.getPacMods().exceptions || {}; tbody.innerHTML = ''; + if (!errors.length) { + tbody.innerHTML = ''; + return; + } errors.forEach((err, index) => { const ifProxy = exc[err.hostname];
Ошибок пока не было.