add did-frame-navigate event to WebContents (#12723)
* add did-frame-navigate event to WebContents, pass http response code to it and did-navigate * docs for frame routing id related api changes on WebFrame and WebContents
This commit is contained in:
parent
c67d1b62e3
commit
55a7f6f0ce
5 changed files with 87 additions and 8 deletions
|
@ -67,6 +67,8 @@ Returns:
|
|||
* `errorDescription` String
|
||||
* `validatedURL` String
|
||||
* `isMainFrame` Boolean
|
||||
* `frameProcessId` Integer
|
||||
* `frameRoutingId` Integer
|
||||
|
||||
This event is like `did-finish-load` but emitted when the load failed or was
|
||||
cancelled, e.g. `window.stop()` is invoked.
|
||||
|
@ -78,6 +80,8 @@ Returns:
|
|||
|
||||
* `event` Event
|
||||
* `isMainFrame` Boolean
|
||||
* `frameProcessId` Integer
|
||||
* `frameRoutingId` Integer
|
||||
|
||||
Emitted when a frame has done navigation.
|
||||
|
||||
|
@ -195,14 +199,47 @@ this purpose.
|
|||
|
||||
Calling `event.preventDefault()` will prevent the navigation.
|
||||
|
||||
#### Event: 'did-start-navigation'
|
||||
|
||||
Returns:
|
||||
|
||||
* `url` String
|
||||
* `isInPlace` Boolean
|
||||
* `isMainFrame` Boolean
|
||||
* `frameProcessId` Integer
|
||||
* `frameRoutingId` Integer
|
||||
|
||||
Emitted when any frame (including main) starts navigating. `isInplace` will be
|
||||
`true` for in-page navigations.
|
||||
|
||||
#### Event: 'did-navigate'
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `url` String
|
||||
* `httpResponseCode` Integer - -1 for non HTTP navigations
|
||||
* `httpStatusText` String - empty for non HTTP navigations
|
||||
|
||||
Emitted when a navigation is done.
|
||||
Emitted when a main frame navigation is done.
|
||||
|
||||
This event is not emitted for in-page navigations, such as clicking anchor links
|
||||
or updating the `window.location.hash`. Use `did-navigate-in-page` event for
|
||||
this purpose.
|
||||
|
||||
#### Event: 'did-frame-navigate'
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `url` String
|
||||
* `httpResponseCode` Integer - -1 for non HTTP navigations
|
||||
* `httpStatusText` String - empty for non HTTP navigations,
|
||||
* `isMainFrame` Boolean
|
||||
* `frameProcessId` Integer
|
||||
* `frameRoutingId` Integer
|
||||
|
||||
Emitted when any frame navigation is done.
|
||||
|
||||
This event is not emitted for in-page navigations, such as clicking anchor links
|
||||
or updating the `window.location.hash`. Use `did-navigate-in-page` event for
|
||||
|
@ -215,8 +252,10 @@ Returns:
|
|||
* `event` Event
|
||||
* `url` String
|
||||
* `isMainFrame` Boolean
|
||||
* `frameProcessId` Integer
|
||||
* `frameRoutingId` Integer
|
||||
|
||||
Emitted when an in-page navigation happened.
|
||||
Emitted when an in-page navigation happened in any frame.
|
||||
|
||||
When in-page navigation happens, the page URL changes but does not cause
|
||||
navigation outside of the page. Examples of this occurring are when anchor links
|
||||
|
@ -1439,7 +1478,14 @@ more details.
|
|||
|
||||
#### `contents.getOSProcessId()`
|
||||
|
||||
Returns `Integer` - The `pid` of the associated renderer process.
|
||||
Returns `Integer` - The operating system `pid` of the associated renderer
|
||||
process.
|
||||
|
||||
#### `contents.getProcessId()`
|
||||
|
||||
Returns `Integer` - The chromium internal `pid` of the associated renderer. Can
|
||||
be compared to the `frameProcessId` passed by frame specific navigation events
|
||||
(e.g. `did-frame-navigate`)
|
||||
|
||||
### Instance Properties
|
||||
|
||||
|
|
|
@ -235,6 +235,15 @@ Returns `WebFrame` - A child of `webFrame` with the supplied `name`, `null`
|
|||
would be returned if there's no such frame or if the frame is not in the current
|
||||
renderer process.
|
||||
|
||||
### `webFrame.findFrameByRoutingId(routingId)`
|
||||
|
||||
* `routingId` Integer - A unique frame id in the current renderer process.
|
||||
Routing IDs can be retrieved from `WebFrame` instances (`webFrame.routingId`)
|
||||
and are also passed by frame specific `WebContents` navigation events (e.g.
|
||||
`did-frame-navigate`)
|
||||
|
||||
Returns `WebFrame` - that has the supplied `routingId`, `null` if not found.
|
||||
|
||||
## Properties
|
||||
|
||||
### `webFrame.top`
|
||||
|
@ -262,5 +271,10 @@ current renderer process.
|
|||
### `webFrame.nextSibling`
|
||||
|
||||
A `WebFrame` representing next sibling frame, the property would be `null` if
|
||||
`webFrame` is the last frame its parent or if the next sibling is not in the
|
||||
`webFrame` is the last frame in its parent or if the next sibling is not in the
|
||||
current renderer process.
|
||||
|
||||
### `webFrame.routingId`
|
||||
|
||||
A unique frame id in the current renderer process. Distinct WebFrame instances
|
||||
that refer to the same underlying frame will have the same `routingId`.
|
Loading…
Add table
Add a link
Reference in a new issue