mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-27 20:03:45 +03:00
Unmute errors-to-exc errors, fix one, mend UI
This commit is contained in:
parent
a3c571cb22
commit
766529d8b9
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
{
|
{
|
||||||
|
const chromified = window.utils.chromified;
|
||||||
|
|
||||||
const lastErrors = [];
|
const lastErrors = [];
|
||||||
const lastErrorsLength = 20;
|
const lastErrorsLength = 20;
|
||||||
|
@ -10,7 +11,7 @@
|
||||||
get: () => lastErrors,
|
get: () => lastErrors,
|
||||||
}
|
}
|
||||||
|
|
||||||
chrome.webRequest.onErrorOccurred.addListener((details) => {
|
chrome.webRequest.onErrorOccurred.addListener(chromified((err/*Ignored*/, details) => {
|
||||||
|
|
||||||
if (!that.ifCollecting || [
|
if (!that.ifCollecting || [
|
||||||
'net::ERR_BLOCKED_BY_CLIENT',
|
'net::ERR_BLOCKED_BY_CLIENT',
|
||||||
|
@ -25,11 +26,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
lastErrors.unshift(details);
|
lastErrors.unshift(details);
|
||||||
if (lastErrors.length > lastErrorsLenght) {
|
if (lastErrors.length > lastErrorsLength) {
|
||||||
lastErrors.pop();
|
lastErrors.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
}),
|
||||||
{urls: ['<all_urls>']}
|
{urls: ['<all_urls>']}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h3>Список последних ошибок</h3>
|
<h3>Список последних ошибок</h3>
|
||||||
|
Новые сверху, количество ошибок ограничено 20тью.
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -13,6 +13,10 @@ chrome.runtime.getBackgroundPage( (bgWindow) =>
|
||||||
|
|
||||||
const exc = bgWindow.apis.pacKitchen.getPacMods().exceptions || {};
|
const exc = bgWindow.apis.pacKitchen.getPacMods().exceptions || {};
|
||||||
tbody.innerHTML = '';
|
tbody.innerHTML = '';
|
||||||
|
if (!errors.length) {
|
||||||
|
tbody.innerHTML = '<tr><td colspan="4">Ошибок пока не было.</td></tr>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
errors.forEach((err, index) => {
|
errors.forEach((err, index) => {
|
||||||
|
|
||||||
const ifProxy = exc[err.hostname];
|
const ifProxy = exc[err.hostname];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user