Electron does not open the requested url

Viewed 16

I'm new to Electron.js, I just did the initial configurations of Electron and I'm trying to open a URL, the problem is that when I run npm start it opens the following and not the page of the url, how do I solve it?

const { app, BrowserWindow } = require('electron')
const createWindow = () => {
    const win = new BrowserWindow({
        width: 800,
        height: 600
    })
    win.loadURL('https://www.google.com/')
}
app.whenReady().then(() => {
    createWindow()
})

enter image description here

1 Answers

I would follow the Electron Quickstart and replace win.loadFile('index.html') with win.loadURL('https://google.com').

Related