docs: add missing documentation for <webview> methods (#14413)

This commit is contained in:
Milan Burda 2018-09-03 05:27:51 +02:00 committed by Samuel Attard
parent 10176c71ff
commit e828348904

View file

@ -267,6 +267,12 @@ webview.addEventListener('dom-ready', () => {
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,
e.g. the `http://` or `file://`. e.g. the `http://` or `file://`.
### `<webview>.downloadURL(url)`
* `url` String
Initiates a download of the resource at `url` without navigating.
### `<webview>.getURL()` ### `<webview>.getURL()`
Returns `String` - The URL of guest page. Returns `String` - The URL of guest page.
@ -279,6 +285,11 @@ Returns `String` - The title of guest page.
Returns `Boolean` - Whether guest page is still loading resources. Returns `Boolean` - Whether guest page is still loading resources.
### `<webview>.isLoadingMainFrame()`
Returns `Boolean` - Whether the main frame (and not just iframes or frames within it) is
still loading.
### `<webview>.isWaitingForResponse()` ### `<webview>.isWaitingForResponse()`
Returns `Boolean` - Whether the guest page is waiting for a first-response for the Returns `Boolean` - Whether the guest page is waiting for a first-response for the
@ -402,7 +413,7 @@ Set guest page muted.
Returns `Boolean` - Whether guest page has been muted. Returns `Boolean` - Whether guest page has been muted.
#### `<webview>.isCurrentlyAudible()` ### `<webview>.isCurrentlyAudible()`
Returns `Boolean` - Whether audio is currently playing. Returns `Boolean` - Whether audio is currently playing.
@ -560,7 +571,38 @@ zoom percent divided by 100, so 300% = 3.0.
Changes the zoom level to the specified level. The original size is 0 and each Changes the zoom level to the specified level. The original size is 0 and each
increment above or below represents zooming 20% larger or smaller to default increment above or below represents zooming 20% larger or smaller to default
limits of 300% and 50% of original size, respectively. limits of 300% and 50% of original size, respectively. The formula for this is
`scale := 1.2 ^ level`.
### `<webview>.getZoomFactor(callback)`
* `callback` Function
* `zoomFactor` Number
Sends a request to get current zoom factor, the `callback` will be called with
`callback(zoomFactor)`.
### `<webview>.getZoomLevel(callback)`
* `callback` Function
* `zoomLevel` Number
Sends a request to get current zoom level, the `callback` will be called with
`callback(zoomLevel)`.
### `<webview>.setVisualZoomLevelLimits(minimumLevel, maximumLevel)`
* `minimumLevel` Number
* `maximumLevel` Number
Sets the maximum and minimum pinch-to-zoom level.
### `<webview>.setLayoutZoomLevelLimits(minimumLevel, maximumLevel)`
* `minimumLevel` Number
* `maximumLevel` Number
Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
### `<webview>.showDefinitionForSelection()` _macOS_ ### `<webview>.showDefinitionForSelection()` _macOS_