User agent not working (e.g. whatsapp web)

Hello there,

As described in https://github.com/electron/electron/issues/20218 I’d like to play around with Electron (first steps in JS to be honest) and it seems I don’t get the point in it.

My Code:

const { app, BrowserWindow, Menu } = require(‘electron’)
const { webContents } = require(‘electron’)
const {dialog} = require(‘electron’)
const myUserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36 ’

win.loadURL(‘https://web.whatsapp.com/’, {userAgent: myUserAgent})

I’d expect to load the Whatsapp Web loading and fully working every time I load the page.

Actual behavior is:

On first startup either via npm start or starting the build app on windows and/or macOS Whatsapp Web is working fine. After restarting the app or reloading the URL it asks me to update to Google Chrome 49+. After removing C:\Users\MyUser\AppData\Roaming\AppName and starting the app everything works flawless. After restarting the mentioned ‘update to Google Chrome 49+’ screen pops up again. Tried several user agents.

Is this something I’ve spoiled?

Cheers :slight_smile: