mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Update browser-window.md
Made it more clear on how to define BrowserWindow (outside of the main process, specifically)
This commit is contained in:
@@ -4,8 +4,12 @@ The `BrowserWindow` class gives you the ability to create a browser window. For
|
||||
example:
|
||||
|
||||
```javascript
|
||||
// In the main process.
|
||||
const BrowserWindow = require('electron').BrowserWindow;
|
||||
|
||||
// Or in the renderer process.
|
||||
const BrowserWindow = require('electron').remote.BrowserWindow;
|
||||
|
||||
var win = new BrowserWindow({ width: 800, height: 600, show: false });
|
||||
win.on('closed', function() {
|
||||
win = null;
|
||||
|
||||
Reference in New Issue
Block a user