chore: make WebContentsView take webPreferences as parameter (#22997)
* chore: add WebContentsView.webContents helper * chore: no need to handle webContents option * chore: Create WebContentsView in C++ * chore: make WebContentsView accept web_preferences * fix: nativeWindowOpen still passes WebContents to BrowserWindow * chore: no more need of WebContentsViewRelay * test: WebContentsView now takes options * fix: avoid creating 2 constructors
This commit is contained in:
parent
de893360f7
commit
ca947307db
7 changed files with 108 additions and 92 deletions
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
const electron = require('electron');
|
||||
const { WebContentsView, TopLevelWindow, deprecate } = electron;
|
||||
const { TopLevelWindow, deprecate } = electron;
|
||||
const { BrowserWindow } = process.electronBinding('window');
|
||||
|
||||
Object.setPrototypeOf(BrowserWindow.prototype, TopLevelWindow.prototype);
|
||||
|
@ -13,9 +13,6 @@ BrowserWindow.prototype._init = function () {
|
|||
// Avoid recursive require.
|
||||
const { app } = electron;
|
||||
|
||||
// Create WebContentsView.
|
||||
this.setContentView(new WebContentsView(this.webContents));
|
||||
|
||||
const nativeSetBounds = this.setBounds;
|
||||
this.setBounds = (bounds, ...opts) => {
|
||||
bounds = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue