Reputation: 1270
I Have an Electron app with a Webview. When i set the webview src to the website https://www.zap.co.il
i'm receiving the error: net:ERR_CONNECTION_RESET
. The weird things are:
There is no antivirus Installed that may intercept and no proxy configured. I have tried to reset the network, clear cache and cookies, change the MTU and basically any solution i found on the internet, and since it's happening for my colleague too, i suppose it has nothing to do with a network issues. And since i can reach the website from other browsers, I think the issue is probably relates to Electron.
I'm Using the versions:
Upvotes: 2
Views: 3954
Reputation: 1270
The problem was that electron add's few properties to the user agent string. and this specific website is not accepting custom properties in the user agent (probably for security reasons). I fixed it by removing the additional properties from the webview's user agent:
webview.addEventListener('dom-ready', () => {
const uaArr = webview.getUserAgent().split(" ");
const newUaArr = uaArr.filter((uar => !uar.startsWith('Electron')));
webview.setUserAgent(newUaArr.join(" "));
});
Upvotes: 3