docs: windows don't need to be retained (#21957)

This commit is contained in:
Jeremy Apthorp 2020-01-30 14:15:35 -08:00 committed by GitHub
parent 23382e6e08
commit 662b94f46e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 25 deletions

View file

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

View file

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