docs: windows don't need to be retained (#21957)
This commit is contained in:
parent
23382e6e08
commit
662b94f46e
4 changed files with 7 additions and 25 deletions
|
@ -15,12 +15,9 @@ relative to its owning window. It is meant to be an alternative to the
|
|||
// In the main process.
|
||||
const { BrowserView, BrowserWindow } = require('electron')
|
||||
|
||||
let win = new BrowserWindow({ width: 800, height: 600 })
|
||||
win.on('closed', () => {
|
||||
win = null
|
||||
})
|
||||
const win = new BrowserWindow({ width: 800, height: 600 })
|
||||
|
||||
let view = new BrowserView()
|
||||
const view = new BrowserView()
|
||||
win.setBrowserView(view)
|
||||
view.setBounds({ x: 0, y: 0, width: 300, height: 300 })
|
||||
view.webContents.loadURL('https://electronjs.org')
|
||||
|
|
|
@ -11,10 +11,7 @@ const { BrowserWindow } = require('electron')
|
|||
// Or use `remote` from the renderer process.
|
||||
// const { BrowserWindow } = require('electron').remote
|
||||
|
||||
let win = new BrowserWindow({ width: 800, height: 600 })
|
||||
win.on('closed', () => {
|
||||
win = null
|
||||
})
|
||||
const win = new BrowserWindow({ width: 800, height: 600 })
|
||||
|
||||
// Load a remote URL
|
||||
win.loadURL('https://github.com')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue