From 52875102635d043900afbe93d04e43e92285bc48 Mon Sep 17 00:00:00 2001 From: ilyaigpetrov Date: Sun, 18 Oct 2020 16:27:57 +0000 Subject: [PATCH] Make ffx blink on TUNNEL CONN FAILED (but popup doesn't show error) --- .../src/extension-full/80-error-menu.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-full/80-error-menu.js b/extensions/chromium/runet-censorship-bypass/src/extension-full/80-error-menu.js index 638b6de..207df06 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-full/80-error-menu.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-full/80-error-menu.js @@ -4,9 +4,12 @@ const timeouted = window.utils.timeouted; - const proxySideErrors = [ - 'net::ERR_TUNNEL_CONNECTION_FAILED', - ]; + const isProxySideError = (details) => + /* About !main_frame: Main frame websocket errors are followed by webnavigation errors + which chrome-internals code resets the state of the popup. + */ + details.error === 'net::ERR_TUNNEL_CONNECTION_FAILED' && details.type !== 'main_frame' || + details.error === 'NS_ERROR_CONNECTION_REFUSED' && Boolean(details.proxyInfo); const urlToA = (url) => new URL(url).host.link( encodeURIComponent(url), @@ -14,9 +17,7 @@ const isProxyErrorHandledAsync = async (details) => { - if (!proxySideErrors.includes(details.error) || details.type === 'main_frame') { - // Main frame websocket errors are followed by webnavigation errors - // which chrome-internals code resets the state of the popup. + if (!isProxySideError(details)) { return; } let fromPageHref = '';