electron 25.0.1 → 26.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/checksums.json +75 -75
  2. package/electron.d.ts +1293 -1277
  3. package/package.json +1 -1
package/electron.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for Electron 25.0.1
1
+ // Type definitions for Electron 26.0.0-alpha.2
2
2
  // Project: http://electronjs.org/
3
3
  // Definitions by: The Electron Team <https://github.com/electron/electron>
4
4
  // Definitions: https://github.com/electron/typescript-definitions
@@ -805,7 +805,7 @@ declare namespace Electron {
805
805
  /**
806
806
  * Enables full sandbox mode on the app. This means that all renderers will be
807
807
  * launched sandboxed, regardless of the value of the `sandbox` flag in
808
- * WebPreferences.
808
+ * `WebPreferences`.
809
809
  *
810
810
  * This method can only be called before app is ready.
811
811
  */
@@ -3320,6 +3320,312 @@ declare namespace Electron {
3320
3320
  readonly webContents: WebContents;
3321
3321
  }
3322
3322
 
3323
+ interface BrowserWindowConstructorOptions {
3324
+
3325
+ // Docs: https://electronjs.org/docs/api/structures/browser-window-options
3326
+
3327
+ /**
3328
+ * Whether clicking an inactive window will also click through to the web contents.
3329
+ * Default is `false` on macOS. This option is not configurable on other platforms.
3330
+ *
3331
+ * @platform darwin
3332
+ */
3333
+ acceptFirstMouse?: boolean;
3334
+ /**
3335
+ * Whether the window should always stay on top of other windows. Default is
3336
+ * `false`.
3337
+ */
3338
+ alwaysOnTop?: boolean;
3339
+ /**
3340
+ * Auto hide the menu bar unless the `Alt` key is pressed. Default is `false`.
3341
+ */
3342
+ autoHideMenuBar?: boolean;
3343
+ /**
3344
+ * The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color
3345
+ * format. Alpha in #AARRGGBB format is supported if `transparent` is set to
3346
+ * `true`. Default is `#FFF` (white). See win.setBackgroundColor for more
3347
+ * information.
3348
+ */
3349
+ backgroundColor?: string;
3350
+ /**
3351
+ * Set the window's system-drawn background material, including behind the
3352
+ * non-client area. Can be `auto`, `none`, `mica`, `acrylic` or `tabbed`. See
3353
+ * win.setBackgroundMaterial for more information.
3354
+ *
3355
+ * @platform win32
3356
+ */
3357
+ backgroundMaterial?: ('auto' | 'none' | 'mica' | 'acrylic' | 'tabbed');
3358
+ /**
3359
+ * Show window in the center of the screen. Default is `false`.
3360
+ */
3361
+ center?: boolean;
3362
+ /**
3363
+ * Whether window is closable. This is not implemented on Linux. Default is `true`.
3364
+ *
3365
+ * @platform darwin,win32
3366
+ */
3367
+ closable?: boolean;
3368
+ /**
3369
+ * Forces using dark theme for the window, only works on some GTK+3 desktop
3370
+ * environments. Default is `false`.
3371
+ */
3372
+ darkTheme?: boolean;
3373
+ /**
3374
+ * Whether to hide cursor when typing. Default is `false`.
3375
+ */
3376
+ disableAutoHideCursor?: boolean;
3377
+ /**
3378
+ * Enable the window to be resized larger than screen. Only relevant for macOS, as
3379
+ * other OSes allow larger-than-screen windows by default. Default is `false`.
3380
+ *
3381
+ * @platform darwin
3382
+ */
3383
+ enableLargerThanScreen?: boolean;
3384
+ /**
3385
+ * Whether the window can be focused. Default is `true`. On Windows setting
3386
+ * `focusable: false` also implies setting `skipTaskbar: true`. On Linux setting
3387
+ * `focusable: false` makes the window stop interacting with wm, so the window will
3388
+ * always stay on top in all workspaces.
3389
+ */
3390
+ focusable?: boolean;
3391
+ /**
3392
+ * Specify `false` to create a frameless window. Default is `true`.
3393
+ */
3394
+ frame?: boolean;
3395
+ /**
3396
+ * Whether the window should show in fullscreen. When explicitly set to `false` the
3397
+ * fullscreen button will be hidden or disabled on macOS. Default is `false`.
3398
+ */
3399
+ fullscreen?: boolean;
3400
+ /**
3401
+ * Whether the window can be put into fullscreen mode. On macOS, also whether the
3402
+ * maximize/zoom button should toggle full screen mode or maximize window. Default
3403
+ * is `true`.
3404
+ */
3405
+ fullscreenable?: boolean;
3406
+ /**
3407
+ * Shows the title in the title bar in full screen mode on macOS for `hiddenInset`
3408
+ * titleBarStyle. Default is `false`.
3409
+ *
3410
+ * @deprecated
3411
+ * @platform darwin
3412
+ */
3413
+ fullscreenWindowTitle?: boolean;
3414
+ /**
3415
+ * Whether window should have a shadow. Default is `true`.
3416
+ */
3417
+ hasShadow?: boolean;
3418
+ /**
3419
+ * Window's height in pixels. Default is `600`.
3420
+ */
3421
+ height?: number;
3422
+ /**
3423
+ * Whether window should be hidden when the user toggles into mission control.
3424
+ *
3425
+ * @platform darwin
3426
+ */
3427
+ hiddenInMissionControl?: boolean;
3428
+ /**
3429
+ * The window icon. On Windows it is recommended to use `ICO` icons to get best
3430
+ * visual effects, you can also leave it undefined so the executable's icon will be
3431
+ * used.
3432
+ */
3433
+ icon?: (NativeImage) | (string);
3434
+ /**
3435
+ * Whether the window is in kiosk mode. Default is `false`.
3436
+ */
3437
+ kiosk?: boolean;
3438
+ /**
3439
+ * Window's maximum height. Default is no limit.
3440
+ */
3441
+ maxHeight?: number;
3442
+ /**
3443
+ * Whether window is maximizable. This is not implemented on Linux. Default is
3444
+ * `true`.
3445
+ *
3446
+ * @platform darwin,win32
3447
+ */
3448
+ maximizable?: boolean;
3449
+ /**
3450
+ * Window's maximum width. Default is no limit.
3451
+ */
3452
+ maxWidth?: number;
3453
+ /**
3454
+ * Window's minimum height. Default is `0`.
3455
+ */
3456
+ minHeight?: number;
3457
+ /**
3458
+ * Whether window is minimizable. This is not implemented on Linux. Default is
3459
+ * `true`.
3460
+ *
3461
+ * @platform darwin,win32
3462
+ */
3463
+ minimizable?: boolean;
3464
+ /**
3465
+ * Window's minimum width. Default is `0`.
3466
+ */
3467
+ minWidth?: number;
3468
+ /**
3469
+ * Whether this is a modal window. This only works when the window is a child
3470
+ * window. Default is `false`.
3471
+ */
3472
+ modal?: boolean;
3473
+ /**
3474
+ * Whether window is movable. This is not implemented on Linux. Default is `true`.
3475
+ *
3476
+ * @platform darwin,win32
3477
+ */
3478
+ movable?: boolean;
3479
+ /**
3480
+ * Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0
3481
+ * (fully opaque). This is only implemented on Windows and macOS.
3482
+ *
3483
+ * @platform darwin,win32
3484
+ */
3485
+ opacity?: number;
3486
+ /**
3487
+ * Whether the renderer should be active when `show` is `false` and it has just
3488
+ * been created. In order for `document.visibilityState` to work correctly on
3489
+ * first load with `show: false` you should set this to `false`. Setting this to
3490
+ * `false` will cause the `ready-to-show` event to not fire. Default is `true`.
3491
+ */
3492
+ paintWhenInitiallyHidden?: boolean;
3493
+ /**
3494
+ * Specify parent window. Default is `null`.
3495
+ */
3496
+ parent?: BrowserWindow;
3497
+ /**
3498
+ * Whether window is resizable. Default is `true`.
3499
+ */
3500
+ resizable?: boolean;
3501
+ /**
3502
+ * Whether frameless window should have rounded corners on macOS. Default is
3503
+ * `true`. Setting this property to `false` will prevent the window from being
3504
+ * fullscreenable.
3505
+ *
3506
+ * @platform darwin
3507
+ */
3508
+ roundedCorners?: boolean;
3509
+ /**
3510
+ * Whether window should be shown when created. Default is `true`.
3511
+ */
3512
+ show?: boolean;
3513
+ /**
3514
+ * Use pre-Lion fullscreen on macOS. Default is `false`.
3515
+ *
3516
+ * @platform darwin
3517
+ */
3518
+ simpleFullscreen?: boolean;
3519
+ /**
3520
+ * Whether to show the window in taskbar. Default is `false`.
3521
+ *
3522
+ * @platform darwin,win32
3523
+ */
3524
+ skipTaskbar?: boolean;
3525
+ /**
3526
+ * Tab group name, allows opening the window as a native tab. Windows with the same
3527
+ * tabbing identifier will be grouped together. This also adds a native new tab
3528
+ * button to your window's tab bar and allows your `app` and window to receive the
3529
+ * `new-window-for-tab` event.
3530
+ *
3531
+ * @platform darwin
3532
+ */
3533
+ tabbingIdentifier?: string;
3534
+ /**
3535
+ * Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard
3536
+ * window frame. Setting it to `false` will remove window shadow and window
3537
+ * animations. Default is `true`.
3538
+ */
3539
+ thickFrame?: boolean;
3540
+ /**
3541
+ * Default window title. Default is `"Electron"`. If the HTML tag `<title>` is
3542
+ * defined in the HTML file loaded by `loadURL()`, this property will be ignored.
3543
+ */
3544
+ title?: string;
3545
+ /**
3546
+ * When using a frameless window in conjunction with
3547
+ * `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so
3548
+ * that the standard window controls ("traffic lights" on macOS) are visible, this
3549
+ * property enables the Window Controls Overlay JavaScript APIs and CSS Environment
3550
+ * Variables. Specifying `true` will result in an overlay with default system
3551
+ * colors. Default is `false`.
3552
+ */
3553
+ titleBarOverlay?: (TitleBarOverlay) | (boolean);
3554
+ /**
3555
+ * The style of window title bar. Default is `default`. Possible values are:
3556
+ *
3557
+ * @platform darwin,win32
3558
+ */
3559
+ titleBarStyle?: ('default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover');
3560
+ /**
3561
+ * Set a custom position for the traffic light buttons in frameless windows.
3562
+ *
3563
+ * @platform darwin
3564
+ */
3565
+ trafficLightPosition?: Point;
3566
+ /**
3567
+ * Makes the window transparent. Default is `false`. On Windows, does not work
3568
+ * unless the window is frameless.
3569
+ */
3570
+ transparent?: boolean;
3571
+ /**
3572
+ * The type of window, default is normal window. See more about this below.
3573
+ */
3574
+ type?: string;
3575
+ /**
3576
+ * The `width` and `height` would be used as web page's size, which means the
3577
+ * actual window's size will include window frame's size and be slightly larger.
3578
+ * Default is `false`.
3579
+ */
3580
+ useContentSize?: boolean;
3581
+ /**
3582
+ * Add a type of vibrancy effect to the window, only on macOS. Can be
3583
+ * `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`,
3584
+ * `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`,
3585
+ * `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. Please
3586
+ * note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark`
3587
+ * are deprecated and have been removed in macOS Catalina (10.15).
3588
+ *
3589
+ * @platform darwin
3590
+ */
3591
+ vibrancy?: ('appearance-based' | 'light' | 'dark' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'medium-light' | 'ultra-dark' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page');
3592
+ /**
3593
+ * Specify how the material appearance should reflect window activity state on
3594
+ * macOS. Must be used with the `vibrancy` property. Possible values are:
3595
+ *
3596
+ * @platform darwin
3597
+ */
3598
+ visualEffectState?: ('followWindow' | 'active' | 'inactive');
3599
+ /**
3600
+ * Settings of web page's features.
3601
+ */
3602
+ webPreferences?: WebPreferences;
3603
+ /**
3604
+ * Window's width in pixels. Default is `800`.
3605
+ */
3606
+ width?: number;
3607
+ /**
3608
+ * (**required** if y is used) Window's left offset from screen. Default is to
3609
+ * center the window.
3610
+ */
3611
+ x?: number;
3612
+ /**
3613
+ * (**required** if x is used) Window's top offset from screen. Default is to
3614
+ * center the window.
3615
+ */
3616
+ y?: number;
3617
+ /**
3618
+ * Controls the behavior on macOS when option-clicking the green stoplight button
3619
+ * on the toolbar or by clicking the Window > Zoom menu item. If `true`, the window
3620
+ * will grow to the preferred width of the web page when zoomed, `false` will cause
3621
+ * it to zoom to the width of the screen. This will also affect the behavior when
3622
+ * calling `maximize()` directly. Default is `false`.
3623
+ *
3624
+ * @platform darwin
3625
+ */
3626
+ zoomToPageWidth?: boolean;
3627
+ }
3628
+
3323
3629
  interface Certificate {
3324
3630
 
3325
3631
  // Docs: https://electronjs.org/docs/api/structures/certificate
@@ -8707,6 +9013,26 @@ declare namespace Electron {
8707
9013
  * reused for new connections.
8708
9014
  */
8709
9015
  setSSLConfig(config: SSLConfigConfig): void;
9016
+ /**
9017
+ * Sets the handler which can be used to override which USB classes are protected.
9018
+ * The return value for the handler is a string array of USB classes which should
9019
+ * be considered protected (eg not available in the renderer). Valid values for
9020
+ * the array are:
9021
+ *
9022
+ * * `audio`
9023
+ * * `audio-video`
9024
+ * * `hid`
9025
+ * * `mass-storage`
9026
+ * * `smart-card`
9027
+ * * `video`
9028
+ * * `wireless`
9029
+ *
9030
+ * Returning an empty string array from the handler will allow all USB classes;
9031
+ * returning the passed in array will maintain the default list of protected USB
9032
+ * classes (this is also the default behavior if a handler is not defined). To
9033
+ * clear the handler, call `setUSBProtectedClassesHandler(null)`.
9034
+ */
9035
+ setUSBProtectedClassesHandler(handler: ((details: USBProtectedClassesHandlerHandlerDetails) => string[]) | (null)): void;
8710
9036
  /**
8711
9037
  * Overrides the `userAgent` and `acceptLanguages` for this session.
8712
9038
  *
@@ -13165,1309 +13491,1241 @@ declare namespace Electron {
13165
13491
  readonly visibilityState: string;
13166
13492
  }
13167
13493
 
13168
- class WebRequest {
13494
+ interface WebPreferences {
13169
13495
 
13170
- // Docs: https://electronjs.org/docs/api/web-request
13496
+ // Docs: https://electronjs.org/docs/api/structures/web-preferences
13171
13497
 
13172
13498
  /**
13173
- * The `listener` will be called with `listener(details)` when a server initiated
13174
- * redirect is about to occur.
13175
- */
13176
- onBeforeRedirect(filter: WebRequestFilter, listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
13177
- /**
13178
- * The `listener` will be called with `listener(details)` when a server initiated
13179
- * redirect is about to occur.
13180
- */
13181
- onBeforeRedirect(listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
13182
- /**
13183
- * The `listener` will be called with `listener(details, callback)` when a request
13184
- * is about to occur.
13185
- *
13186
- * The `uploadData` is an array of `UploadData` objects.
13187
- *
13188
- * The `callback` has to be called with an `response` object.
13189
- *
13190
- * Some examples of valid `urls`:
13191
- */
13192
- onBeforeRequest(filter: WebRequestFilter, listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
13193
- /**
13194
- * The `listener` will be called with `listener(details, callback)` when a request
13195
- * is about to occur.
13196
- *
13197
- * The `uploadData` is an array of `UploadData` objects.
13198
- *
13199
- * The `callback` has to be called with an `response` object.
13200
- *
13201
- * Some examples of valid `urls`:
13202
- */
13203
- onBeforeRequest(listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
13204
- /**
13205
- * The `listener` will be called with `listener(details, callback)` before sending
13206
- * an HTTP request, once the request headers are available. This may occur after a
13207
- * TCP connection is made to the server, but before any http data is sent.
13208
- *
13209
- * The `callback` has to be called with a `response` object.
13210
- */
13211
- onBeforeSendHeaders(filter: WebRequestFilter, listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
13212
- /**
13213
- * The `listener` will be called with `listener(details, callback)` before sending
13214
- * an HTTP request, once the request headers are available. This may occur after a
13215
- * TCP connection is made to the server, but before any http data is sent.
13216
- *
13217
- * The `callback` has to be called with a `response` object.
13218
- */
13219
- onBeforeSendHeaders(listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
13220
- /**
13221
- * The `listener` will be called with `listener(details)` when a request is
13222
- * completed.
13223
- */
13224
- onCompleted(filter: WebRequestFilter, listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
13225
- /**
13226
- * The `listener` will be called with `listener(details)` when a request is
13227
- * completed.
13228
- */
13229
- onCompleted(listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
13230
- /**
13231
- * The `listener` will be called with `listener(details)` when an error occurs.
13232
- */
13233
- onErrorOccurred(filter: WebRequestFilter, listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
13234
- /**
13235
- * The `listener` will be called with `listener(details)` when an error occurs.
13236
- */
13237
- onErrorOccurred(listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
13238
- /**
13239
- * The `listener` will be called with `listener(details, callback)` when HTTP
13240
- * response headers of a request have been received.
13241
- *
13242
- * The `callback` has to be called with a `response` object.
13243
- */
13244
- onHeadersReceived(filter: WebRequestFilter, listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
13245
- /**
13246
- * The `listener` will be called with `listener(details, callback)` when HTTP
13247
- * response headers of a request have been received.
13248
- *
13249
- * The `callback` has to be called with a `response` object.
13250
- */
13251
- onHeadersReceived(listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
13252
- /**
13253
- * The `listener` will be called with `listener(details)` when first byte of the
13254
- * response body is received. For HTTP requests, this means that the status line
13255
- * and response headers are available.
13256
- */
13257
- onResponseStarted(filter: WebRequestFilter, listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
13258
- /**
13259
- * The `listener` will be called with `listener(details)` when first byte of the
13260
- * response body is received. For HTTP requests, this means that the status line
13261
- * and response headers are available.
13262
- */
13263
- onResponseStarted(listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
13264
- /**
13265
- * The `listener` will be called with `listener(details)` just before a request is
13266
- * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
13267
- * response are visible by the time this listener is fired.
13499
+ * An alternative title string provided only to accessibility tools such as screen
13500
+ * readers. This string is not directly visible to users.
13268
13501
  */
13269
- onSendHeaders(filter: WebRequestFilter, listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
13502
+ accessibleTitle?: string;
13270
13503
  /**
13271
- * The `listener` will be called with `listener(details)` just before a request is
13272
- * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
13273
- * response are visible by the time this listener is fired.
13504
+ * A list of strings that will be appended to `process.argv` in the renderer
13505
+ * process of this app. Useful for passing small bits of data down to renderer
13506
+ * process preload scripts.
13274
13507
  */
13275
- onSendHeaders(listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
13276
- }
13277
-
13278
- interface WebRequestFilter {
13279
-
13280
- // Docs: https://electronjs.org/docs/api/structures/web-request-filter
13281
-
13508
+ additionalArguments?: string[];
13282
13509
  /**
13283
- * Array of types that will be used to filter out the requests that do not match
13284
- * the types. When not specified, all types will be matched. Can be `mainFrame`,
13285
- * `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`,
13286
- * `cspReport`, `media` or `webSocket`.
13510
+ * Allow an https page to run JavaScript, CSS or plugins from http URLs. Default is
13511
+ * `false`.
13287
13512
  */
13288
- types?: Array<'mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket'>;
13513
+ allowRunningInsecureContent?: boolean;
13289
13514
  /**
13290
- * Array of URL patterns that will be used to filter out the requests that do not
13291
- * match the URL patterns.
13515
+ * Autoplay policy to apply to content in the window, can be
13516
+ * `no-user-gesture-required`, `user-gesture-required`,
13517
+ * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
13292
13518
  */
13293
- urls: string[];
13294
- }
13295
-
13296
- interface WebSource {
13297
-
13298
- // Docs: https://electronjs.org/docs/api/structures/web-source
13299
-
13300
- code: string;
13301
- url?: string;
13302
- }
13303
-
13304
- interface WebviewTag extends HTMLElement {
13305
-
13306
- // Docs: https://electronjs.org/docs/api/webview-tag
13307
-
13519
+ autoplayPolicy?: ('no-user-gesture-required' | 'user-gesture-required' | 'document-user-activation-required');
13308
13520
  /**
13309
- * Fired when a load has committed. This includes navigation within the current
13310
- * document as well as subframe document-level loads, but does not include
13311
- * asynchronous resource loads.
13521
+ * Whether to throttle animations and timers when the page becomes background. This
13522
+ * also affects the Page Visibility API. Defaults to `true`.
13312
13523
  */
13313
- addEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void, useCapture?: boolean): this;
13314
- removeEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void): this;
13524
+ backgroundThrottling?: boolean;
13315
13525
  /**
13316
- * Fired when the navigation is done, i.e. the spinner of the tab will stop
13317
- * spinning, and the `onload` event is dispatched.
13526
+ * Whether to run Electron APIs and the specified `preload` script in a separate
13527
+ * JavaScript context. Defaults to `true`. The context that the `preload` script
13528
+ * runs in will only have access to its own dedicated `document` and `window`
13529
+ * globals, as well as its own set of JavaScript builtins (`Array`, `Object`,
13530
+ * `JSON`, etc.), which are all invisible to the loaded content. The Electron API
13531
+ * will only be available in the `preload` script and not the loaded page. This
13532
+ * option should be used when loading potentially untrusted remote content to
13533
+ * ensure the loaded content cannot tamper with the `preload` script and any
13534
+ * Electron APIs being used. This option uses the same technique used by Chrome
13535
+ * Content Scripts. You can access this context in the dev tools by selecting the
13536
+ * 'Electron Isolated Context' entry in the combo box at the top of the Console
13537
+ * tab.
13318
13538
  */
13319
- addEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13320
- removeEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void): this;
13539
+ contextIsolation?: boolean;
13321
13540
  /**
13322
- * This event is like `did-finish-load`, but fired when the load failed or was
13323
- * cancelled, e.g. `window.stop()` is invoked.
13541
+ * Defaults to `ISO-8859-1`.
13324
13542
  */
13325
- addEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void, useCapture?: boolean): this;
13326
- removeEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void): this;
13543
+ defaultEncoding?: string;
13327
13544
  /**
13328
- * Fired when a frame has done navigation.
13545
+ * Sets the default font for the font-family.
13329
13546
  */
13330
- addEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void, useCapture?: boolean): this;
13331
- removeEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void): this;
13547
+ defaultFontFamily?: DefaultFontFamily;
13332
13548
  /**
13333
- * Corresponds to the points in time when the spinner of the tab starts spinning.
13549
+ * Defaults to `16`.
13334
13550
  */
13335
- addEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13336
- removeEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void): this;
13551
+ defaultFontSize?: number;
13337
13552
  /**
13338
- * Corresponds to the points in time when the spinner of the tab stops spinning.
13553
+ * Defaults to `13`.
13339
13554
  */
13340
- addEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13341
- removeEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void): this;
13555
+ defaultMonospaceFontSize?: number;
13342
13556
  /**
13343
- * Fired when attached to the embedder web contents.
13557
+ * Whether to enable DevTools. If it is set to `false`, can not use
13558
+ * `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.
13344
13559
  */
13345
- addEventListener(event: 'did-attach', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13346
- removeEventListener(event: 'did-attach', listener: (event: DOMEvent) => void): this;
13560
+ devTools?: boolean;
13347
13561
  /**
13348
- * Fired when document in the given frame is loaded.
13562
+ * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
13563
+ * to disable. The full list of supported feature strings can be found in the
13564
+ * RuntimeEnabledFeatures.json5 file.
13349
13565
  */
13350
- addEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13351
- removeEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void): this;
13566
+ disableBlinkFeatures?: string;
13352
13567
  /**
13353
- * Fired when page title is set during navigation. `explicitSet` is false when
13354
- * title is synthesized from file url.
13568
+ * Whether to disable dialogs completely. Overrides `safeDialogs`. Default is
13569
+ * `false`.
13355
13570
  */
13356
- addEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void, useCapture?: boolean): this;
13357
- removeEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void): this;
13571
+ disableDialogs?: boolean;
13358
13572
  /**
13359
- * Fired when page receives favicon urls.
13573
+ * Whether to prevent the window from resizing when entering HTML Fullscreen.
13574
+ * Default is `false`.
13360
13575
  */
13361
- addEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void, useCapture?: boolean): this;
13362
- removeEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void): this;
13576
+ disableHtmlFullscreenWindowResize?: boolean;
13363
13577
  /**
13364
- * Fired when page enters fullscreen triggered by HTML API.
13578
+ * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
13579
+ * to enable. The full list of supported feature strings can be found in the
13580
+ * RuntimeEnabledFeatures.json5 file.
13365
13581
  */
13366
- addEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13367
- removeEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void): this;
13582
+ enableBlinkFeatures?: string;
13368
13583
  /**
13369
- * Fired when page leaves fullscreen triggered by HTML API.
13584
+ * Whether to enable preferred size mode. The preferred size is the minimum size
13585
+ * needed to contain the layout of the document—without requiring scrolling.
13586
+ * Enabling this will cause the `preferred-size-changed` event to be emitted on the
13587
+ * `WebContents` when the preferred size changes. Default is `false`.
13370
13588
  */
13371
- addEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13372
- removeEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void): this;
13589
+ enablePreferredSizeMode?: boolean;
13373
13590
  /**
13374
- * Fired when the guest window logs a console message.
13375
- *
13376
- * The following example code forwards all log messages to the embedder's console
13377
- * without regard for log level or other properties.
13591
+ * Whether to enable the WebSQL api. Default is `true`.
13378
13592
  */
13379
- addEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void, useCapture?: boolean): this;
13380
- removeEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void): this;
13593
+ enableWebSQL?: boolean;
13381
13594
  /**
13382
- * Fired when a result is available for `webview.findInPage` request.
13595
+ * Enables Chromium's experimental features. Default is `false`.
13383
13596
  */
13384
- addEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void, useCapture?: boolean): this;
13385
- removeEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void): this;
13597
+ experimentalFeatures?: boolean;
13386
13598
  /**
13387
- * Emitted when a user or the page wants to start navigation. It can happen when
13388
- * the `window.location` object is changed or a user clicks a link in the page.
13389
- *
13390
- * This event will not emit when the navigation is started programmatically with
13391
- * APIs like `<webview>.loadURL` and `<webview>.back`.
13392
- *
13393
- * It is also not emitted during in-page navigation, such as clicking anchor links
13394
- * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
13395
- * this purpose.
13396
- *
13397
- * Calling `event.preventDefault()` does **NOT** have any effect.
13599
+ * Specifies how to run image animations (E.g. GIFs). Can be `animate`,
13600
+ * `animateOnce` or `noAnimation`. Default is `animate`.
13398
13601
  */
13399
- addEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void, useCapture?: boolean): this;
13400
- removeEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void): this;
13602
+ imageAnimationPolicy?: ('animate' | 'animateOnce' | 'noAnimation');
13401
13603
  /**
13402
- * Emitted when a user or the page wants to start navigation anywhere in the
13403
- * `<webview>` or any frames embedded within. It can happen when the
13404
- * `window.location` object is changed or a user clicks a link in the page.
13405
- *
13406
- * This event will not emit when the navigation is started programmatically with
13407
- * APIs like `<webview>.loadURL` and `<webview>.back`.
13408
- *
13409
- * It is also not emitted during in-page navigation, such as clicking anchor links
13410
- * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
13411
- * this purpose.
13412
- *
13413
- * Calling `event.preventDefault()` does **NOT** have any effect.
13604
+ * Enables image support. Default is `true`.
13414
13605
  */
13415
- addEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void, useCapture?: boolean): this;
13416
- removeEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void): this;
13606
+ images?: boolean;
13417
13607
  /**
13418
- * Emitted when any frame (including main) starts navigating. `isInPlace` will be
13419
- * `true` for in-page navigations.
13608
+ * Enables JavaScript support. Default is `true`.
13420
13609
  */
13421
- addEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void, useCapture?: boolean): this;
13422
- removeEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void): this;
13610
+ javascript?: boolean;
13423
13611
  /**
13424
- * Emitted after a server side redirect occurs during navigation. For example a 302
13425
- * redirect.
13612
+ * Defaults to `0`.
13426
13613
  */
13427
- addEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void, useCapture?: boolean): this;
13428
- removeEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void): this;
13614
+ minimumFontSize?: number;
13429
13615
  /**
13430
- * Emitted when a navigation is done.
13431
- *
13432
- * This event is not emitted for in-page navigations, such as clicking anchor links
13433
- * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
13434
- * this purpose.
13616
+ * Whether dragging and dropping a file or link onto the page causes a navigation.
13617
+ * Default is `false`.
13435
13618
  */
13436
- addEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void, useCapture?: boolean): this;
13437
- removeEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void): this;
13619
+ navigateOnDragDrop?: boolean;
13438
13620
  /**
13439
- * Emitted when any frame navigation is done.
13440
- *
13441
- * This event is not emitted for in-page navigations, such as clicking anchor links
13442
- * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
13443
- * this purpose.
13621
+ * Whether node integration is enabled. Default is `false`.
13444
13622
  */
13445
- addEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void, useCapture?: boolean): this;
13446
- removeEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void): this;
13623
+ nodeIntegration?: boolean;
13447
13624
  /**
13448
- * Emitted when an in-page navigation happened.
13449
- *
13450
- * When in-page navigation happens, the page URL changes but does not cause
13451
- * navigation outside of the page. Examples of this occurring are when anchor links
13452
- * are clicked or when the DOM `hashchange` event is triggered.
13625
+ * Experimental option for enabling Node.js support in sub-frames such as iframes
13626
+ * and child windows. All your preloads will load for every iframe, you can use
13627
+ * `process.isMainFrame` to determine if you are in the main frame or not.
13453
13628
  */
13454
- addEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void, useCapture?: boolean): this;
13455
- removeEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void): this;
13629
+ nodeIntegrationInSubFrames?: boolean;
13456
13630
  /**
13457
- * Fired when the guest page attempts to close itself.
13458
- *
13459
- * The following example code navigates the `webview` to `about:blank` when the
13460
- * guest attempts to close itself.
13631
+ * Whether node integration is enabled in web workers. Default is `false`. More
13632
+ * about this can be found in Multithreading.
13461
13633
  */
13462
- addEventListener(event: 'close', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13463
- removeEventListener(event: 'close', listener: (event: DOMEvent) => void): this;
13634
+ nodeIntegrationInWorker?: boolean;
13464
13635
  /**
13465
- * Fired when the guest page has sent an asynchronous message to embedder page.
13466
- *
13467
- * With `sendToHost` method and `ipc-message` event you can communicate between
13468
- * guest page and embedder page:
13636
+ * Whether to enable offscreen rendering for the browser window. Defaults to
13637
+ * `false`. See the offscreen rendering tutorial for more details.
13469
13638
  */
13470
- addEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void, useCapture?: boolean): this;
13471
- removeEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void): this;
13639
+ offscreen?: boolean;
13472
13640
  /**
13473
- * Fired when the renderer process is crashed.
13641
+ * Sets the session used by the page according to the session's partition string.
13642
+ * If `partition` starts with `persist:`, the page will use a persistent session
13643
+ * available to all pages in the app with the same `partition`. If there is no
13644
+ * `persist:` prefix, the page will use an in-memory session. By assigning the same
13645
+ * `partition`, multiple pages can share the same session. Default is the default
13646
+ * session.
13474
13647
  */
13475
- addEventListener(event: 'crashed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13476
- removeEventListener(event: 'crashed', listener: (event: DOMEvent) => void): this;
13648
+ partition?: string;
13477
13649
  /**
13478
- * Fired when a plugin process is crashed.
13650
+ * Whether plugins should be enabled. Default is `false`.
13479
13651
  */
13480
- addEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void, useCapture?: boolean): this;
13481
- removeEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void): this;
13652
+ plugins?: boolean;
13482
13653
  /**
13483
- * Fired when the WebContents is destroyed.
13654
+ * Specifies a script that will be loaded before other scripts run in the page.
13655
+ * This script will always have access to node APIs no matter whether node
13656
+ * integration is turned on or off. The value should be the absolute file path to
13657
+ * the script. When node integration is turned off, the preload script can
13658
+ * reintroduce Node global symbols back to the global scope. See example here.
13484
13659
  */
13485
- addEventListener(event: 'destroyed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13486
- removeEventListener(event: 'destroyed', listener: (event: DOMEvent) => void): this;
13660
+ preload?: string;
13487
13661
  /**
13488
- * Emitted when media starts playing.
13662
+ * Whether to enable browser style consecutive dialog protection. Default is
13663
+ * `false`.
13489
13664
  */
13490
- addEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13491
- removeEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void): this;
13665
+ safeDialogs?: boolean;
13492
13666
  /**
13493
- * Emitted when media is paused or done playing.
13667
+ * The message to display when consecutive dialog protection is triggered. If not
13668
+ * defined the default message would be used, note that currently the default
13669
+ * message is in English and not localized.
13494
13670
  */
13495
- addEventListener(event: 'media-paused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13496
- removeEventListener(event: 'media-paused', listener: (event: DOMEvent) => void): this;
13671
+ safeDialogsMessage?: string;
13497
13672
  /**
13498
- * Emitted when a page's theme color changes. This is usually due to encountering a
13499
- * meta tag:
13673
+ * If set, this will sandbox the renderer associated with the window, making it
13674
+ * compatible with the Chromium OS-level sandbox and disabling the Node.js engine.
13675
+ * This is not the same as the `nodeIntegration` option and the APIs available to
13676
+ * the preload script are more limited. Read more about the option here.
13500
13677
  */
13501
- addEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void, useCapture?: boolean): this;
13502
- removeEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void): this;
13678
+ sandbox?: boolean;
13503
13679
  /**
13504
- * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
13680
+ * Enables scroll bounce (rubber banding) effect on macOS. Default is `false`.
13681
+ *
13682
+ * @platform darwin
13505
13683
  */
13506
- addEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void, useCapture?: boolean): this;
13507
- removeEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void): this;
13684
+ scrollBounce?: boolean;
13508
13685
  /**
13509
- * Emitted when a link is clicked in DevTools or 'Open in new tab' is selected for
13510
- * a link in its context menu.
13686
+ * Sets the session used by the page. Instead of passing the Session object
13687
+ * directly, you can also choose to use the `partition` option instead, which
13688
+ * accepts a partition string. When both `session` and `partition` are provided,
13689
+ * `session` will be preferred. Default is the default session.
13511
13690
  */
13512
- addEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void, useCapture?: boolean): this;
13513
- removeEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void): this;
13691
+ session?: Session;
13514
13692
  /**
13515
- * Emitted when DevTools is opened.
13693
+ * Whether to enable the builtin spellchecker. Default is `true`.
13516
13694
  */
13517
- addEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13518
- removeEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void): this;
13695
+ spellcheck?: boolean;
13519
13696
  /**
13520
- * Emitted when DevTools is closed.
13697
+ * Make TextArea elements resizable. Default is `true`.
13521
13698
  */
13522
- addEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13523
- removeEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void): this;
13699
+ textAreasAreResizable?: boolean;
13524
13700
  /**
13525
- * Emitted when DevTools is focused / opened.
13701
+ * Enforces the v8 code caching policy used by blink. Accepted values are
13526
13702
  */
13527
- addEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13528
- removeEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void): this;
13703
+ v8CacheOptions?: ('none' | 'code' | 'bypassHeatCheck' | 'bypassHeatCheckAndEagerCompile');
13529
13704
  /**
13530
- * Emitted when there is a new context menu that needs to be handled.
13705
+ * Enables WebGL support. Default is `true`.
13531
13706
  */
13532
- addEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void, useCapture?: boolean): this;
13533
- removeEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void): this;
13534
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
13535
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
13536
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
13537
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
13707
+ webgl?: boolean;
13538
13708
  /**
13539
- * Adjusts the current text selection starting and ending points in the focused
13540
- * frame by the given amounts. A negative amount moves the selection towards the
13541
- * beginning of the document, and a positive amount moves the selection towards the
13542
- * end of the document.
13543
- *
13544
- * See `webContents.adjustSelection` for examples.
13709
+ * When `false`, it will disable the same-origin policy (usually using testing
13710
+ * websites by people), and set `allowRunningInsecureContent` to `true` if this
13711
+ * options has not been set by user. Default is `true`.
13712
+ */
13713
+ webSecurity?: boolean;
13714
+ /**
13715
+ * Whether to enable the `<webview>` tag. Defaults to `false`. **Note:** The
13716
+ * `preload` script configured for the `<webview>` will have node integration
13717
+ * enabled when it is executed so you should ensure remote/untrusted content is not
13718
+ * able to create a `<webview>` tag with a possibly malicious `preload` script. You
13719
+ * can use the `will-attach-webview` event on webContents to strip away the
13720
+ * `preload` script and to validate or alter the `<webview>`'s initial settings.
13545
13721
  */
13546
- adjustSelection(options: AdjustSelectionOptions): void;
13722
+ webviewTag?: boolean;
13547
13723
  /**
13548
- * Whether the guest page can go back.
13724
+ * The default zoom factor of the page, `3.0` represents `300%`. Default is `1.0`.
13549
13725
  */
13550
- canGoBack(): boolean;
13726
+ zoomFactor?: number;
13727
+ }
13728
+
13729
+ class WebRequest {
13730
+
13731
+ // Docs: https://electronjs.org/docs/api/web-request
13732
+
13551
13733
  /**
13552
- * Whether the guest page can go forward.
13734
+ * The `listener` will be called with `listener(details)` when a server initiated
13735
+ * redirect is about to occur.
13553
13736
  */
13554
- canGoForward(): boolean;
13737
+ onBeforeRedirect(filter: WebRequestFilter, listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
13555
13738
  /**
13556
- * Whether the guest page can go to `offset`.
13739
+ * The `listener` will be called with `listener(details)` when a server initiated
13740
+ * redirect is about to occur.
13557
13741
  */
13558
- canGoToOffset(offset: number): boolean;
13742
+ onBeforeRedirect(listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
13559
13743
  /**
13560
- * Resolves with a NativeImage
13744
+ * The `listener` will be called with `listener(details, callback)` when a request
13745
+ * is about to occur.
13561
13746
  *
13562
- * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
13563
- * whole visible page.
13747
+ * The `uploadData` is an array of `UploadData` objects.
13748
+ *
13749
+ * The `callback` has to be called with an `response` object.
13750
+ *
13751
+ * Some examples of valid `urls`:
13564
13752
  */
13565
- capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
13753
+ onBeforeRequest(filter: WebRequestFilter, listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
13566
13754
  /**
13567
- * Centers the current text selection in page.
13755
+ * The `listener` will be called with `listener(details, callback)` when a request
13756
+ * is about to occur.
13757
+ *
13758
+ * The `uploadData` is an array of `UploadData` objects.
13759
+ *
13760
+ * The `callback` has to be called with an `response` object.
13761
+ *
13762
+ * Some examples of valid `urls`:
13568
13763
  */
13569
- centerSelection(): void;
13764
+ onBeforeRequest(listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
13570
13765
  /**
13571
- * Clears the navigation history.
13766
+ * The `listener` will be called with `listener(details, callback)` before sending
13767
+ * an HTTP request, once the request headers are available. This may occur after a
13768
+ * TCP connection is made to the server, but before any http data is sent.
13769
+ *
13770
+ * The `callback` has to be called with a `response` object.
13572
13771
  */
13573
- clearHistory(): void;
13772
+ onBeforeSendHeaders(filter: WebRequestFilter, listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
13574
13773
  /**
13575
- * Closes the DevTools window of guest page.
13774
+ * The `listener` will be called with `listener(details, callback)` before sending
13775
+ * an HTTP request, once the request headers are available. This may occur after a
13776
+ * TCP connection is made to the server, but before any http data is sent.
13777
+ *
13778
+ * The `callback` has to be called with a `response` object.
13576
13779
  */
13577
- closeDevTools(): void;
13780
+ onBeforeSendHeaders(listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
13578
13781
  /**
13579
- * Executes editing command `copy` in page.
13782
+ * The `listener` will be called with `listener(details)` when a request is
13783
+ * completed.
13580
13784
  */
13581
- copy(): void;
13785
+ onCompleted(filter: WebRequestFilter, listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
13582
13786
  /**
13583
- * Executes editing command `cut` in page.
13787
+ * The `listener` will be called with `listener(details)` when a request is
13788
+ * completed.
13584
13789
  */
13585
- cut(): void;
13790
+ onCompleted(listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
13586
13791
  /**
13587
- * Executes editing command `delete` in page.
13792
+ * The `listener` will be called with `listener(details)` when an error occurs.
13588
13793
  */
13589
- delete(): void;
13794
+ onErrorOccurred(filter: WebRequestFilter, listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
13590
13795
  /**
13591
- * Initiates a download of the resource at `url` without navigating.
13796
+ * The `listener` will be called with `listener(details)` when an error occurs.
13592
13797
  */
13593
- downloadURL(url: string): void;
13798
+ onErrorOccurred(listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
13594
13799
  /**
13595
- * A promise that resolves with the result of the executed code or is rejected if
13596
- * the result of the code is a rejected promise.
13800
+ * The `listener` will be called with `listener(details, callback)` when HTTP
13801
+ * response headers of a request have been received.
13597
13802
  *
13598
- * Evaluates `code` in page. If `userGesture` is set, it will create the user
13599
- * gesture context in the page. HTML APIs like `requestFullScreen`, which require
13600
- * user action, can take advantage of this option for automation.
13803
+ * The `callback` has to be called with a `response` object.
13601
13804
  */
13602
- executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
13805
+ onHeadersReceived(filter: WebRequestFilter, listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
13603
13806
  /**
13604
- * The request id used for the request.
13807
+ * The `listener` will be called with `listener(details, callback)` when HTTP
13808
+ * response headers of a request have been received.
13605
13809
  *
13606
- * Starts a request to find all matches for the `text` in the web page. The result
13607
- * of the request can be obtained by subscribing to `found-in-page` event.
13810
+ * The `callback` has to be called with a `response` object.
13608
13811
  */
13609
- findInPage(text: string, options?: FindInPageOptions): number;
13812
+ onHeadersReceived(listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
13610
13813
  /**
13611
- * The title of guest page.
13814
+ * The `listener` will be called with `listener(details)` when first byte of the
13815
+ * response body is received. For HTTP requests, this means that the status line
13816
+ * and response headers are available.
13612
13817
  */
13613
- getTitle(): string;
13818
+ onResponseStarted(filter: WebRequestFilter, listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
13614
13819
  /**
13615
- * The URL of guest page.
13820
+ * The `listener` will be called with `listener(details)` when first byte of the
13821
+ * response body is received. For HTTP requests, this means that the status line
13822
+ * and response headers are available.
13616
13823
  */
13617
- getURL(): string;
13824
+ onResponseStarted(listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
13618
13825
  /**
13619
- * The user agent for guest page.
13826
+ * The `listener` will be called with `listener(details)` just before a request is
13827
+ * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
13828
+ * response are visible by the time this listener is fired.
13620
13829
  */
13621
- getUserAgent(): string;
13830
+ onSendHeaders(filter: WebRequestFilter, listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
13622
13831
  /**
13623
- * The WebContents ID of this `webview`.
13832
+ * The `listener` will be called with `listener(details)` just before a request is
13833
+ * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
13834
+ * response are visible by the time this listener is fired.
13624
13835
  */
13625
- getWebContentsId(): number;
13836
+ onSendHeaders(listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
13837
+ }
13838
+
13839
+ interface WebRequestFilter {
13840
+
13841
+ // Docs: https://electronjs.org/docs/api/structures/web-request-filter
13842
+
13626
13843
  /**
13627
- * the current zoom factor.
13844
+ * Array of types that will be used to filter out the requests that do not match
13845
+ * the types. When not specified, all types will be matched. Can be `mainFrame`,
13846
+ * `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`,
13847
+ * `cspReport`, `media` or `webSocket`.
13628
13848
  */
13629
- getZoomFactor(): number;
13849
+ types?: Array<'mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket'>;
13630
13850
  /**
13631
- * the current zoom level.
13851
+ * Array of URL patterns that will be used to filter out the requests that do not
13852
+ * match the URL patterns.
13632
13853
  */
13633
- getZoomLevel(): number;
13854
+ urls: string[];
13855
+ }
13856
+
13857
+ interface WebSource {
13858
+
13859
+ // Docs: https://electronjs.org/docs/api/structures/web-source
13860
+
13861
+ code: string;
13862
+ url?: string;
13863
+ }
13864
+
13865
+ interface WebviewTag extends HTMLElement {
13866
+
13867
+ // Docs: https://electronjs.org/docs/api/webview-tag
13868
+
13634
13869
  /**
13635
- * Makes the guest page go back.
13870
+ * Fired when a load has committed. This includes navigation within the current
13871
+ * document as well as subframe document-level loads, but does not include
13872
+ * asynchronous resource loads.
13636
13873
  */
13637
- goBack(): void;
13874
+ addEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void, useCapture?: boolean): this;
13875
+ removeEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void): this;
13638
13876
  /**
13639
- * Makes the guest page go forward.
13877
+ * Fired when the navigation is done, i.e. the spinner of the tab will stop
13878
+ * spinning, and the `onload` event is dispatched.
13640
13879
  */
13641
- goForward(): void;
13880
+ addEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13881
+ removeEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void): this;
13642
13882
  /**
13643
- * Navigates to the specified absolute index.
13883
+ * This event is like `did-finish-load`, but fired when the load failed or was
13884
+ * cancelled, e.g. `window.stop()` is invoked.
13644
13885
  */
13645
- goToIndex(index: number): void;
13886
+ addEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void, useCapture?: boolean): this;
13887
+ removeEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void): this;
13646
13888
  /**
13647
- * Navigates to the specified offset from the "current entry".
13889
+ * Fired when a frame has done navigation.
13648
13890
  */
13649
- goToOffset(offset: number): void;
13891
+ addEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void, useCapture?: boolean): this;
13892
+ removeEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void): this;
13650
13893
  /**
13651
- * A promise that resolves with a key for the inserted CSS that can later be used
13652
- * to remove the CSS via `<webview>.removeInsertedCSS(key)`.
13653
- *
13654
- * Injects CSS into the current web page and returns a unique key for the inserted
13655
- * stylesheet.
13894
+ * Corresponds to the points in time when the spinner of the tab starts spinning.
13656
13895
  */
13657
- insertCSS(css: string): Promise<string>;
13896
+ addEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13897
+ removeEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void): this;
13658
13898
  /**
13659
- * Inserts `text` to the focused element.
13899
+ * Corresponds to the points in time when the spinner of the tab stops spinning.
13660
13900
  */
13661
- insertText(text: string): Promise<void>;
13901
+ addEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13902
+ removeEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void): this;
13662
13903
  /**
13663
- * Starts inspecting element at position (`x`, `y`) of guest page.
13904
+ * Fired when attached to the embedder web contents.
13664
13905
  */
13665
- inspectElement(x: number, y: number): void;
13906
+ addEventListener(event: 'did-attach', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13907
+ removeEventListener(event: 'did-attach', listener: (event: DOMEvent) => void): this;
13666
13908
  /**
13667
- * Opens the DevTools for the service worker context present in the guest page.
13909
+ * Fired when document in the given frame is loaded.
13668
13910
  */
13669
- inspectServiceWorker(): void;
13911
+ addEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13912
+ removeEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void): this;
13670
13913
  /**
13671
- * Opens the DevTools for the shared worker context present in the guest page.
13914
+ * Fired when page title is set during navigation. `explicitSet` is false when
13915
+ * title is synthesized from file url.
13672
13916
  */
13673
- inspectSharedWorker(): void;
13917
+ addEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void, useCapture?: boolean): this;
13918
+ removeEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void): this;
13674
13919
  /**
13675
- * Whether guest page has been muted.
13920
+ * Fired when page receives favicon urls.
13676
13921
  */
13677
- isAudioMuted(): boolean;
13922
+ addEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void, useCapture?: boolean): this;
13923
+ removeEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void): this;
13678
13924
  /**
13679
- * Whether the renderer process has crashed.
13925
+ * Fired when page enters fullscreen triggered by HTML API.
13680
13926
  */
13681
- isCrashed(): boolean;
13927
+ addEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13928
+ removeEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void): this;
13682
13929
  /**
13683
- * Whether audio is currently playing.
13930
+ * Fired when page leaves fullscreen triggered by HTML API.
13684
13931
  */
13685
- isCurrentlyAudible(): boolean;
13932
+ addEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13933
+ removeEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void): this;
13686
13934
  /**
13687
- * Whether DevTools window of guest page is focused.
13935
+ * Fired when the guest window logs a console message.
13936
+ *
13937
+ * The following example code forwards all log messages to the embedder's console
13938
+ * without regard for log level or other properties.
13688
13939
  */
13689
- isDevToolsFocused(): boolean;
13940
+ addEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void, useCapture?: boolean): this;
13941
+ removeEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void): this;
13690
13942
  /**
13691
- * Whether guest page has a DevTools window attached.
13943
+ * Fired when a result is available for `webview.findInPage` request.
13692
13944
  */
13693
- isDevToolsOpened(): boolean;
13945
+ addEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void, useCapture?: boolean): this;
13946
+ removeEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void): this;
13947
+ /**
13948
+ * Emitted when a user or the page wants to start navigation. It can happen when
13949
+ * the `window.location` object is changed or a user clicks a link in the page.
13950
+ *
13951
+ * This event will not emit when the navigation is started programmatically with
13952
+ * APIs like `<webview>.loadURL` and `<webview>.back`.
13953
+ *
13954
+ * It is also not emitted during in-page navigation, such as clicking anchor links
13955
+ * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
13956
+ * this purpose.
13957
+ *
13958
+ * Calling `event.preventDefault()` does **NOT** have any effect.
13959
+ */
13960
+ addEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void, useCapture?: boolean): this;
13961
+ removeEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void): this;
13694
13962
  /**
13695
- * Whether guest page is still loading resources.
13963
+ * Emitted when a user or the page wants to start navigation anywhere in the
13964
+ * `<webview>` or any frames embedded within. It can happen when the
13965
+ * `window.location` object is changed or a user clicks a link in the page.
13966
+ *
13967
+ * This event will not emit when the navigation is started programmatically with
13968
+ * APIs like `<webview>.loadURL` and `<webview>.back`.
13969
+ *
13970
+ * It is also not emitted during in-page navigation, such as clicking anchor links
13971
+ * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
13972
+ * this purpose.
13973
+ *
13974
+ * Calling `event.preventDefault()` does **NOT** have any effect.
13696
13975
  */
13697
- isLoading(): boolean;
13976
+ addEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void, useCapture?: boolean): this;
13977
+ removeEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void): this;
13698
13978
  /**
13699
- * Whether the main frame (and not just iframes or frames within it) is still
13700
- * loading.
13979
+ * Emitted when any frame (including main) starts navigating. `isInPlace` will be
13980
+ * `true` for in-page navigations.
13701
13981
  */
13702
- isLoadingMainFrame(): boolean;
13982
+ addEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void, useCapture?: boolean): this;
13983
+ removeEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void): this;
13703
13984
  /**
13704
- * Whether the guest page is waiting for a first-response for the main resource of
13705
- * the page.
13985
+ * Emitted after a server side redirect occurs during navigation. For example a 302
13986
+ * redirect.
13706
13987
  */
13707
- isWaitingForResponse(): boolean;
13988
+ addEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void, useCapture?: boolean): this;
13989
+ removeEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void): this;
13708
13990
  /**
13709
- * The promise will resolve when the page has finished loading (see
13710
- * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
13991
+ * Emitted when a navigation is done.
13711
13992
  *
13712
- * Loads the `url` in the webview, the `url` must contain the protocol prefix, e.g.
13713
- * the `http://` or `file://`.
13993
+ * This event is not emitted for in-page navigations, such as clicking anchor links
13994
+ * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
13995
+ * this purpose.
13714
13996
  */
13715
- loadURL(url: string, options?: LoadURLOptions): Promise<void>;
13997
+ addEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void, useCapture?: boolean): this;
13998
+ removeEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void): this;
13716
13999
  /**
13717
- * Opens a DevTools window for guest page.
14000
+ * Emitted when any frame navigation is done.
14001
+ *
14002
+ * This event is not emitted for in-page navigations, such as clicking anchor links
14003
+ * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
14004
+ * this purpose.
13718
14005
  */
13719
- openDevTools(): void;
14006
+ addEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void, useCapture?: boolean): this;
14007
+ removeEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void): this;
13720
14008
  /**
13721
- * Executes editing command `paste` in page.
14009
+ * Emitted when an in-page navigation happened.
14010
+ *
14011
+ * When in-page navigation happens, the page URL changes but does not cause
14012
+ * navigation outside of the page. Examples of this occurring are when anchor links
14013
+ * are clicked or when the DOM `hashchange` event is triggered.
13722
14014
  */
13723
- paste(): void;
14015
+ addEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void, useCapture?: boolean): this;
14016
+ removeEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void): this;
13724
14017
  /**
13725
- * Executes editing command `pasteAndMatchStyle` in page.
14018
+ * Fired when the guest page attempts to close itself.
14019
+ *
14020
+ * The following example code navigates the `webview` to `about:blank` when the
14021
+ * guest attempts to close itself.
13726
14022
  */
13727
- pasteAndMatchStyle(): void;
14023
+ addEventListener(event: 'close', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14024
+ removeEventListener(event: 'close', listener: (event: DOMEvent) => void): this;
13728
14025
  /**
13729
- * Prints `webview`'s web page. Same as `webContents.print([options])`.
14026
+ * Fired when the guest page has sent an asynchronous message to embedder page.
14027
+ *
14028
+ * With `sendToHost` method and `ipc-message` event you can communicate between
14029
+ * guest page and embedder page:
13730
14030
  */
13731
- print(options?: WebviewTagPrintOptions): Promise<void>;
14031
+ addEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void, useCapture?: boolean): this;
14032
+ removeEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void): this;
13732
14033
  /**
13733
- * Resolves with the generated PDF data.
13734
- *
13735
- * Prints `webview`'s web page as PDF, Same as `webContents.printToPDF(options)`.
14034
+ * Fired when the renderer process is crashed.
13736
14035
  */
13737
- printToPDF(options: PrintToPDFOptions): Promise<Uint8Array>;
14036
+ addEventListener(event: 'crashed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14037
+ removeEventListener(event: 'crashed', listener: (event: DOMEvent) => void): this;
13738
14038
  /**
13739
- * Executes editing command `redo` in page.
14039
+ * Fired when a plugin process is crashed.
13740
14040
  */
13741
- redo(): void;
14041
+ addEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void, useCapture?: boolean): this;
14042
+ removeEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void): this;
13742
14043
  /**
13743
- * Reloads the guest page.
14044
+ * Fired when the WebContents is destroyed.
13744
14045
  */
13745
- reload(): void;
14046
+ addEventListener(event: 'destroyed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14047
+ removeEventListener(event: 'destroyed', listener: (event: DOMEvent) => void): this;
13746
14048
  /**
13747
- * Reloads the guest page and ignores cache.
14049
+ * Emitted when media starts playing.
13748
14050
  */
13749
- reloadIgnoringCache(): void;
14051
+ addEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14052
+ removeEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void): this;
13750
14053
  /**
13751
- * Resolves if the removal was successful.
13752
- *
13753
- * Removes the inserted CSS from the current web page. The stylesheet is identified
13754
- * by its key, which is returned from `<webview>.insertCSS(css)`.
14054
+ * Emitted when media is paused or done playing.
13755
14055
  */
13756
- removeInsertedCSS(key: string): Promise<void>;
14056
+ addEventListener(event: 'media-paused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14057
+ removeEventListener(event: 'media-paused', listener: (event: DOMEvent) => void): this;
13757
14058
  /**
13758
- * Executes editing command `replace` in page.
14059
+ * Emitted when a page's theme color changes. This is usually due to encountering a
14060
+ * meta tag:
13759
14061
  */
13760
- replace(text: string): void;
14062
+ addEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void, useCapture?: boolean): this;
14063
+ removeEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void): this;
13761
14064
  /**
13762
- * Executes editing command `replaceMisspelling` in page.
14065
+ * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
13763
14066
  */
13764
- replaceMisspelling(text: string): void;
14067
+ addEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void, useCapture?: boolean): this;
14068
+ removeEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void): this;
13765
14069
  /**
13766
- * Scrolls to the bottom of the current `<webview>`.
14070
+ * Emitted when a link is clicked in DevTools or 'Open in new tab' is selected for
14071
+ * a link in its context menu.
13767
14072
  */
13768
- scrollToBottom(): void;
14073
+ addEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void, useCapture?: boolean): this;
14074
+ removeEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void): this;
13769
14075
  /**
13770
- * Scrolls to the top of the current `<webview>`.
14076
+ * Emitted when DevTools is opened.
13771
14077
  */
13772
- scrollToTop(): void;
14078
+ addEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14079
+ removeEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void): this;
13773
14080
  /**
13774
- * Executes editing command `selectAll` in page.
14081
+ * Emitted when DevTools is closed.
13775
14082
  */
13776
- selectAll(): void;
14083
+ addEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14084
+ removeEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void): this;
13777
14085
  /**
13778
- * Send an asynchronous message to renderer process via `channel`, you can also
13779
- * send arbitrary arguments. The renderer process can handle the message by
13780
- * listening to the `channel` event with the `ipcRenderer` module.
13781
- *
13782
- * See webContents.send for examples.
14086
+ * Emitted when DevTools is focused / opened.
13783
14087
  */
13784
- send(channel: string, ...args: any[]): Promise<void>;
14088
+ addEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14089
+ removeEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void): this;
13785
14090
  /**
13786
- * Sends an input `event` to the page.
13787
- *
13788
- * See webContents.sendInputEvent for detailed description of `event` object.
14091
+ * Emitted when there is a new context menu that needs to be handled.
13789
14092
  */
13790
- sendInputEvent(event: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): Promise<void>;
14093
+ addEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void, useCapture?: boolean): this;
14094
+ removeEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void): this;
14095
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
14096
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
14097
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
14098
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
13791
14099
  /**
13792
- * Send an asynchronous message to renderer process via `channel`, you can also
13793
- * send arbitrary arguments. The renderer process can handle the message by
13794
- * listening to the `channel` event with the `ipcRenderer` module.
14100
+ * Adjusts the current text selection starting and ending points in the focused
14101
+ * frame by the given amounts. A negative amount moves the selection towards the
14102
+ * beginning of the document, and a positive amount moves the selection towards the
14103
+ * end of the document.
13795
14104
  *
13796
- * See webContents.sendToFrame for examples.
14105
+ * See `webContents.adjustSelection` for examples.
13797
14106
  */
13798
- sendToFrame(frameId: [number, number], channel: string, ...args: any[]): Promise<void>;
14107
+ adjustSelection(options: AdjustSelectionOptions): void;
13799
14108
  /**
13800
- * Set guest page muted.
14109
+ * Whether the guest page can go back.
13801
14110
  */
13802
- setAudioMuted(muted: boolean): void;
14111
+ canGoBack(): boolean;
13803
14112
  /**
13804
- * Overrides the user agent for the guest page.
14113
+ * Whether the guest page can go forward.
13805
14114
  */
13806
- setUserAgent(userAgent: string): void;
14115
+ canGoForward(): boolean;
13807
14116
  /**
13808
- * Sets the maximum and minimum pinch-to-zoom level.
14117
+ * Whether the guest page can go to `offset`.
13809
14118
  */
13810
- setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
14119
+ canGoToOffset(offset: number): boolean;
13811
14120
  /**
13812
- * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
13813
- * divided by 100, so 300% = 3.0.
14121
+ * Resolves with a NativeImage
14122
+ *
14123
+ * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
14124
+ * whole visible page.
13814
14125
  */
13815
- setZoomFactor(factor: number): void;
14126
+ capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
13816
14127
  /**
13817
- * Changes the zoom level to the specified level. The original size is 0 and each
13818
- * increment above or below represents zooming 20% larger or smaller to default
13819
- * limits of 300% and 50% of original size, respectively. The formula for this is
13820
- * `scale := 1.2 ^ level`.
13821
- *
13822
- * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
13823
- * the zoom level for a specific domain propagates across all instances of windows
13824
- * with the same domain. Differentiating the window URLs will make zoom work
13825
- * per-window.
14128
+ * Centers the current text selection in page.
13826
14129
  */
13827
- setZoomLevel(level: number): void;
14130
+ centerSelection(): void;
13828
14131
  /**
13829
- * Shows pop-up dictionary that searches the selected word on the page.
13830
- *
13831
- * @platform darwin
14132
+ * Clears the navigation history.
13832
14133
  */
13833
- showDefinitionForSelection(): void;
14134
+ clearHistory(): void;
13834
14135
  /**
13835
- * Stops any pending navigation.
14136
+ * Closes the DevTools window of guest page.
13836
14137
  */
13837
- stop(): void;
14138
+ closeDevTools(): void;
13838
14139
  /**
13839
- * Stops any `findInPage` request for the `webview` with the provided `action`.
14140
+ * Executes editing command `copy` in page.
13840
14141
  */
13841
- stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
14142
+ copy(): void;
13842
14143
  /**
13843
- * Executes editing command `undo` in page.
14144
+ * Executes editing command `cut` in page.
13844
14145
  */
13845
- undo(): void;
14146
+ cut(): void;
13846
14147
  /**
13847
- * Executes editing command `unselect` in page.
14148
+ * Executes editing command `delete` in page.
13848
14149
  */
13849
- unselect(): void;
14150
+ delete(): void;
13850
14151
  /**
13851
- * A `boolean`. When this attribute is present the guest page will be allowed to
13852
- * open new windows. Popups are disabled by default.
14152
+ * Initiates a download of the resource at `url` without navigating.
13853
14153
  */
13854
- allowpopups: boolean;
14154
+ downloadURL(url: string): void;
13855
14155
  /**
13856
- * A `string` which is a list of strings which specifies the blink features to be
13857
- * disabled separated by `,`. The full list of supported feature strings can be
13858
- * found in the RuntimeEnabledFeatures.json5 file.
14156
+ * A promise that resolves with the result of the executed code or is rejected if
14157
+ * the result of the code is a rejected promise.
14158
+ *
14159
+ * Evaluates `code` in page. If `userGesture` is set, it will create the user
14160
+ * gesture context in the page. HTML APIs like `requestFullScreen`, which require
14161
+ * user action, can take advantage of this option for automation.
13859
14162
  */
13860
- disableblinkfeatures: string;
14163
+ executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
13861
14164
  /**
13862
- * A `boolean`. When this attribute is present the guest page will have web
13863
- * security disabled. Web security is enabled by default.
14165
+ * The request id used for the request.
13864
14166
  *
13865
- * This value can only be modified before the first navigation.
14167
+ * Starts a request to find all matches for the `text` in the web page. The result
14168
+ * of the request can be obtained by subscribing to `found-in-page` event.
13866
14169
  */
13867
- disablewebsecurity: boolean;
14170
+ findInPage(text: string, options?: FindInPageOptions): number;
13868
14171
  /**
13869
- * A `string` which is a list of strings which specifies the blink features to be
13870
- * enabled separated by `,`. The full list of supported feature strings can be
13871
- * found in the RuntimeEnabledFeatures.json5 file.
14172
+ * The title of guest page.
13872
14173
  */
13873
- enableblinkfeatures: string;
14174
+ getTitle(): string;
13874
14175
  /**
13875
- * A `string` that sets the referrer URL for the guest page.
14176
+ * The URL of guest page.
13876
14177
  */
13877
- httpreferrer: string;
14178
+ getURL(): string;
13878
14179
  /**
13879
- * A `boolean`. When this attribute is present the guest page in `webview` will
13880
- * have node integration and can use node APIs like `require` and `process` to
13881
- * access low level system resources. Node integration is disabled by default in
13882
- * the guest page.
14180
+ * The user agent for guest page.
13883
14181
  */
13884
- nodeintegration: boolean;
14182
+ getUserAgent(): string;
13885
14183
  /**
13886
- * A `boolean` for the experimental option for enabling NodeJS support in
13887
- * sub-frames such as iframes inside the `webview`. All your preloads will load for
13888
- * every iframe, you can use `process.isMainFrame` to determine if you are in the
13889
- * main frame or not. This option is disabled by default in the guest page.
14184
+ * The WebContents ID of this `webview`.
13890
14185
  */
13891
- nodeintegrationinsubframes: boolean;
14186
+ getWebContentsId(): number;
13892
14187
  /**
13893
- * A `string` that sets the session used by the page. If `partition` starts with
13894
- * `persist:`, the page will use a persistent session available to all pages in the
13895
- * app with the same `partition`. if there is no `persist:` prefix, the page will
13896
- * use an in-memory session. By assigning the same `partition`, multiple pages can
13897
- * share the same session. If the `partition` is unset then default session of the
13898
- * app will be used.
13899
- *
13900
- * This value can only be modified before the first navigation, since the session
13901
- * of an active renderer process cannot change. Subsequent attempts to modify the
13902
- * value will fail with a DOM exception.
14188
+ * the current zoom factor.
13903
14189
  */
13904
- partition: string;
14190
+ getZoomFactor(): number;
13905
14191
  /**
13906
- * A `boolean`. When this attribute is present the guest page in `webview` will be
13907
- * able to use browser plugins. Plugins are disabled by default.
14192
+ * the current zoom level.
13908
14193
  */
13909
- plugins: boolean;
14194
+ getZoomLevel(): number;
13910
14195
  /**
13911
- * A `string` that specifies a script that will be loaded before other scripts run
13912
- * in the guest page. The protocol of script's URL must be `file:` (even when using
13913
- * `asar:` archives) because it will be loaded by Node's `require` under the hood,
13914
- * which treats `asar:` archives as virtual directories.
13915
- *
13916
- * When the guest page doesn't have node integration this script will still have
13917
- * access to all Node APIs, but global objects injected by Node will be deleted
13918
- * after this script has finished executing.
14196
+ * Makes the guest page go back.
13919
14197
  */
13920
- preload: string;
14198
+ goBack(): void;
13921
14199
  /**
13922
- * A `string` representing the visible URL. Writing to this attribute initiates
13923
- * top-level navigation.
13924
- *
13925
- * Assigning `src` its own value will reload the current page.
13926
- *
13927
- * The `src` attribute can also accept data URLs, such as `data:text/plain,Hello,
13928
- * world!`.
14200
+ * Makes the guest page go forward.
13929
14201
  */
13930
- src: string;
14202
+ goForward(): void;
13931
14203
  /**
13932
- * A `string` that sets the user agent for the guest page before the page is
13933
- * navigated to. Once the page is loaded, use the `setUserAgent` method to change
13934
- * the user agent.
14204
+ * Navigates to the specified absolute index.
13935
14205
  */
13936
- useragent: string;
14206
+ goToIndex(index: number): void;
13937
14207
  /**
13938
- * A `string` which is a comma separated list of strings which specifies the web
13939
- * preferences to be set on the webview. The full list of supported preference
13940
- * strings can be found in BrowserWindow.
13941
- *
13942
- * The string follows the same format as the features string in `window.open`. A
13943
- * name by itself is given a `true` boolean value. A preference can be set to
13944
- * another value by including an `=`, followed by the value. Special values `yes`
13945
- * and `1` are interpreted as `true`, while `no` and `0` are interpreted as
13946
- * `false`.
14208
+ * Navigates to the specified offset from the "current entry".
13947
14209
  */
13948
- webpreferences: string;
13949
- }
13950
-
13951
- interface AboutPanelOptionsOptions {
14210
+ goToOffset(offset: number): void;
13952
14211
  /**
13953
- * The app's name.
14212
+ * A promise that resolves with a key for the inserted CSS that can later be used
14213
+ * to remove the CSS via `<webview>.removeInsertedCSS(key)`.
14214
+ *
14215
+ * Injects CSS into the current web page and returns a unique key for the inserted
14216
+ * stylesheet.
13954
14217
  */
13955
- applicationName?: string;
14218
+ insertCSS(css: string): Promise<string>;
13956
14219
  /**
13957
- * The app's version.
14220
+ * Inserts `text` to the focused element.
13958
14221
  */
13959
- applicationVersion?: string;
14222
+ insertText(text: string): Promise<void>;
13960
14223
  /**
13961
- * Copyright information.
14224
+ * Starts inspecting element at position (`x`, `y`) of guest page.
13962
14225
  */
13963
- copyright?: string;
14226
+ inspectElement(x: number, y: number): void;
13964
14227
  /**
13965
- * The app's build version number.
13966
- *
13967
- * @platform darwin
14228
+ * Opens the DevTools for the service worker context present in the guest page.
13968
14229
  */
13969
- version?: string;
14230
+ inspectServiceWorker(): void;
13970
14231
  /**
13971
- * Credit information.
13972
- *
13973
- * @platform darwin,win32
14232
+ * Opens the DevTools for the shared worker context present in the guest page.
13974
14233
  */
13975
- credits?: string;
14234
+ inspectSharedWorker(): void;
13976
14235
  /**
13977
- * List of app authors.
13978
- *
13979
- * @platform linux
14236
+ * Whether guest page has been muted.
13980
14237
  */
13981
- authors?: string[];
14238
+ isAudioMuted(): boolean;
13982
14239
  /**
13983
- * The app's website.
13984
- *
13985
- * @platform linux
14240
+ * Whether the renderer process has crashed.
13986
14241
  */
13987
- website?: string;
14242
+ isCrashed(): boolean;
13988
14243
  /**
13989
- * Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as
13990
- * 64x64 pixels while retaining aspect ratio.
13991
- *
13992
- * @platform linux,win32
14244
+ * Whether audio is currently playing.
13993
14245
  */
13994
- iconPath?: string;
13995
- }
13996
-
13997
- interface AddRepresentationOptions {
14246
+ isCurrentlyAudible(): boolean;
13998
14247
  /**
13999
- * The scale factor to add the image representation for.
14248
+ * Whether DevTools window of guest page is focused.
14000
14249
  */
14001
- scaleFactor?: number;
14250
+ isDevToolsFocused(): boolean;
14002
14251
  /**
14003
- * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
14252
+ * Whether guest page has a DevTools window attached.
14004
14253
  */
14005
- width?: number;
14254
+ isDevToolsOpened(): boolean;
14006
14255
  /**
14007
- * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
14256
+ * Whether guest page is still loading resources.
14008
14257
  */
14009
- height?: number;
14258
+ isLoading(): boolean;
14010
14259
  /**
14011
- * The buffer containing the raw image data.
14260
+ * Whether the main frame (and not just iframes or frames within it) is still
14261
+ * loading.
14012
14262
  */
14013
- buffer?: Buffer;
14263
+ isLoadingMainFrame(): boolean;
14014
14264
  /**
14015
- * The data URL containing either a base 64 encoded PNG or JPEG image.
14265
+ * Whether the guest page is waiting for a first-response for the main resource of
14266
+ * the page.
14016
14267
  */
14017
- dataURL?: string;
14018
- }
14019
-
14020
- interface AdjustSelectionOptions {
14268
+ isWaitingForResponse(): boolean;
14021
14269
  /**
14022
- * Amount to shift the start index of the current selection.
14270
+ * The promise will resolve when the page has finished loading (see
14271
+ * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
14272
+ *
14273
+ * Loads the `url` in the webview, the `url` must contain the protocol prefix, e.g.
14274
+ * the `http://` or `file://`.
14023
14275
  */
14024
- start?: number;
14276
+ loadURL(url: string, options?: LoadURLOptions): Promise<void>;
14025
14277
  /**
14026
- * Amount to shift the end index of the current selection.
14278
+ * Opens a DevTools window for guest page.
14027
14279
  */
14028
- end?: number;
14029
- }
14030
-
14031
- interface AnimationSettings {
14280
+ openDevTools(): void;
14032
14281
  /**
14033
- * Returns true if rich animations should be rendered. Looks at session type (e.g.
14034
- * remote desktop) and accessibility settings to give guidance for heavy
14035
- * animations.
14282
+ * Executes editing command `paste` in page.
14036
14283
  */
14037
- shouldRenderRichAnimation: boolean;
14284
+ paste(): void;
14038
14285
  /**
14039
- * Determines on a per-platform basis whether scroll animations (e.g. produced by
14040
- * home/end key) should be enabled.
14286
+ * Executes editing command `pasteAndMatchStyle` in page.
14041
14287
  */
14042
- scrollAnimationsEnabledBySystem: boolean;
14288
+ pasteAndMatchStyle(): void;
14043
14289
  /**
14044
- * Determines whether the user desires reduced motion based on platform APIs.
14290
+ * Prints `webview`'s web page. Same as `webContents.print([options])`.
14045
14291
  */
14046
- prefersReducedMotion: boolean;
14047
- }
14048
-
14049
- interface AppDetailsOptions {
14292
+ print(options?: WebviewTagPrintOptions): Promise<void>;
14050
14293
  /**
14051
- * Window's App User Model ID. It has to be set, otherwise the other options will
14052
- * have no effect.
14294
+ * Resolves with the generated PDF data.
14295
+ *
14296
+ * Prints `webview`'s web page as PDF, Same as `webContents.printToPDF(options)`.
14053
14297
  */
14054
- appId?: string;
14298
+ printToPDF(options: PrintToPDFOptions): Promise<Uint8Array>;
14055
14299
  /**
14056
- * Window's Relaunch Icon.
14300
+ * Executes editing command `redo` in page.
14057
14301
  */
14058
- appIconPath?: string;
14302
+ redo(): void;
14059
14303
  /**
14060
- * Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set.
14061
- * Default is `0`.
14304
+ * Reloads the guest page.
14062
14305
  */
14063
- appIconIndex?: number;
14306
+ reload(): void;
14064
14307
  /**
14065
- * Window's Relaunch Command.
14308
+ * Reloads the guest page and ignores cache.
14066
14309
  */
14067
- relaunchCommand?: string;
14310
+ reloadIgnoringCache(): void;
14068
14311
  /**
14069
- * Window's Relaunch Display Name.
14312
+ * Resolves if the removal was successful.
14313
+ *
14314
+ * Removes the inserted CSS from the current web page. The stylesheet is identified
14315
+ * by its key, which is returned from `<webview>.insertCSS(css)`.
14070
14316
  */
14071
- relaunchDisplayName?: string;
14072
- }
14073
-
14074
- interface ApplicationInfoForProtocolReturnValue {
14317
+ removeInsertedCSS(key: string): Promise<void>;
14075
14318
  /**
14076
- * the display icon of the app handling the protocol.
14319
+ * Executes editing command `replace` in page.
14077
14320
  */
14078
- icon: NativeImage;
14321
+ replace(text: string): void;
14079
14322
  /**
14080
- * installation path of the app handling the protocol.
14323
+ * Executes editing command `replaceMisspelling` in page.
14081
14324
  */
14082
- path: string;
14325
+ replaceMisspelling(text: string): void;
14083
14326
  /**
14084
- * display name of the app handling the protocol.
14327
+ * Scrolls to the bottom of the current `<webview>`.
14085
14328
  */
14086
- name: string;
14087
- }
14088
-
14089
- interface AuthenticationResponseDetails {
14090
- url: string;
14091
- }
14092
-
14093
- interface AuthInfo {
14094
- isProxy: boolean;
14095
- scheme: string;
14096
- host: string;
14097
- port: number;
14098
- realm: string;
14099
- }
14100
-
14101
- interface AutoResizeOptions {
14329
+ scrollToBottom(): void;
14102
14330
  /**
14103
- * If `true`, the view's width will grow and shrink together with the window.
14104
- * `false` by default.
14331
+ * Scrolls to the top of the current `<webview>`.
14105
14332
  */
14106
- width?: boolean;
14333
+ scrollToTop(): void;
14107
14334
  /**
14108
- * If `true`, the view's height will grow and shrink together with the window.
14109
- * `false` by default.
14335
+ * Executes editing command `selectAll` in page.
14110
14336
  */
14111
- height?: boolean;
14337
+ selectAll(): void;
14112
14338
  /**
14113
- * If `true`, the view's x position and width will grow and shrink proportionally
14114
- * with the window. `false` by default.
14339
+ * Send an asynchronous message to renderer process via `channel`, you can also
14340
+ * send arbitrary arguments. The renderer process can handle the message by
14341
+ * listening to the `channel` event with the `ipcRenderer` module.
14342
+ *
14343
+ * See webContents.send for examples.
14115
14344
  */
14116
- horizontal?: boolean;
14345
+ send(channel: string, ...args: any[]): Promise<void>;
14117
14346
  /**
14118
- * If `true`, the view's y position and height will grow and shrink proportionally
14119
- * with the window. `false` by default.
14347
+ * Sends an input `event` to the page.
14348
+ *
14349
+ * See webContents.sendInputEvent for detailed description of `event` object.
14120
14350
  */
14121
- vertical?: boolean;
14122
- }
14123
-
14124
- interface BeforeSendResponse {
14125
- cancel?: boolean;
14351
+ sendInputEvent(event: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): Promise<void>;
14126
14352
  /**
14127
- * When provided, request will be made with these headers.
14353
+ * Send an asynchronous message to renderer process via `channel`, you can also
14354
+ * send arbitrary arguments. The renderer process can handle the message by
14355
+ * listening to the `channel` event with the `ipcRenderer` module.
14356
+ *
14357
+ * See webContents.sendToFrame for examples.
14128
14358
  */
14129
- requestHeaders?: Record<string, (string) | (string[])>;
14130
- }
14131
-
14132
- interface BitmapOptions {
14359
+ sendToFrame(frameId: [number, number], channel: string, ...args: any[]): Promise<void>;
14133
14360
  /**
14134
- * Defaults to 1.0.
14361
+ * Set guest page muted.
14135
14362
  */
14136
- scaleFactor?: number;
14137
- }
14138
-
14139
- interface BlinkMemoryInfo {
14363
+ setAudioMuted(muted: boolean): void;
14140
14364
  /**
14141
- * Size of all allocated objects in Kilobytes.
14365
+ * Overrides the user agent for the guest page.
14142
14366
  */
14143
- allocated: number;
14367
+ setUserAgent(userAgent: string): void;
14144
14368
  /**
14145
- * Total allocated space in Kilobytes.
14369
+ * Sets the maximum and minimum pinch-to-zoom level.
14146
14370
  */
14147
- total: number;
14148
- }
14149
-
14150
- interface BluetoothPairingHandlerHandlerDetails {
14151
- deviceId: string;
14371
+ setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
14152
14372
  /**
14153
- * The type of pairing prompt being requested. One of the following values:
14373
+ * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
14374
+ * divided by 100, so 300% = 3.0.
14154
14375
  */
14155
- pairingKind: ('confirm' | 'confirmPin' | 'providePin');
14156
- frame: WebFrameMain;
14376
+ setZoomFactor(factor: number): void;
14157
14377
  /**
14158
- * The pin value to verify if `pairingKind` is `confirmPin`.
14378
+ * Changes the zoom level to the specified level. The original size is 0 and each
14379
+ * increment above or below represents zooming 20% larger or smaller to default
14380
+ * limits of 300% and 50% of original size, respectively. The formula for this is
14381
+ * `scale := 1.2 ^ level`.
14382
+ *
14383
+ * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
14384
+ * the zoom level for a specific domain propagates across all instances of windows
14385
+ * with the same domain. Differentiating the window URLs will make zoom work
14386
+ * per-window.
14159
14387
  */
14160
- pin?: string;
14161
- }
14162
-
14163
- interface BrowserViewConstructorOptions {
14388
+ setZoomLevel(level: number): void;
14164
14389
  /**
14165
- * See BrowserWindow.
14390
+ * Shows pop-up dictionary that searches the selected word on the page.
14391
+ *
14392
+ * @platform darwin
14166
14393
  */
14167
- webPreferences?: WebPreferences;
14168
- }
14169
-
14170
- interface BrowserWindowConstructorOptions {
14394
+ showDefinitionForSelection(): void;
14171
14395
  /**
14172
- * Window's width in pixels. Default is `800`.
14396
+ * Stops any pending navigation.
14173
14397
  */
14174
- width?: number;
14398
+ stop(): void;
14175
14399
  /**
14176
- * Window's height in pixels. Default is `600`.
14400
+ * Stops any `findInPage` request for the `webview` with the provided `action`.
14177
14401
  */
14178
- height?: number;
14402
+ stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
14179
14403
  /**
14180
- * (**required** if y is used) Window's left offset from screen. Default is to
14181
- * center the window.
14404
+ * Executes editing command `undo` in page.
14182
14405
  */
14183
- x?: number;
14406
+ undo(): void;
14184
14407
  /**
14185
- * (**required** if x is used) Window's top offset from screen. Default is to
14186
- * center the window.
14408
+ * Executes editing command `unselect` in page.
14187
14409
  */
14188
- y?: number;
14410
+ unselect(): void;
14189
14411
  /**
14190
- * The `width` and `height` would be used as web page's size, which means the
14191
- * actual window's size will include window frame's size and be slightly larger.
14192
- * Default is `false`.
14412
+ * A `boolean`. When this attribute is present the guest page will be allowed to
14413
+ * open new windows. Popups are disabled by default.
14193
14414
  */
14194
- useContentSize?: boolean;
14415
+ allowpopups: boolean;
14195
14416
  /**
14196
- * Show window in the center of the screen. Default is `false`.
14417
+ * A `string` which is a list of strings which specifies the blink features to be
14418
+ * disabled separated by `,`. The full list of supported feature strings can be
14419
+ * found in the RuntimeEnabledFeatures.json5 file.
14197
14420
  */
14198
- center?: boolean;
14421
+ disableblinkfeatures: string;
14199
14422
  /**
14200
- * Window's minimum width. Default is `0`.
14423
+ * A `boolean`. When this attribute is present the guest page will have web
14424
+ * security disabled. Web security is enabled by default.
14425
+ *
14426
+ * This value can only be modified before the first navigation.
14201
14427
  */
14202
- minWidth?: number;
14428
+ disablewebsecurity: boolean;
14203
14429
  /**
14204
- * Window's minimum height. Default is `0`.
14430
+ * A `string` which is a list of strings which specifies the blink features to be
14431
+ * enabled separated by `,`. The full list of supported feature strings can be
14432
+ * found in the RuntimeEnabledFeatures.json5 file.
14205
14433
  */
14206
- minHeight?: number;
14434
+ enableblinkfeatures: string;
14207
14435
  /**
14208
- * Window's maximum width. Default is no limit.
14436
+ * A `string` that sets the referrer URL for the guest page.
14209
14437
  */
14210
- maxWidth?: number;
14438
+ httpreferrer: string;
14211
14439
  /**
14212
- * Window's maximum height. Default is no limit.
14440
+ * A `boolean`. When this attribute is present the guest page in `webview` will
14441
+ * have node integration and can use node APIs like `require` and `process` to
14442
+ * access low level system resources. Node integration is disabled by default in
14443
+ * the guest page.
14213
14444
  */
14214
- maxHeight?: number;
14445
+ nodeintegration: boolean;
14215
14446
  /**
14216
- * Whether window is resizable. Default is `true`.
14447
+ * A `boolean` for the experimental option for enabling NodeJS support in
14448
+ * sub-frames such as iframes inside the `webview`. All your preloads will load for
14449
+ * every iframe, you can use `process.isMainFrame` to determine if you are in the
14450
+ * main frame or not. This option is disabled by default in the guest page.
14217
14451
  */
14218
- resizable?: boolean;
14452
+ nodeintegrationinsubframes: boolean;
14219
14453
  /**
14220
- * Whether window is movable. This is not implemented on Linux. Default is `true`.
14454
+ * A `string` that sets the session used by the page. If `partition` starts with
14455
+ * `persist:`, the page will use a persistent session available to all pages in the
14456
+ * app with the same `partition`. if there is no `persist:` prefix, the page will
14457
+ * use an in-memory session. By assigning the same `partition`, multiple pages can
14458
+ * share the same session. If the `partition` is unset then default session of the
14459
+ * app will be used.
14221
14460
  *
14222
- * @platform darwin,win32
14461
+ * This value can only be modified before the first navigation, since the session
14462
+ * of an active renderer process cannot change. Subsequent attempts to modify the
14463
+ * value will fail with a DOM exception.
14223
14464
  */
14224
- movable?: boolean;
14465
+ partition: string;
14225
14466
  /**
14226
- * Whether window is minimizable. This is not implemented on Linux. Default is
14227
- * `true`.
14228
- *
14229
- * @platform darwin,win32
14467
+ * A `boolean`. When this attribute is present the guest page in `webview` will be
14468
+ * able to use browser plugins. Plugins are disabled by default.
14230
14469
  */
14231
- minimizable?: boolean;
14470
+ plugins: boolean;
14232
14471
  /**
14233
- * Whether window is maximizable. This is not implemented on Linux. Default is
14234
- * `true`.
14472
+ * A `string` that specifies a script that will be loaded before other scripts run
14473
+ * in the guest page. The protocol of script's URL must be `file:` (even when using
14474
+ * `asar:` archives) because it will be loaded by Node's `require` under the hood,
14475
+ * which treats `asar:` archives as virtual directories.
14235
14476
  *
14236
- * @platform darwin,win32
14477
+ * When the guest page doesn't have node integration this script will still have
14478
+ * access to all Node APIs, but global objects injected by Node will be deleted
14479
+ * after this script has finished executing.
14237
14480
  */
14238
- maximizable?: boolean;
14481
+ preload: string;
14239
14482
  /**
14240
- * Whether window is closable. This is not implemented on Linux. Default is `true`.
14483
+ * A `string` representing the visible URL. Writing to this attribute initiates
14484
+ * top-level navigation.
14241
14485
  *
14242
- * @platform darwin,win32
14486
+ * Assigning `src` its own value will reload the current page.
14487
+ *
14488
+ * The `src` attribute can also accept data URLs, such as `data:text/plain,Hello,
14489
+ * world!`.
14243
14490
  */
14244
- closable?: boolean;
14491
+ src: string;
14245
14492
  /**
14246
- * Whether the window can be focused. Default is `true`. On Windows setting
14247
- * `focusable: false` also implies setting `skipTaskbar: true`. On Linux setting
14248
- * `focusable: false` makes the window stop interacting with wm, so the window will
14249
- * always stay on top in all workspaces.
14493
+ * A `string` that sets the user agent for the guest page before the page is
14494
+ * navigated to. Once the page is loaded, use the `setUserAgent` method to change
14495
+ * the user agent.
14250
14496
  */
14251
- focusable?: boolean;
14497
+ useragent: string;
14252
14498
  /**
14253
- * Whether the window should always stay on top of other windows. Default is
14499
+ * A `string` which is a comma separated list of strings which specifies the web
14500
+ * preferences to be set on the webview. The full list of supported preference
14501
+ * strings can be found in BrowserWindow.
14502
+ *
14503
+ * The string follows the same format as the features string in `window.open`. A
14504
+ * name by itself is given a `true` boolean value. A preference can be set to
14505
+ * another value by including an `=`, followed by the value. Special values `yes`
14506
+ * and `1` are interpreted as `true`, while `no` and `0` are interpreted as
14254
14507
  * `false`.
14255
14508
  */
14256
- alwaysOnTop?: boolean;
14509
+ webpreferences: string;
14510
+ }
14511
+
14512
+ interface AboutPanelOptionsOptions {
14257
14513
  /**
14258
- * Whether the window should show in fullscreen. When explicitly set to `false` the
14259
- * fullscreen button will be hidden or disabled on macOS. Default is `false`.
14514
+ * The app's name.
14260
14515
  */
14261
- fullscreen?: boolean;
14516
+ applicationName?: string;
14262
14517
  /**
14263
- * Whether the window can be put into fullscreen mode. On macOS, also whether the
14264
- * maximize/zoom button should toggle full screen mode or maximize window. Default
14265
- * is `true`.
14518
+ * The app's version.
14266
14519
  */
14267
- fullscreenable?: boolean;
14520
+ applicationVersion?: string;
14268
14521
  /**
14269
- * Use pre-Lion fullscreen on macOS. Default is `false`.
14522
+ * Copyright information.
14523
+ */
14524
+ copyright?: string;
14525
+ /**
14526
+ * The app's build version number.
14270
14527
  *
14271
14528
  * @platform darwin
14272
14529
  */
14273
- simpleFullscreen?: boolean;
14530
+ version?: string;
14274
14531
  /**
14275
- * Whether to show the window in taskbar. Default is `false`.
14532
+ * Credit information.
14276
14533
  *
14277
14534
  * @platform darwin,win32
14278
14535
  */
14279
- skipTaskbar?: boolean;
14536
+ credits?: string;
14280
14537
  /**
14281
- * Whether window should be hidden when the user toggles into mission control.
14538
+ * List of app authors.
14282
14539
  *
14283
- * @platform darwin
14540
+ * @platform linux
14284
14541
  */
14285
- hiddenInMissionControl?: boolean;
14542
+ authors?: string[];
14286
14543
  /**
14287
- * Whether the window is in kiosk mode. Default is `false`.
14544
+ * The app's website.
14545
+ *
14546
+ * @platform linux
14288
14547
  */
14289
- kiosk?: boolean;
14548
+ website?: string;
14290
14549
  /**
14291
- * Default window title. Default is `"Electron"`. If the HTML tag `<title>` is
14292
- * defined in the HTML file loaded by `loadURL()`, this property will be ignored.
14550
+ * Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as
14551
+ * 64x64 pixels while retaining aspect ratio.
14552
+ *
14553
+ * @platform linux,win32
14293
14554
  */
14294
- title?: string;
14555
+ iconPath?: string;
14556
+ }
14557
+
14558
+ interface AddRepresentationOptions {
14295
14559
  /**
14296
- * The window icon. On Windows it is recommended to use `ICO` icons to get best
14297
- * visual effects, you can also leave it undefined so the executable's icon will be
14298
- * used.
14560
+ * The scale factor to add the image representation for.
14299
14561
  */
14300
- icon?: (NativeImage) | (string);
14562
+ scaleFactor?: number;
14563
+ /**
14564
+ * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
14565
+ */
14566
+ width?: number;
14567
+ /**
14568
+ * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
14569
+ */
14570
+ height?: number;
14301
14571
  /**
14302
- * Whether window should be shown when created. Default is `true`.
14572
+ * The buffer containing the raw image data.
14303
14573
  */
14304
- show?: boolean;
14574
+ buffer?: Buffer;
14305
14575
  /**
14306
- * Whether the renderer should be active when `show` is `false` and it has just
14307
- * been created. In order for `document.visibilityState` to work correctly on
14308
- * first load with `show: false` you should set this to `false`. Setting this to
14309
- * `false` will cause the `ready-to-show` event to not fire. Default is `true`.
14576
+ * The data URL containing either a base 64 encoded PNG or JPEG image.
14310
14577
  */
14311
- paintWhenInitiallyHidden?: boolean;
14578
+ dataURL?: string;
14579
+ }
14580
+
14581
+ interface AdjustSelectionOptions {
14312
14582
  /**
14313
- * Specify `false` to create a frameless window. Default is `true`.
14583
+ * Amount to shift the start index of the current selection.
14314
14584
  */
14315
- frame?: boolean;
14585
+ start?: number;
14316
14586
  /**
14317
- * Specify parent window. Default is `null`.
14587
+ * Amount to shift the end index of the current selection.
14318
14588
  */
14319
- parent?: BrowserWindow;
14589
+ end?: number;
14590
+ }
14591
+
14592
+ interface AnimationSettings {
14320
14593
  /**
14321
- * Whether this is a modal window. This only works when the window is a child
14322
- * window. Default is `false`.
14594
+ * Returns true if rich animations should be rendered. Looks at session type (e.g.
14595
+ * remote desktop) and accessibility settings to give guidance for heavy
14596
+ * animations.
14323
14597
  */
14324
- modal?: boolean;
14598
+ shouldRenderRichAnimation: boolean;
14325
14599
  /**
14326
- * Whether clicking an inactive window will also click through to the web contents.
14327
- * Default is `false` on macOS. This option is not configurable on other platforms.
14328
- *
14329
- * @platform darwin
14600
+ * Determines on a per-platform basis whether scroll animations (e.g. produced by
14601
+ * home/end key) should be enabled.
14330
14602
  */
14331
- acceptFirstMouse?: boolean;
14603
+ scrollAnimationsEnabledBySystem: boolean;
14332
14604
  /**
14333
- * Whether to hide cursor when typing. Default is `false`.
14605
+ * Determines whether the user desires reduced motion based on platform APIs.
14334
14606
  */
14335
- disableAutoHideCursor?: boolean;
14607
+ prefersReducedMotion: boolean;
14608
+ }
14609
+
14610
+ interface AppDetailsOptions {
14336
14611
  /**
14337
- * Auto hide the menu bar unless the `Alt` key is pressed. Default is `false`.
14612
+ * Window's App User Model ID. It has to be set, otherwise the other options will
14613
+ * have no effect.
14338
14614
  */
14339
- autoHideMenuBar?: boolean;
14615
+ appId?: string;
14340
14616
  /**
14341
- * Enable the window to be resized larger than screen. Only relevant for macOS, as
14342
- * other OSes allow larger-than-screen windows by default. Default is `false`.
14343
- *
14344
- * @platform darwin
14617
+ * Window's Relaunch Icon.
14345
14618
  */
14346
- enableLargerThanScreen?: boolean;
14619
+ appIconPath?: string;
14347
14620
  /**
14348
- * The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color
14349
- * format. Alpha in #AARRGGBB format is supported if `transparent` is set to
14350
- * `true`. Default is `#FFF` (white). See win.setBackgroundColor for more
14351
- * information.
14621
+ * Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set.
14622
+ * Default is `0`.
14352
14623
  */
14353
- backgroundColor?: string;
14624
+ appIconIndex?: number;
14354
14625
  /**
14355
- * Whether window should have a shadow. Default is `true`.
14626
+ * Window's Relaunch Command.
14356
14627
  */
14357
- hasShadow?: boolean;
14628
+ relaunchCommand?: string;
14358
14629
  /**
14359
- * Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0
14360
- * (fully opaque). This is only implemented on Windows and macOS.
14361
- *
14362
- * @platform darwin,win32
14630
+ * Window's Relaunch Display Name.
14363
14631
  */
14364
- opacity?: number;
14632
+ relaunchDisplayName?: string;
14633
+ }
14634
+
14635
+ interface ApplicationInfoForProtocolReturnValue {
14365
14636
  /**
14366
- * Forces using dark theme for the window, only works on some GTK+3 desktop
14367
- * environments. Default is `false`.
14637
+ * the display icon of the app handling the protocol.
14368
14638
  */
14369
- darkTheme?: boolean;
14639
+ icon: NativeImage;
14370
14640
  /**
14371
- * Makes the window transparent. Default is `false`. On Windows, does not work
14372
- * unless the window is frameless.
14641
+ * installation path of the app handling the protocol.
14373
14642
  */
14374
- transparent?: boolean;
14643
+ path: string;
14375
14644
  /**
14376
- * The type of window, default is normal window. See more about this below.
14645
+ * display name of the app handling the protocol.
14377
14646
  */
14378
- type?: string;
14647
+ name: string;
14648
+ }
14649
+
14650
+ interface AuthenticationResponseDetails {
14651
+ url: string;
14652
+ }
14653
+
14654
+ interface AuthInfo {
14655
+ isProxy: boolean;
14656
+ scheme: string;
14657
+ host: string;
14658
+ port: number;
14659
+ realm: string;
14660
+ }
14661
+
14662
+ interface AutoResizeOptions {
14379
14663
  /**
14380
- * Specify how the material appearance should reflect window activity state on
14381
- * macOS. Must be used with the `vibrancy` property. Possible values are:
14382
- *
14383
- * @platform darwin
14664
+ * If `true`, the view's width will grow and shrink together with the window.
14665
+ * `false` by default.
14384
14666
  */
14385
- visualEffectState?: ('followWindow' | 'active' | 'inactive');
14667
+ width?: boolean;
14386
14668
  /**
14387
- * The style of window title bar. Default is `default`. Possible values are:
14388
- *
14389
- * @platform darwin,win32
14669
+ * If `true`, the view's height will grow and shrink together with the window.
14670
+ * `false` by default.
14390
14671
  */
14391
- titleBarStyle?: ('default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover');
14672
+ height?: boolean;
14392
14673
  /**
14393
- * Set a custom position for the traffic light buttons in frameless windows.
14394
- *
14395
- * @platform darwin
14674
+ * If `true`, the view's x position and width will grow and shrink proportionally
14675
+ * with the window. `false` by default.
14396
14676
  */
14397
- trafficLightPosition?: Point;
14677
+ horizontal?: boolean;
14398
14678
  /**
14399
- * Whether frameless window should have rounded corners on macOS. Default is
14400
- * `true`. Setting this property to `false` will prevent the window from being
14401
- * fullscreenable.
14402
- *
14403
- * @platform darwin
14679
+ * If `true`, the view's y position and height will grow and shrink proportionally
14680
+ * with the window. `false` by default.
14404
14681
  */
14405
- roundedCorners?: boolean;
14682
+ vertical?: boolean;
14683
+ }
14684
+
14685
+ interface BeforeSendResponse {
14686
+ cancel?: boolean;
14406
14687
  /**
14407
- * Shows the title in the title bar in full screen mode on macOS for `hiddenInset`
14408
- * titleBarStyle. Default is `false`.
14409
- *
14410
- * @deprecated
14411
- * @platform darwin
14688
+ * When provided, request will be made with these headers.
14412
14689
  */
14413
- fullscreenWindowTitle?: boolean;
14690
+ requestHeaders?: Record<string, (string) | (string[])>;
14691
+ }
14692
+
14693
+ interface BitmapOptions {
14414
14694
  /**
14415
- * Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard
14416
- * window frame. Setting it to `false` will remove window shadow and window
14417
- * animations. Default is `true`.
14695
+ * Defaults to 1.0.
14418
14696
  */
14419
- thickFrame?: boolean;
14697
+ scaleFactor?: number;
14698
+ }
14699
+
14700
+ interface BlinkMemoryInfo {
14420
14701
  /**
14421
- * Add a type of vibrancy effect to the window, only on macOS. Can be
14422
- * `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`,
14423
- * `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`,
14424
- * `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. Please
14425
- * note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark`
14426
- * are deprecated and have been removed in macOS Catalina (10.15).
14427
- *
14428
- * @platform darwin
14702
+ * Size of all allocated objects in Kilobytes.
14429
14703
  */
14430
- vibrancy?: ('appearance-based' | 'light' | 'dark' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'medium-light' | 'ultra-dark' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page');
14704
+ allocated: number;
14431
14705
  /**
14432
- * Set the window's system-drawn background material, including behind the
14433
- * non-client area. Can be `auto`, `none`, `mica`, `acrylic` or `tabbed`. See
14434
- * win.setBackgroundMaterial for more information.
14435
- *
14436
- * @platform win32
14706
+ * Total allocated space in Kilobytes.
14437
14707
  */
14438
- backgroundMaterial?: ('auto' | 'none' | 'mica' | 'acrylic' | 'tabbed');
14708
+ total: number;
14709
+ }
14710
+
14711
+ interface BluetoothPairingHandlerHandlerDetails {
14712
+ deviceId: string;
14439
14713
  /**
14440
- * Controls the behavior on macOS when option-clicking the green stoplight button
14441
- * on the toolbar or by clicking the Window > Zoom menu item. If `true`, the window
14442
- * will grow to the preferred width of the web page when zoomed, `false` will cause
14443
- * it to zoom to the width of the screen. This will also affect the behavior when
14444
- * calling `maximize()` directly. Default is `false`.
14445
- *
14446
- * @platform darwin
14714
+ * The type of pairing prompt being requested. One of the following values:
14447
14715
  */
14448
- zoomToPageWidth?: boolean;
14716
+ pairingKind: ('confirm' | 'confirmPin' | 'providePin');
14717
+ frame: WebFrameMain;
14449
14718
  /**
14450
- * Tab group name, allows opening the window as a native tab. Windows with the same
14451
- * tabbing identifier will be grouped together. This also adds a native new tab
14452
- * button to your window's tab bar and allows your `app` and window to receive the
14453
- * `new-window-for-tab` event.
14454
- *
14455
- * @platform darwin
14719
+ * The pin value to verify if `pairingKind` is `confirmPin`.
14456
14720
  */
14457
- tabbingIdentifier?: string;
14721
+ pin?: string;
14722
+ }
14723
+
14724
+ interface BrowserViewConstructorOptions {
14458
14725
  /**
14459
14726
  * Settings of web page's features.
14460
14727
  */
14461
14728
  webPreferences?: WebPreferences;
14462
- /**
14463
- * When using a frameless window in conjunction with
14464
- * `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so
14465
- * that the standard window controls ("traffic lights" on macOS) are visible, this
14466
- * property enables the Window Controls Overlay JavaScript APIs and CSS Environment
14467
- * Variables. Specifying `true` will result in an overlay with default system
14468
- * colors. Default is `false`.
14469
- */
14470
- titleBarOverlay?: (TitleBarOverlay) | (boolean);
14471
14729
  }
14472
14730
 
14473
14731
  interface CallbackResponse {
@@ -15009,6 +15267,33 @@ declare namespace Electron {
15009
15267
  bookmark?: string;
15010
15268
  }
15011
15269
 
15270
+ interface DefaultFontFamily {
15271
+ /**
15272
+ * Defaults to `Times New Roman`.
15273
+ */
15274
+ standard?: string;
15275
+ /**
15276
+ * Defaults to `Times New Roman`.
15277
+ */
15278
+ serif?: string;
15279
+ /**
15280
+ * Defaults to `Arial`.
15281
+ */
15282
+ sansSerif?: string;
15283
+ /**
15284
+ * Defaults to `Courier New`.
15285
+ */
15286
+ monospace?: string;
15287
+ /**
15288
+ * Defaults to `Script`.
15289
+ */
15290
+ cursive?: string;
15291
+ /**
15292
+ * Defaults to `Impact`.
15293
+ */
15294
+ fantasy?: string;
15295
+ }
15296
+
15012
15297
  interface Details {
15013
15298
  /**
15014
15299
  * Process type. One of the following values:
@@ -16970,6 +17255,9 @@ declare namespace Electron {
16970
17255
  swapFree: number;
16971
17256
  }
16972
17257
 
17258
+ interface TitleBarOverlay {
17259
+ }
17260
+
16973
17261
  interface TitleBarOverlayOptions {
16974
17262
  /**
16975
17263
  * The CSS color of the Window Controls Overlay when enabled.
@@ -17239,9 +17527,16 @@ declare namespace Electron {
17239
17527
  interface UsbDeviceRevokedDetails {
17240
17528
  device: USBDevice;
17241
17529
  /**
17242
- * The origin that the device has been revoked from.
17530
+ * The origin that the device has been revoked from.
17531
+ */
17532
+ origin?: string;
17533
+ }
17534
+
17535
+ interface USBProtectedClassesHandlerHandlerDetails {
17536
+ /**
17537
+ * The current list of protected USB classes. Possible class values are:
17243
17538
  */
17244
- origin?: string;
17539
+ protectedClasses: Array<'audio' | 'audio-video' | 'hid' | 'mass-storage' | 'smart-card' | 'video' | 'wireless'>;
17245
17540
  }
17246
17541
 
17247
17542
  interface VisibleOnAllWorkspacesOptions {
@@ -17678,468 +17973,185 @@ declare namespace Electron {
17678
17973
  */
17679
17974
  isPaused: boolean;
17680
17975
  /**
17681
- * Whether the media element is muted.
17682
- */
17683
- isMuted: boolean;
17684
- /**
17685
- * Whether the media element has audio.
17686
- */
17687
- hasAudio: boolean;
17688
- /**
17689
- * Whether the media element is looping.
17690
- */
17691
- isLooping: boolean;
17692
- /**
17693
- * Whether the media element's controls are visible.
17694
- */
17695
- isControlsVisible: boolean;
17696
- /**
17697
- * Whether the media element's controls are toggleable.
17698
- */
17699
- canToggleControls: boolean;
17700
- /**
17701
- * Whether the media element can be printed.
17702
- */
17703
- canPrint: boolean;
17704
- /**
17705
- * Whether or not the media element can be downloaded.
17706
- */
17707
- canSave: boolean;
17708
- /**
17709
- * Whether the media element can show picture-in-picture.
17710
- */
17711
- canShowPictureInPicture: boolean;
17712
- /**
17713
- * Whether the media element is currently showing picture-in-picture.
17714
- */
17715
- isShowingPictureInPicture: boolean;
17716
- /**
17717
- * Whether the media element can be rotated.
17718
- */
17719
- canRotate: boolean;
17720
- /**
17721
- * Whether the media element can be looped.
17722
- */
17723
- canLoop: boolean;
17724
- }
17725
-
17726
- interface PageRanges {
17727
- /**
17728
- * Index of the first page to print (0-based).
17729
- */
17730
- from: number;
17731
- /**
17732
- * Index of the last page to print (inclusive) (0-based).
17733
- */
17734
- to: number;
17735
- }
17736
-
17737
- interface Params {
17738
- /**
17739
- * x coordinate.
17740
- */
17741
- x: number;
17742
- /**
17743
- * y coordinate.
17744
- */
17745
- y: number;
17746
- /**
17747
- * URL of the link that encloses the node the context menu was invoked on.
17748
- */
17749
- linkURL: string;
17750
- /**
17751
- * Text associated with the link. May be an empty string if the contents of the
17752
- * link are an image.
17753
- */
17754
- linkText: string;
17755
- /**
17756
- * URL of the top level page that the context menu was invoked on.
17757
- */
17758
- pageURL: string;
17759
- /**
17760
- * URL of the subframe that the context menu was invoked on.
17761
- */
17762
- frameURL: string;
17763
- /**
17764
- * Source URL for the element that the context menu was invoked on. Elements with
17765
- * source URLs are images, audio and video.
17766
- */
17767
- srcURL: string;
17768
- /**
17769
- * Type of the node the context menu was invoked on. Can be `none`, `image`,
17770
- * `audio`, `video`, `canvas`, `file` or `plugin`.
17771
- */
17772
- mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
17773
- /**
17774
- * Whether the context menu was invoked on an image which has non-empty contents.
17775
- */
17776
- hasImageContents: boolean;
17777
- /**
17778
- * Whether the context is editable.
17779
- */
17780
- isEditable: boolean;
17781
- /**
17782
- * Text of the selection that the context menu was invoked on.
17783
- */
17784
- selectionText: string;
17785
- /**
17786
- * Title text of the selection that the context menu was invoked on.
17787
- */
17788
- titleText: string;
17789
- /**
17790
- * Alt text of the selection that the context menu was invoked on.
17791
- */
17792
- altText: string;
17793
- /**
17794
- * Suggested filename to be used when saving file through 'Save Link As' option of
17795
- * context menu.
17796
- */
17797
- suggestedFilename: string;
17798
- /**
17799
- * Rect representing the coordinates in the document space of the selection.
17800
- */
17801
- selectionRect: Rectangle;
17802
- /**
17803
- * Start position of the selection text.
17804
- */
17805
- selectionStartOffset: number;
17806
- /**
17807
- * The referrer policy of the frame on which the menu is invoked.
17808
- */
17809
- referrerPolicy: Referrer;
17810
- /**
17811
- * The misspelled word under the cursor, if any.
17812
- */
17813
- misspelledWord: string;
17814
- /**
17815
- * An array of suggested words to show the user to replace the `misspelledWord`.
17816
- * Only available if there is a misspelled word and spellchecker is enabled.
17817
- */
17818
- dictionarySuggestions: string[];
17819
- /**
17820
- * The character encoding of the frame on which the menu was invoked.
17821
- */
17822
- frameCharset: string;
17823
- /**
17824
- * If the context menu was invoked on an input field, the type of that field.
17825
- * Possible values are `none`, `plainText`, `password`, `other`.
17826
- */
17827
- inputFieldType: string;
17828
- /**
17829
- * If the context is editable, whether or not spellchecking is enabled.
17830
- */
17831
- spellcheckEnabled: boolean;
17832
- /**
17833
- * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
17834
- * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
17835
- * `adjustSelection`, or `adjustSelectionReset`.
17836
- */
17837
- menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
17838
- /**
17839
- * The flags for the media element the context menu was invoked on.
17840
- */
17841
- mediaFlags: MediaFlags;
17842
- /**
17843
- * These flags indicate whether the renderer believes it is able to perform the
17844
- * corresponding action.
17845
- */
17846
- editFlags: EditFlags;
17847
- }
17848
-
17849
- interface TitleBarOverlay {
17850
- /**
17851
- * The CSS color of the Window Controls Overlay when enabled. Default is the system
17852
- * color.
17853
- *
17854
- * @platform win32
17855
- */
17856
- color?: string;
17857
- /**
17858
- * The CSS color of the symbols on the Window Controls Overlay when enabled.
17859
- * Default is the system color.
17860
- *
17861
- * @platform win32
17862
- */
17863
- symbolColor?: string;
17864
- /**
17865
- * The height of the title bar and Window Controls Overlay in pixels. Default is
17866
- * system height.
17867
- *
17868
- * @platform darwin,win32
17869
- */
17870
- height?: number;
17871
- }
17872
-
17873
- interface Video {
17874
- /**
17875
- * The id of the stream being granted. This will usually come from a
17876
- * DesktopCapturerSource object.
17877
- */
17878
- id: string;
17879
- /**
17880
- * The name of the stream being granted. This will usually come from a
17881
- * DesktopCapturerSource object.
17882
- */
17883
- name: string;
17884
- }
17885
-
17886
- interface WebPreferences {
17887
- /**
17888
- * Whether to enable DevTools. If it is set to `false`, can not use
17889
- * `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.
17890
- */
17891
- devTools?: boolean;
17892
- /**
17893
- * Whether node integration is enabled. Default is `false`.
17894
- */
17895
- nodeIntegration?: boolean;
17896
- /**
17897
- * Whether node integration is enabled in web workers. Default is `false`. More
17898
- * about this can be found in Multithreading.
17899
- */
17900
- nodeIntegrationInWorker?: boolean;
17901
- /**
17902
- * Experimental option for enabling Node.js support in sub-frames such as iframes
17903
- * and child windows. All your preloads will load for every iframe, you can use
17904
- * `process.isMainFrame` to determine if you are in the main frame or not.
17905
- */
17906
- nodeIntegrationInSubFrames?: boolean;
17907
- /**
17908
- * Specifies a script that will be loaded before other scripts run in the page.
17909
- * This script will always have access to node APIs no matter whether node
17910
- * integration is turned on or off. The value should be the absolute file path to
17911
- * the script. When node integration is turned off, the preload script can
17912
- * reintroduce Node global symbols back to the global scope. See example here.
17913
- */
17914
- preload?: string;
17915
- /**
17916
- * If set, this will sandbox the renderer associated with the window, making it
17917
- * compatible with the Chromium OS-level sandbox and disabling the Node.js engine.
17918
- * This is not the same as the `nodeIntegration` option and the APIs available to
17919
- * the preload script are more limited. Read more about the option here.
17920
- */
17921
- sandbox?: boolean;
17922
- /**
17923
- * Sets the session used by the page. Instead of passing the Session object
17924
- * directly, you can also choose to use the `partition` option instead, which
17925
- * accepts a partition string. When both `session` and `partition` are provided,
17926
- * `session` will be preferred. Default is the default session.
17927
- */
17928
- session?: Session;
17929
- /**
17930
- * Sets the session used by the page according to the session's partition string.
17931
- * If `partition` starts with `persist:`, the page will use a persistent session
17932
- * available to all pages in the app with the same `partition`. If there is no
17933
- * `persist:` prefix, the page will use an in-memory session. By assigning the same
17934
- * `partition`, multiple pages can share the same session. Default is the default
17935
- * session.
17936
- */
17937
- partition?: string;
17938
- /**
17939
- * The default zoom factor of the page, `3.0` represents `300%`. Default is `1.0`.
17976
+ * Whether the media element is muted.
17940
17977
  */
17941
- zoomFactor?: number;
17978
+ isMuted: boolean;
17942
17979
  /**
17943
- * Enables JavaScript support. Default is `true`.
17980
+ * Whether the media element has audio.
17944
17981
  */
17945
- javascript?: boolean;
17982
+ hasAudio: boolean;
17946
17983
  /**
17947
- * When `false`, it will disable the same-origin policy (usually using testing
17948
- * websites by people), and set `allowRunningInsecureContent` to `true` if this
17949
- * options has not been set by user. Default is `true`.
17984
+ * Whether the media element is looping.
17950
17985
  */
17951
- webSecurity?: boolean;
17986
+ isLooping: boolean;
17952
17987
  /**
17953
- * Allow an https page to run JavaScript, CSS or plugins from http URLs. Default is
17954
- * `false`.
17988
+ * Whether the media element's controls are visible.
17955
17989
  */
17956
- allowRunningInsecureContent?: boolean;
17990
+ isControlsVisible: boolean;
17957
17991
  /**
17958
- * Enables image support. Default is `true`.
17992
+ * Whether the media element's controls are toggleable.
17959
17993
  */
17960
- images?: boolean;
17994
+ canToggleControls: boolean;
17961
17995
  /**
17962
- * Specifies how to run image animations (E.g. GIFs). Can be `animate`,
17963
- * `animateOnce` or `noAnimation`. Default is `animate`.
17996
+ * Whether the media element can be printed.
17964
17997
  */
17965
- imageAnimationPolicy?: ('animate' | 'animateOnce' | 'noAnimation');
17998
+ canPrint: boolean;
17966
17999
  /**
17967
- * Make TextArea elements resizable. Default is `true`.
18000
+ * Whether or not the media element can be downloaded.
17968
18001
  */
17969
- textAreasAreResizable?: boolean;
18002
+ canSave: boolean;
17970
18003
  /**
17971
- * Enables WebGL support. Default is `true`.
18004
+ * Whether the media element can show picture-in-picture.
17972
18005
  */
17973
- webgl?: boolean;
18006
+ canShowPictureInPicture: boolean;
17974
18007
  /**
17975
- * Whether plugins should be enabled. Default is `false`.
18008
+ * Whether the media element is currently showing picture-in-picture.
17976
18009
  */
17977
- plugins?: boolean;
18010
+ isShowingPictureInPicture: boolean;
17978
18011
  /**
17979
- * Enables Chromium's experimental features. Default is `false`.
18012
+ * Whether the media element can be rotated.
17980
18013
  */
17981
- experimentalFeatures?: boolean;
18014
+ canRotate: boolean;
17982
18015
  /**
17983
- * Enables scroll bounce (rubber banding) effect on macOS. Default is `false`.
17984
- *
17985
- * @platform darwin
18016
+ * Whether the media element can be looped.
17986
18017
  */
17987
- scrollBounce?: boolean;
18018
+ canLoop: boolean;
18019
+ }
18020
+
18021
+ interface PageRanges {
17988
18022
  /**
17989
- * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
17990
- * to enable. The full list of supported feature strings can be found in the
17991
- * RuntimeEnabledFeatures.json5 file.
18023
+ * Index of the first page to print (0-based).
17992
18024
  */
17993
- enableBlinkFeatures?: string;
18025
+ from: number;
17994
18026
  /**
17995
- * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
17996
- * to disable. The full list of supported feature strings can be found in the
17997
- * RuntimeEnabledFeatures.json5 file.
18027
+ * Index of the last page to print (inclusive) (0-based).
17998
18028
  */
17999
- disableBlinkFeatures?: string;
18029
+ to: number;
18030
+ }
18031
+
18032
+ interface Params {
18000
18033
  /**
18001
- * Sets the default font for the font-family.
18034
+ * x coordinate.
18002
18035
  */
18003
- defaultFontFamily?: DefaultFontFamily;
18036
+ x: number;
18004
18037
  /**
18005
- * Defaults to `16`.
18038
+ * y coordinate.
18006
18039
  */
18007
- defaultFontSize?: number;
18040
+ y: number;
18008
18041
  /**
18009
- * Defaults to `13`.
18042
+ * URL of the link that encloses the node the context menu was invoked on.
18010
18043
  */
18011
- defaultMonospaceFontSize?: number;
18044
+ linkURL: string;
18012
18045
  /**
18013
- * Defaults to `0`.
18046
+ * Text associated with the link. May be an empty string if the contents of the
18047
+ * link are an image.
18014
18048
  */
18015
- minimumFontSize?: number;
18049
+ linkText: string;
18016
18050
  /**
18017
- * Defaults to `ISO-8859-1`.
18051
+ * URL of the top level page that the context menu was invoked on.
18018
18052
  */
18019
- defaultEncoding?: string;
18053
+ pageURL: string;
18020
18054
  /**
18021
- * Whether to throttle animations and timers when the page becomes background. This
18022
- * also affects the Page Visibility API. Defaults to `true`.
18055
+ * URL of the subframe that the context menu was invoked on.
18023
18056
  */
18024
- backgroundThrottling?: boolean;
18057
+ frameURL: string;
18025
18058
  /**
18026
- * Whether to enable offscreen rendering for the browser window. Defaults to
18027
- * `false`. See the offscreen rendering tutorial for more details.
18059
+ * Source URL for the element that the context menu was invoked on. Elements with
18060
+ * source URLs are images, audio and video.
18028
18061
  */
18029
- offscreen?: boolean;
18062
+ srcURL: string;
18030
18063
  /**
18031
- * Whether to run Electron APIs and the specified `preload` script in a separate
18032
- * JavaScript context. Defaults to `true`. The context that the `preload` script
18033
- * runs in will only have access to its own dedicated `document` and `window`
18034
- * globals, as well as its own set of JavaScript builtins (`Array`, `Object`,
18035
- * `JSON`, etc.), which are all invisible to the loaded content. The Electron API
18036
- * will only be available in the `preload` script and not the loaded page. This
18037
- * option should be used when loading potentially untrusted remote content to
18038
- * ensure the loaded content cannot tamper with the `preload` script and any
18039
- * Electron APIs being used. This option uses the same technique used by Chrome
18040
- * Content Scripts. You can access this context in the dev tools by selecting the
18041
- * 'Electron Isolated Context' entry in the combo box at the top of the Console
18042
- * tab.
18064
+ * Type of the node the context menu was invoked on. Can be `none`, `image`,
18065
+ * `audio`, `video`, `canvas`, `file` or `plugin`.
18043
18066
  */
18044
- contextIsolation?: boolean;
18067
+ mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
18045
18068
  /**
18046
- * Whether to enable the `<webview>` tag. Defaults to `false`. **Note:** The
18047
- * `preload` script configured for the `<webview>` will have node integration
18048
- * enabled when it is executed so you should ensure remote/untrusted content is not
18049
- * able to create a `<webview>` tag with a possibly malicious `preload` script. You
18050
- * can use the `will-attach-webview` event on webContents to strip away the
18051
- * `preload` script and to validate or alter the `<webview>`'s initial settings.
18069
+ * Whether the context menu was invoked on an image which has non-empty contents.
18052
18070
  */
18053
- webviewTag?: boolean;
18071
+ hasImageContents: boolean;
18054
18072
  /**
18055
- * A list of strings that will be appended to `process.argv` in the renderer
18056
- * process of this app. Useful for passing small bits of data down to renderer
18057
- * process preload scripts.
18073
+ * Whether the context is editable.
18058
18074
  */
18059
- additionalArguments?: string[];
18075
+ isEditable: boolean;
18060
18076
  /**
18061
- * Whether to enable browser style consecutive dialog protection. Default is
18062
- * `false`.
18077
+ * Text of the selection that the context menu was invoked on.
18063
18078
  */
18064
- safeDialogs?: boolean;
18079
+ selectionText: string;
18065
18080
  /**
18066
- * The message to display when consecutive dialog protection is triggered. If not
18067
- * defined the default message would be used, note that currently the default
18068
- * message is in English and not localized.
18081
+ * Title text of the selection that the context menu was invoked on.
18069
18082
  */
18070
- safeDialogsMessage?: string;
18083
+ titleText: string;
18071
18084
  /**
18072
- * Whether to disable dialogs completely. Overrides `safeDialogs`. Default is
18073
- * `false`.
18085
+ * Alt text of the selection that the context menu was invoked on.
18074
18086
  */
18075
- disableDialogs?: boolean;
18087
+ altText: string;
18076
18088
  /**
18077
- * Whether dragging and dropping a file or link onto the page causes a navigation.
18078
- * Default is `false`.
18089
+ * Suggested filename to be used when saving file through 'Save Link As' option of
18090
+ * context menu.
18079
18091
  */
18080
- navigateOnDragDrop?: boolean;
18092
+ suggestedFilename: string;
18081
18093
  /**
18082
- * Autoplay policy to apply to content in the window, can be
18083
- * `no-user-gesture-required`, `user-gesture-required`,
18084
- * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
18094
+ * Rect representing the coordinates in the document space of the selection.
18085
18095
  */
18086
- autoplayPolicy?: ('no-user-gesture-required' | 'user-gesture-required' | 'document-user-activation-required');
18096
+ selectionRect: Rectangle;
18087
18097
  /**
18088
- * Whether to prevent the window from resizing when entering HTML Fullscreen.
18089
- * Default is `false`.
18098
+ * Start position of the selection text.
18090
18099
  */
18091
- disableHtmlFullscreenWindowResize?: boolean;
18100
+ selectionStartOffset: number;
18092
18101
  /**
18093
- * An alternative title string provided only to accessibility tools such as screen
18094
- * readers. This string is not directly visible to users.
18102
+ * The referrer policy of the frame on which the menu is invoked.
18095
18103
  */
18096
- accessibleTitle?: string;
18104
+ referrerPolicy: Referrer;
18097
18105
  /**
18098
- * Whether to enable the builtin spellchecker. Default is `true`.
18106
+ * The misspelled word under the cursor, if any.
18099
18107
  */
18100
- spellcheck?: boolean;
18108
+ misspelledWord: string;
18101
18109
  /**
18102
- * Whether to enable the WebSQL api. Default is `true`.
18110
+ * An array of suggested words to show the user to replace the `misspelledWord`.
18111
+ * Only available if there is a misspelled word and spellchecker is enabled.
18103
18112
  */
18104
- enableWebSQL?: boolean;
18113
+ dictionarySuggestions: string[];
18105
18114
  /**
18106
- * Enforces the v8 code caching policy used by blink. Accepted values are
18115
+ * The character encoding of the frame on which the menu was invoked.
18107
18116
  */
18108
- v8CacheOptions?: ('none' | 'code' | 'bypassHeatCheck' | 'bypassHeatCheckAndEagerCompile');
18117
+ frameCharset: string;
18109
18118
  /**
18110
- * Whether to enable preferred size mode. The preferred size is the minimum size
18111
- * needed to contain the layout of the document—without requiring scrolling.
18112
- * Enabling this will cause the `preferred-size-changed` event to be emitted on the
18113
- * `WebContents` when the preferred size changes. Default is `false`.
18119
+ * If the context menu was invoked on an input field, the type of that field.
18120
+ * Possible values are `none`, `plainText`, `password`, `other`.
18114
18121
  */
18115
- enablePreferredSizeMode?: boolean;
18116
- }
18117
-
18118
- interface DefaultFontFamily {
18122
+ inputFieldType: string;
18119
18123
  /**
18120
- * Defaults to `Times New Roman`.
18124
+ * If the context is editable, whether or not spellchecking is enabled.
18121
18125
  */
18122
- standard?: string;
18126
+ spellcheckEnabled: boolean;
18123
18127
  /**
18124
- * Defaults to `Times New Roman`.
18128
+ * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
18129
+ * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
18130
+ * `adjustSelection`, or `adjustSelectionReset`.
18125
18131
  */
18126
- serif?: string;
18132
+ menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
18127
18133
  /**
18128
- * Defaults to `Arial`.
18134
+ * The flags for the media element the context menu was invoked on.
18129
18135
  */
18130
- sansSerif?: string;
18136
+ mediaFlags: MediaFlags;
18131
18137
  /**
18132
- * Defaults to `Courier New`.
18138
+ * These flags indicate whether the renderer believes it is able to perform the
18139
+ * corresponding action.
18133
18140
  */
18134
- monospace?: string;
18141
+ editFlags: EditFlags;
18142
+ }
18143
+
18144
+ interface Video {
18135
18145
  /**
18136
- * Defaults to `Script`.
18146
+ * The id of the stream being granted. This will usually come from a
18147
+ * DesktopCapturerSource object.
18137
18148
  */
18138
- cursive?: string;
18149
+ id: string;
18139
18150
  /**
18140
- * Defaults to `Impact`.
18151
+ * The name of the stream being granted. This will usually come from a
18152
+ * DesktopCapturerSource object.
18141
18153
  */
18142
- fantasy?: string;
18154
+ name: string;
18143
18155
  }
18144
18156
 
18145
18157
  interface RemoteMainInterface {
@@ -18206,7 +18218,6 @@ declare namespace Electron {
18206
18218
  type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
18207
18219
  type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
18208
18220
  type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
18209
- type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
18210
18221
  type CallbackResponse = Electron.CallbackResponse;
18211
18222
  type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
18212
18223
  type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
@@ -18226,6 +18237,7 @@ declare namespace Electron {
18226
18237
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
18227
18238
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
18228
18239
  type Data = Electron.Data;
18240
+ type DefaultFontFamily = Electron.DefaultFontFamily;
18229
18241
  type Details = Electron.Details;
18230
18242
  type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
18231
18243
  type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
@@ -18329,6 +18341,7 @@ declare namespace Electron {
18329
18341
  type StartLoggingOptions = Electron.StartLoggingOptions;
18330
18342
  type Streams = Electron.Streams;
18331
18343
  type SystemMemoryInfo = Electron.SystemMemoryInfo;
18344
+ type TitleBarOverlay = Electron.TitleBarOverlay;
18332
18345
  type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
18333
18346
  type TitleOptions = Electron.TitleOptions;
18334
18347
  type ToBitmapOptions = Electron.ToBitmapOptions;
@@ -18348,6 +18361,7 @@ declare namespace Electron {
18348
18361
  type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
18349
18362
  type UploadProgress = Electron.UploadProgress;
18350
18363
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
18364
+ type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
18351
18365
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
18352
18366
  type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
18353
18367
  type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
@@ -18368,11 +18382,9 @@ declare namespace Electron {
18368
18382
  type MediaFlags = Electron.MediaFlags;
18369
18383
  type PageRanges = Electron.PageRanges;
18370
18384
  type Params = Electron.Params;
18371
- type TitleBarOverlay = Electron.TitleBarOverlay;
18372
18385
  type Video = Electron.Video;
18373
- type WebPreferences = Electron.WebPreferences;
18374
- type DefaultFontFamily = Electron.DefaultFontFamily;
18375
18386
  type BluetoothDevice = Electron.BluetoothDevice;
18387
+ type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
18376
18388
  type Certificate = Electron.Certificate;
18377
18389
  type CertificatePrincipal = Electron.CertificatePrincipal;
18378
18390
  type Cookie = Electron.Cookie;
@@ -18437,6 +18449,7 @@ declare namespace Electron {
18437
18449
  type UploadRawData = Electron.UploadRawData;
18438
18450
  type USBDevice = Electron.USBDevice;
18439
18451
  type UserDefaultTypes = Electron.UserDefaultTypes;
18452
+ type WebPreferences = Electron.WebPreferences;
18440
18453
  type WebRequestFilter = Electron.WebRequestFilter;
18441
18454
  type WebSource = Electron.WebSource;
18442
18455
  }
@@ -18530,7 +18543,6 @@ declare namespace Electron {
18530
18543
  type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
18531
18544
  type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
18532
18545
  type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
18533
- type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
18534
18546
  type CallbackResponse = Electron.CallbackResponse;
18535
18547
  type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
18536
18548
  type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
@@ -18550,6 +18562,7 @@ declare namespace Electron {
18550
18562
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
18551
18563
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
18552
18564
  type Data = Electron.Data;
18565
+ type DefaultFontFamily = Electron.DefaultFontFamily;
18553
18566
  type Details = Electron.Details;
18554
18567
  type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
18555
18568
  type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
@@ -18653,6 +18666,7 @@ declare namespace Electron {
18653
18666
  type StartLoggingOptions = Electron.StartLoggingOptions;
18654
18667
  type Streams = Electron.Streams;
18655
18668
  type SystemMemoryInfo = Electron.SystemMemoryInfo;
18669
+ type TitleBarOverlay = Electron.TitleBarOverlay;
18656
18670
  type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
18657
18671
  type TitleOptions = Electron.TitleOptions;
18658
18672
  type ToBitmapOptions = Electron.ToBitmapOptions;
@@ -18672,6 +18686,7 @@ declare namespace Electron {
18672
18686
  type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
18673
18687
  type UploadProgress = Electron.UploadProgress;
18674
18688
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
18689
+ type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
18675
18690
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
18676
18691
  type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
18677
18692
  type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
@@ -18692,11 +18707,9 @@ declare namespace Electron {
18692
18707
  type MediaFlags = Electron.MediaFlags;
18693
18708
  type PageRanges = Electron.PageRanges;
18694
18709
  type Params = Electron.Params;
18695
- type TitleBarOverlay = Electron.TitleBarOverlay;
18696
18710
  type Video = Electron.Video;
18697
- type WebPreferences = Electron.WebPreferences;
18698
- type DefaultFontFamily = Electron.DefaultFontFamily;
18699
18711
  type BluetoothDevice = Electron.BluetoothDevice;
18712
+ type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
18700
18713
  type Certificate = Electron.Certificate;
18701
18714
  type CertificatePrincipal = Electron.CertificatePrincipal;
18702
18715
  type Cookie = Electron.Cookie;
@@ -18761,6 +18774,7 @@ declare namespace Electron {
18761
18774
  type UploadRawData = Electron.UploadRawData;
18762
18775
  type USBDevice = Electron.USBDevice;
18763
18776
  type UserDefaultTypes = Electron.UserDefaultTypes;
18777
+ type WebPreferences = Electron.WebPreferences;
18764
18778
  type WebRequestFilter = Electron.WebRequestFilter;
18765
18779
  type WebSource = Electron.WebSource;
18766
18780
  }
@@ -18788,7 +18802,6 @@ declare namespace Electron {
18788
18802
  type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
18789
18803
  type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
18790
18804
  type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
18791
- type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
18792
18805
  type CallbackResponse = Electron.CallbackResponse;
18793
18806
  type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
18794
18807
  type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
@@ -18808,6 +18821,7 @@ declare namespace Electron {
18808
18821
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
18809
18822
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
18810
18823
  type Data = Electron.Data;
18824
+ type DefaultFontFamily = Electron.DefaultFontFamily;
18811
18825
  type Details = Electron.Details;
18812
18826
  type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
18813
18827
  type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
@@ -18911,6 +18925,7 @@ declare namespace Electron {
18911
18925
  type StartLoggingOptions = Electron.StartLoggingOptions;
18912
18926
  type Streams = Electron.Streams;
18913
18927
  type SystemMemoryInfo = Electron.SystemMemoryInfo;
18928
+ type TitleBarOverlay = Electron.TitleBarOverlay;
18914
18929
  type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
18915
18930
  type TitleOptions = Electron.TitleOptions;
18916
18931
  type ToBitmapOptions = Electron.ToBitmapOptions;
@@ -18930,6 +18945,7 @@ declare namespace Electron {
18930
18945
  type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
18931
18946
  type UploadProgress = Electron.UploadProgress;
18932
18947
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
18948
+ type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
18933
18949
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
18934
18950
  type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
18935
18951
  type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
@@ -18950,11 +18966,9 @@ declare namespace Electron {
18950
18966
  type MediaFlags = Electron.MediaFlags;
18951
18967
  type PageRanges = Electron.PageRanges;
18952
18968
  type Params = Electron.Params;
18953
- type TitleBarOverlay = Electron.TitleBarOverlay;
18954
18969
  type Video = Electron.Video;
18955
- type WebPreferences = Electron.WebPreferences;
18956
- type DefaultFontFamily = Electron.DefaultFontFamily;
18957
18970
  type BluetoothDevice = Electron.BluetoothDevice;
18971
+ type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
18958
18972
  type Certificate = Electron.Certificate;
18959
18973
  type CertificatePrincipal = Electron.CertificatePrincipal;
18960
18974
  type Cookie = Electron.Cookie;
@@ -19019,6 +19033,7 @@ declare namespace Electron {
19019
19033
  type UploadRawData = Electron.UploadRawData;
19020
19034
  type USBDevice = Electron.USBDevice;
19021
19035
  type UserDefaultTypes = Electron.UserDefaultTypes;
19036
+ type WebPreferences = Electron.WebPreferences;
19022
19037
  type WebRequestFilter = Electron.WebRequestFilter;
19023
19038
  type WebSource = Electron.WebSource;
19024
19039
  }
@@ -19127,7 +19142,6 @@ declare namespace Electron {
19127
19142
  type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
19128
19143
  type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
19129
19144
  type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
19130
- type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
19131
19145
  type CallbackResponse = Electron.CallbackResponse;
19132
19146
  type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
19133
19147
  type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
@@ -19147,6 +19161,7 @@ declare namespace Electron {
19147
19161
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
19148
19162
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
19149
19163
  type Data = Electron.Data;
19164
+ type DefaultFontFamily = Electron.DefaultFontFamily;
19150
19165
  type Details = Electron.Details;
19151
19166
  type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
19152
19167
  type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
@@ -19250,6 +19265,7 @@ declare namespace Electron {
19250
19265
  type StartLoggingOptions = Electron.StartLoggingOptions;
19251
19266
  type Streams = Electron.Streams;
19252
19267
  type SystemMemoryInfo = Electron.SystemMemoryInfo;
19268
+ type TitleBarOverlay = Electron.TitleBarOverlay;
19253
19269
  type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
19254
19270
  type TitleOptions = Electron.TitleOptions;
19255
19271
  type ToBitmapOptions = Electron.ToBitmapOptions;
@@ -19269,6 +19285,7 @@ declare namespace Electron {
19269
19285
  type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
19270
19286
  type UploadProgress = Electron.UploadProgress;
19271
19287
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
19288
+ type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
19272
19289
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
19273
19290
  type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
19274
19291
  type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
@@ -19289,11 +19306,9 @@ declare namespace Electron {
19289
19306
  type MediaFlags = Electron.MediaFlags;
19290
19307
  type PageRanges = Electron.PageRanges;
19291
19308
  type Params = Electron.Params;
19292
- type TitleBarOverlay = Electron.TitleBarOverlay;
19293
19309
  type Video = Electron.Video;
19294
- type WebPreferences = Electron.WebPreferences;
19295
- type DefaultFontFamily = Electron.DefaultFontFamily;
19296
19310
  type BluetoothDevice = Electron.BluetoothDevice;
19311
+ type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
19297
19312
  type Certificate = Electron.Certificate;
19298
19313
  type CertificatePrincipal = Electron.CertificatePrincipal;
19299
19314
  type Cookie = Electron.Cookie;
@@ -19358,6 +19373,7 @@ declare namespace Electron {
19358
19373
  type UploadRawData = Electron.UploadRawData;
19359
19374
  type USBDevice = Electron.USBDevice;
19360
19375
  type UserDefaultTypes = Electron.UserDefaultTypes;
19376
+ type WebPreferences = Electron.WebPreferences;
19361
19377
  type WebRequestFilter = Electron.WebRequestFilter;
19362
19378
  type WebSource = Electron.WebSource;
19363
19379
  }