Only emit finalUpdate found-in-page events
Since Chrome 53 all meaningful results of found-in-page are finalUpdate.
This commit is contained in:
parent
5ccd0a24e9
commit
fbac635687
4 changed files with 11 additions and 12 deletions
|
@ -302,10 +302,9 @@ Returns:
|
|||
* `event` Event
|
||||
* `result` Object
|
||||
* `requestId` Integer
|
||||
* `finalUpdate` Boolean - Indicates if more responses are to follow.
|
||||
* `activeMatchOrdinal` Integer (optional) - Position of the active match.
|
||||
* `matches` Integer (optional) - Number of Matches.
|
||||
* `selectionArea` Object (optional) - Coordinates of first match region.
|
||||
* `activeMatchOrdinal` Integer - Position of the active match.
|
||||
* `matches` Integer - Number of Matches.
|
||||
* `selectionArea` Object - Coordinates of first match region.
|
||||
|
||||
Emitted when a result is available for
|
||||
[`webContents.findInPage`](web-contents.md#webcontentsfindinpage) request.
|
||||
|
|
|
@ -646,10 +646,9 @@ Returns:
|
|||
|
||||
* `result` Object
|
||||
* `requestId` Integer
|
||||
* `finalUpdate` Boolean - Indicates if more responses are to follow.
|
||||
* `activeMatchOrdinal` Integer (optional) - Position of the active match.
|
||||
* `matches` Integer (optional) - Number of Matches.
|
||||
* `selectionArea` Object (optional) - Coordinates of first match region.
|
||||
* `activeMatchOrdinal` Integer - Position of the active match.
|
||||
* `matches` Integer - Number of Matches.
|
||||
* `selectionArea` Object - Coordinates of first match region.
|
||||
|
||||
Fired when a result is available for
|
||||
[`webview.findInPage`](web-view-tag.md#webviewtagfindinpage) request.
|
||||
|
@ -657,7 +656,7 @@ Fired when a result is available for
|
|||
```javascript
|
||||
const webview = document.getElementById('foo')
|
||||
webview.addEventListener('found-in-page', (e) => {
|
||||
if (e.result.finalUpdate) webview.stopFindInPage('keepSelection')
|
||||
webview.stopFindInPage('keepSelection')
|
||||
})
|
||||
|
||||
const requestId = webview.findInPage('test')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue