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 = '';