WebNavigationClient
@WebNavigationClient.ExperimentalNavigationCallback
public interface WebNavigationClient
Page identification and lifecycle APIs. This class provides callbacks to identify the different stages of navigation. For more information about the navigation lifecycle, please see the Life of a Navigation Presentation.
Note: These navigation callbacks only fire for navigations happening on the main frame.
Navigation lifecycle events:
onNavigationStarted
- Potentially zero or more
onNavigationRedirected
events onNavigationCompleted
- If the navigation commits and is not a same-document navigation, potentially any combination and order of zero or one of each of:
onPageLoadEvent
onPageDomContentLoaded
onFirstContentfulPaint
Summary
Nested types |
---|
@Retention(value = RetentionPolicy.CLASS) Denotes |
Public methods |
|
---|---|
abstract void |
onFirstContentfulPaint(@NonNull Page page) Fired when the page achieves "First Contentful Paint". |
abstract void |
onNavigationCompleted(@NonNull Navigation navigation) Fired when a navigation completes. |
abstract void |
onNavigationRedirected(@NonNull Navigation navigation) Fired when a navigation is redirected. |
abstract void |
onNavigationStarted(@NonNull Navigation navigation) Fired when a navigation starts, including same-document navigations. |
abstract void |
onPageDeleted(@NonNull Page page) Fired when any Page is evicted/destroyed. |
abstract void |
Fired when the `DOMContentLoaded` event is fired for the current page. |
abstract void |
onPageLoadEventFired(@NonNull Page page) Fired when the `window.load` event is fired for the current page. |
Public methods
onFirstContentfulPaint
abstract void onFirstContentfulPaint(@NonNull Page page)
Fired when the page achieves "First Contentful Paint".
See First Contentful Paint (FCP) for a definition.
onNavigationCompleted
abstract void onNavigationCompleted(@NonNull Navigation navigation)
Fired when a navigation completes.
The navigation might not have actually committed (e.g., results in 204/download/cancelled).
Parameters | |
---|---|
@NonNull Navigation navigation |
The Navigation object representing the completed navigation. |
onNavigationRedirected
abstract void onNavigationRedirected(@NonNull Navigation navigation)
Fired when a navigation is redirected.
Parameters | |
---|---|
@NonNull Navigation navigation |
The Navigation object representing the redirected navigation. |
onNavigationStarted
abstract void onNavigationStarted(@NonNull Navigation navigation)
Fired when a navigation starts, including same-document navigations.
Note: These navigation callbacks only fire for navigations happening on the main frame.
Parameters | |
---|---|
@NonNull Navigation navigation |
The Navigation object representing the started navigation. |
onPageDeleted
abstract void onPageDeleted(@NonNull Page page)
Fired when any Page is evicted/destroyed. This can occur immediately on navigation, or later if the page is BFCached and subsequently evicted.
onPageDomContentLoadedEventFired
abstract void onPageDomContentLoadedEventFired(@NonNull Page page)
Fired when the `DOMContentLoaded` event is fired for the current page.
onPageLoadEventFired
abstract void onPageLoadEventFired(@NonNull Page page)
Fired when the `window.load` event is fired for the current page.