feat(docs): fix 'optional' wording

This commit is contained in:
Toinane 2017-11-28 18:15:15 +01:00
parent 124667c29b
commit 59607c9a17
No known key found for this signature in database
GPG key ID: 1A3729C1B6D59115
14 changed files with 92 additions and 92 deletions

View file

@ -385,7 +385,7 @@ and `will-quit` events will not be emitted.
### `app.relaunch([options])` ### `app.relaunch([options])`
* `options` Object (optional) * `options` Object (optional)
* `args` String[] - (optional) * `args` String[] (optional)
* `execPath` String (optional) * `execPath` String (optional)
Relaunches the app when current instance exits. Relaunches the app when current instance exits.

View file

@ -1124,7 +1124,7 @@ Same as `webContents.capturePage([rect, ]callback)`.
* `httpReferrer` String (optional) - A HTTP Referrer url. * `httpReferrer` String (optional) - A HTTP Referrer url.
* `userAgent` String (optional) - A user agent originating the request. * `userAgent` String (optional) - A user agent originating the request.
* `extraHeaders` String (optional) - Extra headers separated by "\n" * `extraHeaders` String (optional) - Extra headers separated by "\n"
* `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md) | [UploadFileSystem[]](structures/upload-file-system.md) | [UploadBlob[]](structures/upload-blob.md)) - (optional) * `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md) | [UploadFileSystem[]](structures/upload-file-system.md) | [UploadBlob[]](structures/upload-blob.md)) (optional)
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files. * `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
Same as `webContents.loadURL(url[, options])`. Same as `webContents.loadURL(url[, options])`.

View file

@ -18,8 +18,8 @@ See [`Menu`](menu.md) for examples.
`click` property will be ignored. See [roles](#roles). `click` property will be ignored. See [roles](#roles).
* `type` String (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or * `type` String (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
`radio`. `radio`.
* `label` String - (optional) * `label` String (optional)
* `sublabel` String - (optional) * `sublabel` String (optional)
* `accelerator` [Accelerator](accelerator.md) (optional) * `accelerator` [Accelerator](accelerator.md) (optional)
* `icon` ([NativeImage](native-image.md) | String) (optional) * `icon` ([NativeImage](native-image.md) | String) (optional)
* `enabled` Boolean (optional) - If false, the menu item will be greyed out and * `enabled` Boolean (optional) - If false, the menu item will be greyed out and

View file

@ -31,14 +31,14 @@ Returns `Boolean` - Whether or not desktop notifications are supported on the cu
* `options` Object * `options` Object
* `title` String - A title for the notification, which will be shown at the top of the notification window when it is shown * `title` String - A title for the notification, which will be shown at the top of the notification window when it is shown
* `subtitle` String - (optional) A subtitle for the notification, which will be displayed below the title. _macOS_ * `subtitle` String (optional) - A subtitle for the notification, which will be displayed below the title. _macOS_
* `body` String - The body text of the notification, which will be displayed below the title or subtitle * `body` String - The body text of the notification, which will be displayed below the title or subtitle
* `silent` Boolean - (optional) Whether or not to emit an OS notification noise when showing the notification * `silent` Boolean (optional) - Whether or not to emit an OS notification noise when showing the notification
* `icon` (String | [NativeImage](native-image.md)) - (optional) An icon to use in the notification * `icon` (String | [NativeImage](native-image.md)) (optional) - An icon to use in the notification
* `hasReply` Boolean - (optional) Whether or not to add an inline reply option to the notification. _macOS_ * `hasReply` Boolean (optional) - Whether or not to add an inline reply option to the notification. _macOS_
* `replyPlaceholder` String - (optional) The placeholder to write in the inline reply input field. _macOS_ * `replyPlaceholder` String (optional) - The placeholder to write in the inline reply input field. _macOS_
* `sound` String - (optional) The name of the sound file to play when the notification is shown. _macOS_ * `sound` String (optional) - The name of the sound file to play when the notification is shown. _macOS_
* `actions` [NotificationAction[]](structures/notification-action.md) - (optional) Actions to add to the notification. Please read the available actions and limitations in the `NotificationAction` documentation _macOS_ * `actions` [NotificationAction[]](structures/notification-action.md) (optional) - Actions to add to the notification. Please read the available actions and limitations in the `NotificationAction` documentation _macOS_
### Instance Events ### Instance Events

View file

@ -109,12 +109,12 @@ Clears the sessions HTTP cache.
#### `ses.clearStorageData([options, callback])` #### `ses.clearStorageData([options, callback])`
* `options` Object (optional) * `options` Object (optional)
* `origin` String - (optional) Should follow `window.location.origin`s representation * `origin` String (optional) - Should follow `window.location.origin`s representation
`scheme://host:port`. `scheme://host:port`.
* `storages` String[] - (optional) The types of storages to clear, can contain: * `storages` String[] (optional) - The types of storages to clear, can contain:
`appcache`, `cookies`, `filesystem`, `indexdb`, `localstorage`, `appcache`, `cookies`, `filesystem`, `indexdb`, `localstorage`,
`shadercache`, `websql`, `serviceworkers` `shadercache`, `websql`, `serviceworkers`
* `quotas` String[] - (optional) The types of quotas to clear, can contain: * `quotas` String[] (optional) - The types of quotas to clear, can contain:
`temporary`, `persistent`, `syncable`. `temporary`, `persistent`, `syncable`.
* `callback` Function (optional) - Called when operation is done. * `callback` Function (optional) - Called when operation is done.

View file

@ -1,7 +1,7 @@
# NotificationAction Object # NotificationAction Object
* `type` String - The type of action, can be `button`. * `type` String - The type of action, can be `button`.
* `text` String - (optional) The label for the given action. * `text` String (optional) - The label for the given action.
## Platform / Action Support ## Platform / Action Support

View file

@ -1,4 +1,4 @@
# ScrubberItem Object # ScrubberItem Object
* `label` String - (optional) The text to appear in this item * `label` String (optional) - The text to appear in this item
* `icon` NativeImage - (optional) The image to appear in this item * `icon` NativeImage (optional) - The image to appear in this item

View file

@ -1,5 +1,5 @@
# SegmentedControlSegment Object # SegmentedControlSegment Object
* `label` String - (optional) The text to appear in this segment * `label` String (optional) - The text to appear in this segment
* `icon` NativeImage - (optional) The image to appear in this segment * `icon` NativeImage (optional) - The image to appear in this segment
* `enabled` Boolean - (optional) Whether this segment is selectable. Default: true * `enabled` Boolean (optional) - Whether this segment is selectable. Default: true

View file

@ -7,7 +7,7 @@ Process: [Main](../tutorial/quick-start.md#main-process)
### `new TouchBarSegmentedControl(options)` _Experimental_ ### `new TouchBarSegmentedControl(options)` _Experimental_
* `options` Object * `options` Object
* `segmentStyle` String - (optional) Style of the segments: * `segmentStyle` String (optional) - Style of the segments:
* `automatic` - Default. The appearance of the segmented control is * `automatic` - Default. The appearance of the segmented control is
automatically determined based on the type of window in which the control automatically determined based on the type of window in which the control
is displayed and the position within the window. is displayed and the position within the window.
@ -21,7 +21,7 @@ Process: [Main](../tutorial/quick-start.md#main-process)
* `small-square` - The control is displayed using the small square style. * `small-square` - The control is displayed using the small square style.
* `separated` - The segments in the control are displayed very close to each * `separated` - The segments in the control are displayed very close to each
other but not touching. other but not touching.
* `mode` String - (optional) The selection mode of the control: * `mode` String (optional) - The selection mode of the control:
* `single` - Default. One item selected at a time, selecting one deselects the previously selected item. * `single` - Default. One item selected at a time, selecting one deselects the previously selected item.
* `multiple` - Multiple items can be selected at a time. * `multiple` - Multiple items can be selected at a time.
* `buttons` - Make the segments act as buttons, each segment can be pressed and released but never marked as active. * `buttons` - Make the segments act as buttons, each segment can be pressed and released but never marked as active.

View file

@ -244,7 +244,7 @@ win.on('hide', () => {
#### `tray.displayBalloon(options)` _Windows_ #### `tray.displayBalloon(options)` _Windows_
* `options` Object * `options` Object
* `icon` ([NativeImage](native-image.md) | String) - (optional) * `icon` ([NativeImage](native-image.md) | String) (optional) -
* `title` String * `title` String
* `content` String * `content` String

View file

@ -134,7 +134,7 @@ Emitted when the document in the given frame is loaded.
Returns: Returns:
* `event` Event * `event` Event
* `favicons` String[] - Array of URLs * `favicons` String[] - Array of URLs.
Emitted when page receives favicon urls. Emitted when page receives favicon urls.
@ -148,7 +148,7 @@ Returns:
* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`, * `disposition` String - Can be `default`, `foreground-tab`, `background-tab`,
`new-window`, `save-to-disk` and `other`. `new-window`, `save-to-disk` and `other`.
* `options` Object - The options which will be used for creating the new * `options` Object - The options which will be used for creating the new
`BrowserWindow`. [`BrowserWindow`](browser-window.md).
* `additionalFeatures` String[] - The non-standard features (features not handled * `additionalFeatures` String[] - The non-standard features (features not handled
by Chromium or Electron) given to `window.open()`. by Chromium or Electron) given to `window.open()`.
@ -158,8 +158,8 @@ requested by `window.open` or an external link like `<a target='_blank'>`.
By default a new `BrowserWindow` will be created for the `url`. By default a new `BrowserWindow` will be created for the `url`.
Calling `event.preventDefault()` will prevent Electron from automatically creating a Calling `event.preventDefault()` will prevent Electron from automatically creating a
new `BrowserWindow`. If you call `event.preventDefault()` and manually create a new new [`BrowserWindow`](browser-window.md). If you call `event.preventDefault()` and manually create a new
`BrowserWindow` then you must set `event.newGuest` to reference the new `BrowserWindow` [`BrowserWindow`](browser-window.md) then you must set `event.newGuest` to reference the new [`BrowserWindow`](browser-window.md)
instance, failing to do so may result in unexpected behavior. For example: instance, failing to do so may result in unexpected behavior. For example:
```javascript ```javascript
@ -276,15 +276,15 @@ Emitted when `webContents` is destroyed.
Returns: Returns:
* `event` Event * `event` Event
* `input` Object - Input properties * `input` Object - Input properties.
* `type` String - Either `keyUp` or `keyDown` * `type` String - Either `keyUp` or `keyDown`.
* `key` String - Equivalent to [KeyboardEvent.key][keyboardevent] * `key` String - Equivalent to [KeyboardEvent.key][keyboardevent].
* `code` String - Equivalent to [KeyboardEvent.code][keyboardevent] * `code` String - Equivalent to [KeyboardEvent.code][keyboardevent].
* `isAutoRepeat` Boolean - Equivalent to [KeyboardEvent.repeat][keyboardevent] * `isAutoRepeat` Boolean - Equivalent to [KeyboardEvent.repeat][keyboardevent].
* `shift` Boolean - Equivalent to [KeyboardEvent.shiftKey][keyboardevent] * `shift` Boolean - Equivalent to [KeyboardEvent.shiftKey][keyboardevent].
* `control` Boolean - Equivalent to [KeyboardEvent.controlKey][keyboardevent] * `control` Boolean - Equivalent to [KeyboardEvent.controlKey][keyboardevent].
* `alt` Boolean - Equivalent to [KeyboardEvent.altKey][keyboardevent] * `alt` Boolean - Equivalent to [KeyboardEvent.altKey][keyboardevent].
* `meta` Boolean - Equivalent to [KeyboardEvent.metaKey][keyboardevent] * `meta` Boolean - Equivalent to [KeyboardEvent.metaKey][keyboardevent].
Emitted before dispatching the `keydown` and `keyup` events in the page. Emitted before dispatching the `keydown` and `keyup` events in the page.
Calling `event.preventDefault` will prevent the page `keydown`/`keyup` events Calling `event.preventDefault` will prevent the page `keydown`/`keyup` events
@ -323,10 +323,10 @@ Returns:
* `event` Event * `event` Event
* `url` String * `url` String
* `error` String - The error code * `error` String - The error code.
* `certificate` [Certificate](structures/certificate.md) * `certificate` [Certificate](structures/certificate.md)
* `callback` Function * `callback` Function
* `isTrusted` Boolean - Indicates whether the certificate can be considered trusted * `isTrusted` Boolean - Indicates whether the certificate can be considered trusted.
Emitted when failed to verify the `certificate` for `url`. Emitted when failed to verify the `certificate` for `url`.
@ -341,7 +341,7 @@ Returns:
* `url` URL * `url` URL
* `certificateList` [Certificate[]](structures/certificate.md) * `certificateList` [Certificate[]](structures/certificate.md)
* `callback` Function * `callback` Function
* `certificate` [Certificate](structures/certificate.md) - Must be a certificate from the given list * `certificate` [Certificate](structures/certificate.md) - Must be a certificate from the given list.
Emitted when a client certificate is requested. Emitted when a client certificate is requested.
@ -423,10 +423,10 @@ Returns:
* `event` Event * `event` Event
* `type` String * `type` String
* `image` NativeImage (optional) * `image` [NativeImage](native-image.md) (optional)
* `scale` Float (optional) - scaling factor for the custom cursor * `scale` Float (optional) - scaling factor for the custom cursor.
* `size` [Size](structures/size.md) (optional) - the size of the `image` * `size` [Size](structures/size.md) (optional) - the size of the `image`.
* `hotspot` [Point](structures/point.md) (optional) - coordinates of the custom cursor's hotspot * `hotspot` [Point](structures/point.md) (optional) - coordinates of the custom cursor's hotspot.
Emitted when the cursor's type changes. The `type` parameter can be `default`, Emitted when the cursor's type changes. The `type` parameter can be `default`,
`crosshair`, `pointer`, `text`, `wait`, `help`, `e-resize`, `n-resize`, `crosshair`, `pointer`, `text`, `wait`, `help`, `e-resize`, `n-resize`,
@ -435,10 +435,10 @@ Emitted when the cursor's type changes. The `type` parameter can be `default`,
`row-resize`, `m-panning`, `e-panning`, `n-panning`, `ne-panning`, `nw-panning`, `row-resize`, `m-panning`, `e-panning`, `n-panning`, `ne-panning`, `nw-panning`,
`s-panning`, `se-panning`, `sw-panning`, `w-panning`, `move`, `vertical-text`, `s-panning`, `se-panning`, `sw-panning`, `w-panning`, `move`, `vertical-text`,
`cell`, `context-menu`, `alias`, `progress`, `nodrop`, `copy`, `none`, `cell`, `context-menu`, `alias`, `progress`, `nodrop`, `copy`, `none`,
`not-allowed`, `zoom-in`, `zoom-out`, `grab`, `grabbing`, `custom`. `not-allowed`, `zoom-in`, `zoom-out`, `grab`, `grabbing` or `custom`.
If the `type` parameter is `custom`, the `image` parameter will hold the custom If the `type` parameter is `custom`, the `image` parameter will hold the custom
cursor image in a `NativeImage`, and `scale`, `size` and `hotspot` will hold cursor image in a [`NativeImage`](native-image.md), and `scale`, `size` and `hotspot` will hold
additional information about the custom cursor. additional information about the custom cursor.
#### Event: 'context-menu' #### Event: 'context-menu'
@ -447,8 +447,8 @@ Returns:
* `event` Event * `event` Event
* `params` Object * `params` Object
* `x` Integer - x coordinate * `x` Integer - x coordinate.
* `y` Integer - y coordinate * `y` Integer - y coordinate.
* `linkURL` String - URL of the link that encloses the node the context menu * `linkURL` String - URL of the link that encloses the node the context menu
was invoked on. was invoked on.
* `linkText` String - Text associated with the link. May be an empty * `linkText` String - Text associated with the link. May be an empty
@ -475,7 +475,7 @@ Returns:
field, the type of that field. Possible values are `none`, `plainText`, field, the type of that field. Possible values are `none`, `plainText`,
`password`, `other`. `password`, `other`.
* `menuSourceType` String - Input source that invoked the context menu. * `menuSourceType` String - Input source that invoked the context menu.
Can be `none`, `mouse`, `keyboard`, `touch`, `touchMenu`. Can be `none`, `mouse`, `keyboard`, `touch` or `touchMenu`.
* `mediaFlags` Object - The flags for the media element the context menu was * `mediaFlags` Object - The flags for the media element the context menu was
invoked on. invoked on.
* `inError` Boolean - Whether the media element has crashed. * `inError` Boolean - Whether the media element has crashed.
@ -611,8 +611,8 @@ for windows with *offscreen rendering* enabled.
* `options` Object (optional) * `options` Object (optional)
* `httpReferrer` String (optional) - A HTTP Referrer url. * `httpReferrer` String (optional) - A HTTP Referrer url.
* `userAgent` String (optional) - A user agent originating the request. * `userAgent` String (optional) - A user agent originating the request.
* `extraHeaders` String (optional) - Extra headers separated by "\n" * `extraHeaders` String (optional) - Extra headers separated by "\n".
* `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md) | [UploadFileSystem[]](structures/upload-file-system.md) | [UploadBlob[]](structures/upload-blob.md)) - (optional) * `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md) | [UploadFileSystem[]](structures/upload-file-system.md) | [UploadBlob[]](structures/upload-blob.md)) (optional)
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files. * `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
Loads the `url` in the window. The `url` must contain the protocol prefix, Loads the `url` in the window. The `url` must contain the protocol prefix,
@ -906,14 +906,14 @@ Inserts `text` to the focused element.
* `text` String - Content to be searched, must not be empty. * `text` String - Content to be searched, must not be empty.
* `options` Object (optional) * `options` Object (optional)
* `forward` Boolean - (optional) Whether to search forward or backward, defaults to `true`. * `forward` Boolean (optional) - Whether to search forward or backward, defaults to `true`.
* `findNext` Boolean - (optional) Whether the operation is first request or a follow up, * `findNext` Boolean (optional) - Whether the operation is first request or a follow up,
defaults to `false`. defaults to `false`.
* `matchCase` Boolean - (optional) Whether search should be case-sensitive, * `matchCase` Boolean (optional) - Whether search should be case-sensitive,
defaults to `false`. defaults to `false`.
* `wordStart` Boolean - (optional) Whether to look only at the start of words. * `wordStart` Boolean (optional) - Whether to look only at the start of words.
defaults to `false`. defaults to `false`.
* `medialCapitalAsWordStart` Boolean - (optional) When combined with `wordStart`, * `medialCapitalAsWordStart` Boolean (optional) - When combined with `wordStart`,
accepts a match in the middle of a word if the match begins with an accepts a match in the middle of a word if the match begins with an
uppercase letter followed by a lowercase or non-letter. uppercase letter followed by a lowercase or non-letter.
Accepts several other intra-word matches, defaults to `false`. Accepts several other intra-word matches, defaults to `false`.
@ -999,14 +999,14 @@ Use `page-break-before: always; ` CSS style to force to print to a new page.
#### `contents.printToPDF(options, callback)` #### `contents.printToPDF(options, callback)`
* `options` Object * `options` Object
* `marginsType` Integer - (optional) Specifies the type of margins to use. Uses 0 for * `marginsType` Integer (optional) - Specifies the type of margins to use. Uses 0 for
default margin, 1 for no margin, and 2 for minimum margin. default margin, 1 for no margin, and 2 for minimum margin.
* `pageSize` String - (optional) Specify page size of the generated PDF. Can be `A3`, * `pageSize` String (optional) - Specify page size of the generated PDF. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` `A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
and `width` in microns. and `width` in microns.
* `printBackground` Boolean - (optional) Whether to print CSS backgrounds. * `printBackground` Boolean (optional) - Whether to print CSS backgrounds.
* `printSelectionOnly` Boolean - (optional) Whether to print selection only. * `printSelectionOnly` Boolean (optional) - Whether to print selection only.
* `landscape` Boolean - (optional) `true` for landscape, `false` for portrait. * `landscape` Boolean (optional) - `true` for landscape, `false` for portrait.
* `callback` Function * `callback` Function
* `error` Error * `error` Error
* `data` Buffer * `data` Buffer

View file

@ -106,11 +106,11 @@ Content Security Policy.
* `scheme` String * `scheme` String
* `options` Object (optional) * `options` Object (optional)
* `secure` Boolean - (optional) Default true. * `secure` Boolean (optional) - Default true.
* `bypassCSP` Boolean - (optional) Default true. * `bypassCSP` Boolean (optional) - Default true.
* `allowServiceWorkers` Boolean - (optional) Default true. * `allowServiceWorkers` Boolean (optional) - Default true.
* `supportFetchAPI` Boolean - (optional) Default true. * `supportFetchAPI` Boolean (optional) - Default true.
* `corsEnabled` Boolean - (optional) Default true. * `corsEnabled` Boolean (optional) - Default true.
Registers the `scheme` as secure, bypasses content security policy for resources, Registers the `scheme` as secure, bypasses content security policy for resources,
allows registering ServiceWorker and supports fetch API. allows registering ServiceWorker and supports fetch API.

View file

@ -41,7 +41,7 @@ The following methods are available on instances of `WebRequest`:
#### `webRequest.onBeforeRequest([filter, ]listener)` #### `webRequest.onBeforeRequest([filter, ]listener)`
* `filter` Object - (optional) * `filter` Object (optional)
* `urls` String[] - Array of URL patterns that will be used to filter out the * `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns. requests that do not match the URL patterns.
* `listener` Function * `listener` Function
@ -68,7 +68,7 @@ The `callback` has to be called with an `response` object.
#### `webRequest.onBeforeSendHeaders([filter, ]listener)` #### `webRequest.onBeforeSendHeaders([filter, ]listener)`
* `filter` Object - (optional) * `filter` Object (optional)
* `urls` String[] - Array of URL patterns that will be used to filter out the * `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns. requests that do not match the URL patterns.
* `listener` Function * `listener` Function
@ -95,7 +95,7 @@ The `callback` has to be called with an `response` object.
#### `webRequest.onSendHeaders([filter, ]listener)` #### `webRequest.onSendHeaders([filter, ]listener)`
* `filter` Object - (optional) * `filter` Object (optional)
* `urls` String[] - Array of URL patterns that will be used to filter out the * `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns. requests that do not match the URL patterns.
* `listener` Function * `listener` Function
@ -114,7 +114,7 @@ response are visible by the time this listener is fired.
#### `webRequest.onHeadersReceived([filter, ]listener)` #### `webRequest.onHeadersReceived([filter, ]listener)`
* `filter` Object - (optional) * `filter` Object (optional)
* `urls` String[] - Array of URL patterns that will be used to filter out the * `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns. requests that do not match the URL patterns.
* `listener` Function * `listener` Function
@ -145,7 +145,7 @@ The `callback` has to be called with an `response` object.
#### `webRequest.onResponseStarted([filter, ]listener)` #### `webRequest.onResponseStarted([filter, ]listener)`
* `filter` Object - (optional) * `filter` Object (optional)
* `urls` String[] - Array of URL patterns that will be used to filter out the * `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns. requests that do not match the URL patterns.
* `listener` Function * `listener` Function
@ -168,7 +168,7 @@ and response headers are available.
#### `webRequest.onBeforeRedirect([filter, ]listener)` #### `webRequest.onBeforeRedirect([filter, ]listener)`
* `filter` Object - (optional) * `filter` Object (optional)
* `urls` String[] - Array of URL patterns that will be used to filter out the * `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns. requests that do not match the URL patterns.
* `listener` Function * `listener` Function
@ -191,7 +191,7 @@ redirect is about to occur.
#### `webRequest.onCompleted([filter, ]listener)` #### `webRequest.onCompleted([filter, ]listener)`
* `filter` Object - (optional) * `filter` Object (optional)
* `urls` String[] - Array of URL patterns that will be used to filter out the * `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns. requests that do not match the URL patterns.
* `listener` Function * `listener` Function
@ -212,7 +212,7 @@ completed.
#### `webRequest.onErrorOccurred([filter, ]listener)` #### `webRequest.onErrorOccurred([filter, ]listener)`
* `filter` Object - (optional) * `filter` Object (optional)
* `urls` String[] - Array of URL patterns that will be used to filter out the * `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns. requests that do not match the URL patterns.
* `listener` Function * `listener` Function

View file

@ -309,7 +309,7 @@ webview.addEventListener('dom-ready', () => {
* `httpReferrer` String (optional) - A HTTP Referrer url. * `httpReferrer` String (optional) - A HTTP Referrer url.
* `userAgent` String (optional) - A user agent originating the request. * `userAgent` String (optional) - A user agent originating the request.
* `extraHeaders` String (optional) - Extra headers separated by "\n" * `extraHeaders` String (optional) - Extra headers separated by "\n"
* `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md) | [UploadFileSystem[]](structures/upload-file-system.md) | [UploadBlob[]](structures/upload-blob.md)) - (optional) * `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md) | [UploadFileSystem[]](structures/upload-file-system.md) | [UploadBlob[]](structures/upload-blob.md)) (optional) -
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files. * `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
Loads the `url` in the webview, the `url` must contain the protocol prefix, Loads the `url` in the webview, the `url` must contain the protocol prefix,
@ -508,14 +508,14 @@ Inserts `text` to the focused element.
* `text` String - Content to be searched, must not be empty. * `text` String - Content to be searched, must not be empty.
* `options` Object (optional) * `options` Object (optional)
* `forward` Boolean - (optional) Whether to search forward or backward, defaults to `true`. * `forward` Boolean (optional) - Whether to search forward or backward, defaults to `true`.
* `findNext` Boolean - (optional) Whether the operation is first request or a follow up, * `findNext` Boolean (optional) - Whether the operation is first request or a follow up,
defaults to `false`. defaults to `false`.
* `matchCase` Boolean - (optional) Whether search should be case-sensitive, * `matchCase` Boolean (optional) - Whether search should be case-sensitive,
defaults to `false`. defaults to `false`.
* `wordStart` Boolean - (optional) Whether to look only at the start of words. * `wordStart` Boolean (optional) - Whether to look only at the start of words.
defaults to `false`. defaults to `false`.
* `medialCapitalAsWordStart` Boolean - (optional) When combined with `wordStart`, * `medialCapitalAsWordStart` Boolean (optional) - When combined with `wordStart`,
accepts a match in the middle of a word if the match begins with an accepts a match in the middle of a word if the match begins with an
uppercase letter followed by a lowercase or non-letter. uppercase letter followed by a lowercase or non-letter.
Accepts several other intra-word matches, defaults to `false`. Accepts several other intra-word matches, defaults to `false`.
@ -548,14 +548,14 @@ Prints `webview`'s web page. Same as `webContents.print([options])`.
### `<webview>.printToPDF(options, callback)` ### `<webview>.printToPDF(options, callback)`
* `options` Object * `options` Object
* `marginsType` Integer - (optional) Specifies the type of margins to use. Uses 0 for * `marginsType` Integer (optional) - Specifies the type of margins to use. Uses 0 for
default margin, 1 for no margin, and 2 for minimum margin. default margin, 1 for no margin, and 2 for minimum margin.
* `pageSize` String - (optional) Specify page size of the generated PDF. Can be `A3`, * `pageSize` String (optional) - Specify page size of the generated PDF. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` `A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
and `width` in microns. and `width` in microns.
* `printBackground` Boolean - (optional) Whether to print CSS backgrounds. * `printBackground` Boolean (optional) - Whether to print CSS backgrounds.
* `printSelectionOnly` Boolean - (optional) Whether to print selection only. * `printSelectionOnly` Boolean (optional) - Whether to print selection only.
* `landscape` Boolean - (optional) `true` for landscape, `false` for portrait. * `landscape` Boolean (optional) - `true` for landscape, `false` for portrait.
* `callback` Function * `callback` Function
* `error` Error * `error` Error
* `data` Buffer * `data` Buffer