feat: add TopLevelWindow.setContentView API
This commit is contained in:
parent
2b24b26e59
commit
bb2715e7a5
10 changed files with 56 additions and 18 deletions
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const electron = require('electron')
|
||||
const {ipcMain, TopLevelWindow} = electron
|
||||
const {ipcMain, WebContentsView, TopLevelWindow} = electron
|
||||
const {BrowserWindow} = process.atomBinding('window')
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
|
||||
|
@ -14,6 +14,9 @@ BrowserWindow.prototype._init = function () {
|
|||
// Avoid recursive require.
|
||||
const {app} = electron
|
||||
|
||||
// Create WebContentsView.
|
||||
this.setContentView(new WebContentsView(this.webContents))
|
||||
|
||||
// Make new windows requested by links behave like "window.open"
|
||||
this.webContents.on('-new-window', (event, url, frameName, disposition,
|
||||
additionalFeatures, postData,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue