Skip to content

Commit 6ba856b

Browse files
committed
fix: shell link middle-click action
1 parent 0f1fded commit 6ba856b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/shell/browser/tabs.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ const { WebContentsView } = require('electron')
44
const toolbarHeight = 64
55

66
class 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

0 commit comments

Comments
 (0)