i am new to electron.
const electron = require("electron") const app = electron.app const BrowserWindow = electron.BrowserWindow var mainWindow = null app.on('ready', function () { mainWindow = new BrowserWindow({width: 800, height: 600}) })
but when i tried to add this line,
mainWindow.loadUrl('file://${ __dirname}/index.html')
it return an error "typeError:mainWindow.loadUrl is not a function"
i searched a lot for the answer, but didnt get any answer for this.
can any suggest a solution for this? any help will be appreciated
To make an Electron app run in full-screen mode when it's started, pass the following configuration option when creating the BrowserWindow instance: mainWindow = new BrowserWindow({fullscreen: true});
As known was built with a window BrowserWindow module in electron. To create a child window we only need to define the parent window while we create the required window. Let's define the parent window first, then let's define the child window.
loadUrl()
was renamed to loadURL()
a while back.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With