fix(electron): load self-signed loopback pages

This commit is contained in:
Bohdan Triapitsyn
2026-08-18 23:10:14 +03:00
parent b754ccbf63
commit 0c5e183c62
4 changed files with 66 additions and 1 deletions
@@ -0,0 +1,12 @@
const LOOPBACK_HOSTNAMES = new Set(['localhost', '127.0.0.1', '[::1]']);
export const shouldAllowBrowserPanelCertificateError = ({ url, error }) => {
if (error !== 'net::ERR_CERT_AUTHORITY_INVALID') return false;
try {
const parsed = new URL(url);
return parsed.protocol === 'https:' && LOOPBACK_HOSTNAMES.has(parsed.hostname.toLowerCase());
} catch {
return false;
}
};