Using electron to access cross-origin-resources

You're using the old webPreferences syntax, your constructor should look something this :)

mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    frame: true,
    webPreferences: {
        webSecurity: false
    }
});

It seems that it is not possible right now, since webSecurity no longer controls CORS. (for v9+)

The webSecurity option controls the web security inside blink, but recently the control of CORS has been moved out of blink and thus the option no longer controls CORS.

See https://github.com/electron/electron/issues/23664#issuecomment-692422997