docs: Added loadFile instead of loadURL in BrowserWindow documentation example (#28829)

* Added loadFile instead of loadURL in the example

For loading a local file the loadFile API is a better way to load any html file in the Renderer process.

Have changed it in the example.

* Changed backticks to single quote to correct for linting error

In order to correct the linting error reported by the bot, I have changed backticks to single quote in the example.
This commit is contained in:
Rajdeep Chatterjee 2021-05-03 23:26:33 +05:30 committed by GitHub
parent 0f898b2260
commit dd80952877
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ const win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('https://github.com')
// Or load a local HTML file
win.loadURL(`file://${__dirname}/app/index.html`)
win.loadFile('index.html')
```
## Frameless window