File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,16 @@ const { WebContentsView } = require('electron')
44const toolbarHeight = 64
55
66class Tab {
7- constructor ( parentWindow , webContentsViewOptions = { } ) {
7+ constructor ( parentWindow , wcvOpts = { } ) {
88 this . invalidateLayout = this . invalidateLayout . bind ( this )
99
10- this . view = new WebContentsView ( webContentsViewOptions )
10+ // Delete undefined properties which cause WebContentsView constructor to
11+ // throw. This should probably be fixed in Electron upstream.
12+ if ( wcvOpts . hasOwnProperty ( 'webContents' ) && ! wcvOpts . webContents ) delete wcvOpts . webContents
13+ if ( wcvOpts . hasOwnProperty ( 'webPreferences' ) && ! wcvOpts . webPreferences )
14+ delete wcvOpts . webPreferences
15+
16+ this . view = new WebContentsView ( wcvOpts )
1117 this . id = this . view . webContents . id
1218 this . window = parentWindow
1319 this . webContents = this . view . webContents
You can’t perform that action at this time.
0 commit comments