Skip to content

Commit edaf4f9

Browse files
authored
Accept WebContentsView type in window option (#194)
1 parent 33fd1df commit edaf4f9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type MenuItemConstructorOptions,
66
type Event as ElectronEvent,
77
type WebContents,
8+
type WebContentsView,
89
} from 'electron';
910

1011
export type Labels = {
@@ -135,7 +136,7 @@ export type Options = {
135136
Window or WebView to add the context menu to.
136137
When not specified, the context menu will be added to all existing and new windows.
137138
*/
138-
readonly window?: BrowserWindow | BrowserView | Electron.WebviewTag | WebContents;
139+
readonly window?: BrowserWindow | BrowserView | Electron.WebviewTag | WebContents | WebContentsView;
139140

140141
/**
141142
Should return an array of [menu items](https://electronjs.org/docs/api/menu-item) to be prepended to the context menu.

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Type: `object`
8686

8787
#### window
8888

89-
Type: `BrowserWindow | BrowserView | WebViewTag | WebContents`
89+
Type: `BrowserWindow | BrowserView | WebViewTag | WebContents | WebContentsView`
9090

9191
Window or WebView to add the context menu to.
9292

0 commit comments

Comments
 (0)