Browse Source

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.
Rajdeep Chatterjee 4 years ago
parent
commit
dd80952877
1 changed files with 1 additions and 1 deletions
  1. 1 1
      docs/api/browser-window.md

+ 1 - 1
docs/api/browser-window.md

@@ -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