# NavigationListener

Artifact: [androidx.webkit:webkit](https://developer.android.com/jetpack/androidx/releases/webkit) [View Source](https://cs.android.com/search?q=file:androidx/webkit/NavigationListener.java+class:androidx.webkit.NavigationListener) Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

*** ** * ** ***


```
public interface NavigationListener
```

<br />

*** ** * ** ***

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](https://docs.google.com/presentation/d/1YVqDmbXI0cllpfXD7TuewiexDNZYfwk6fRdmoXJbBlM).

Note: These navigation callbacks only fire for navigations happening on the main frame.

Navigation lifecycle events:

- `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationStarted(androidx.webkit.Navigation)`
- Potentially zero or more `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationRedirected(androidx.webkit.Navigation)` events
- `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationCompleted(androidx.webkit.Navigation)`
- If the navigation commits and is not a same-document navigation, potentially any combination and order of zero or one of each of:
  - `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageLoadEvent(androidx.webkit.Page)`
  - `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageDomContentLoadedEvent(androidx.webkit.Page)`
  - `https://developer.android.com/reference/androidx/webkit/NavigationListener#onFirstContentfulPaintMillis(androidx.webkit.Page,long)`
  - `https://developer.android.com/reference/androidx/webkit/NavigationListener#onLargestContentfulPaintMillis(androidx.webkit.Page,long)`
  - `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPerformanceMarkMillis(androidx.webkit.Page,java.lang.String,long)`

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#CLASS) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = [https://developer.android.com/reference/java/lang/annotation/ElementType.html#METHOD, https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE, https://developer.android.com/reference/java/lang/annotation/ElementType.html#FIELD]) @https://developer.android.com/reference/androidx/annotation/RequiresOptIn(level = https://developer.android.com/reference/androidx/annotation/RequiresOptIn.Level#ERROR) public annotation https://developer.android.com/reference/androidx/webkit/NavigationListener.ExperimentalOnNavigationVisible` Denotes that the onNavigationVisible callback is experimental. |

| ### Public methods |
|---|---|
| `default void` | `[onFirstContentfulPaintMillis](https://developer.android.com/reference/androidx/webkit/NavigationListener#onFirstContentfulPaintMillis(androidx.webkit.Page,long))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Page page, long durationMillis)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onFirstContentfulPaintMillis(androidx.webkit.PageState,long)` instead. <br /> |
| `default void` | `https://developer.android.com/reference/androidx/webkit/NavigationListener#onFirstContentfulPaintMillis(androidx.webkit.PageState,long)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState pageState, long durationMillis )` Called when the page achieves "First Contentful Paint". |
| `default void` | `[onLargestContentfulPaintMillis](https://developer.android.com/reference/androidx/webkit/NavigationListener#onLargestContentfulPaintMillis(androidx.webkit.Page,long))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Page page, long durationMillis)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onLargestContentfulPaintMillis(androidx.webkit.PageState,long)` instead. <br /> |
| `default void` | `https://developer.android.com/reference/androidx/webkit/NavigationListener#onLargestContentfulPaintMillis(androidx.webkit.PageState,long)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState pageState, long durationMillis )` Called when the page fires a "Largest Contentful Paint" event. |
| `default void` | `[onNavigationCompleted](https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationCompleted(androidx.webkit.Navigation))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Navigation navigation)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationCompleted(androidx.webkit.NavigationState)` instead. <br /> |
| `default void` | `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationCompleted(androidx.webkit.NavigationState)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/NavigationState navigationState)` Called when a navigation completes. |
| `default void` | `[onNavigationRedirected](https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationRedirected(androidx.webkit.Navigation))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Navigation navigation)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationRedirected(androidx.webkit.NavigationState,androidx.webkit.NavigationRedirectParameters)` instead. <br /> |
| `default void` | `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationRedirected(androidx.webkit.NavigationState,androidx.webkit.NavigationRedirectParameters)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/NavigationState navigationState, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/NavigationRedirectParameters navigationRedirectParameters )` Called when a navigation is redirected. |
| `default void` | `[onNavigationStarted](https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationStarted(androidx.webkit.Navigation))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Navigation navigation)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationStarted(androidx.webkit.NavigationState)` instead. <br /> |
| `default void` | `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationStarted(androidx.webkit.NavigationState)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/NavigationState navigationState)` Called when a navigation starts, including same-document navigations. |
| `default void` | `@https://developer.android.com/reference/androidx/webkit/NavigationListener.ExperimentalOnNavigationVisible https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationVisible(androidx.webkit.NavigationState)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/NavigationState navigationState)` Called when a navigation is made visible |
| `default void` | `[onPageDeleted](https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageDeleted(androidx.webkit.Page))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Page page)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageDeleted(androidx.webkit.PageState)` instead. <br /> |
| `default void` | `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageDeleted(androidx.webkit.PageState)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState pageState)` Called when any Page is evicted/destroyed. |
| `default void` | `[onPageDomContentLoadedEvent](https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageDomContentLoadedEvent(androidx.webkit.Page))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Page page)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageDomContentLoadedEvent(androidx.webkit.PageState)` instead. <br /> |
| `default void` | `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageDomContentLoadedEvent(androidx.webkit.PageState)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState pageState)` Called when the `DOMContentLoaded` event is fired for the current page. |
| `default void` | `[onPageLoadEvent](https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageLoadEvent(androidx.webkit.Page))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Page page)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageLoadEvent(androidx.webkit.PageState)` instead. <br /> |
| `default void` | `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageLoadEvent(androidx.webkit.PageState)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState pageState)` Called when the `window.load` event is fired for the current page. |
| `default void` | `[onPerformanceMarkMillis](https://developer.android.com/reference/androidx/webkit/NavigationListener#onPerformanceMarkMillis(androidx.webkit.Page,java.lang.String,long))( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Page page, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html markName, long markTimeMillis )` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPerformanceMarkMillis(androidx.webkit.PageState,java.lang.String,long)` instead. <br /> |
| `default void` | `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPerformanceMarkMillis(androidx.webkit.PageState,java.lang.String,long)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState pageState, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html markName, long markTimeMillis )` Called when the page registers a performance mark. |

## Public methods

### onFirstContentfulPaintMillis

Added in [1.16.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.16.0) Deprecated in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void [onFirstContentfulPaintMillis](https://developer.android.com/reference/androidx/webkit/NavigationListener#onFirstContentfulPaintMillis(androidx.webkit.Page,long))(@NonNull Page page, long durationMillis)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onFirstContentfulPaintMillis(androidx.webkit.PageState,long)` instead.

Called when the page achieves "First Contentful Paint".

See [First Contentful Paint (FCP)](https://web.dev/articles/fcp) for a definition.
Note: Delivery of this event may be delayed due to batching with other events, so it may not be sent in real-time.

This method is called only if `https://developer.android.com/reference/androidx/webkit/WebViewFeature#NAVIGATION_LISTENER()` is supported. You can check whether that flag is supported using `https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Page page` | The Page for which the First Contentful Paint occurred. |
| `long durationMillis` | Navigation to First Contentful Paint duration in milliseconds. |

### onFirstContentfulPaintMillis

Added in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void onFirstContentfulPaintMillis(
    @NonNull PageState pageState,
    long durationMillis
)
```

Called when the page achieves "First Contentful Paint".

See [First Contentful Paint (FCP)](https://web.dev/articles/fcp) for a definition.
Note: Delivery of this event may be delayed due to batching with other events, so it may not be sent in real-time.

This method is called only if `https://developer.android.com/reference/androidx/webkit/WebViewFeature#NAVIGATION_LISTENER()` is supported. You can check whether that flag is supported using `https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState pageState` | The Page's state at which the First Contentful Paint occurred. |
| `long durationMillis` | Navigation to First Contentful Paint duration in milliseconds. |

### onLargestContentfulPaintMillis

Added in [1.16.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.16.0) Deprecated in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void [onLargestContentfulPaintMillis](https://developer.android.com/reference/androidx/webkit/NavigationListener#onLargestContentfulPaintMillis(androidx.webkit.Page,long))(@NonNull Page page, long durationMillis)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onLargestContentfulPaintMillis(androidx.webkit.PageState,long)` instead.

Called when the page fires a "Largest Contentful Paint" event.

See [Largest Contentful Paint (LCP)](https://web.dev/articles/lcp) for a definition.
Note: Delivery of this event may be delayed due to batching with other events, so it may not be sent in real-time.

This method is called only if `https://developer.android.com/reference/androidx/webkit/WebViewFeature#NAVIGATION_LISTENER()` is supported. You can check whether that flag is supported using `https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Page page` | The Page for which the Largest Contentful Paint occurred. |
| `long durationMillis` | Navigation to Largest Contentful Paint duration in milliseconds. |

### onLargestContentfulPaintMillis

Added in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void onLargestContentfulPaintMillis(
    @NonNull PageState pageState,
    long durationMillis
)
```

Called when the page fires a "Largest Contentful Paint" event.

See [Largest Contentful Paint (LCP)](https://web.dev/articles/lcp) for a definition.
Note: Delivery of this event may be delayed due to batching with other events, so it may not be sent in real-time.

This method is called only if `https://developer.android.com/reference/androidx/webkit/WebViewFeature#NAVIGATION_LISTENER()` is supported. You can check whether that flag is supported using `https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState pageState` | The Page's state at which the Largest Contentful Paint occurred. |
| `long durationMillis` | Navigation to Largest Contentful Paint duration in milliseconds. |

### onNavigationCompleted

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0) Deprecated in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void [onNavigationCompleted](https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationCompleted(androidx.webkit.Navigation))(@NonNull Navigation navigation)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationCompleted(androidx.webkit.NavigationState)` instead.

Called when a navigation completes.

The navigation might not have actually committed (e.g., results in 204/download/cancelled), but those that do they will have committed by this point.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Navigation navigation` | The Navigation object representing the completed navigation. |

### onNavigationCompleted

Added in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void onNavigationCompleted(@NonNull NavigationState navigationState)
```

Called when a navigation completes.

The navigation might not have actually committed (e.g., results in 204/download/cancelled), but those that do they will have committed by this point.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/NavigationState navigationState` | An immutable snapshot of the Navigation's state at the point the Navigation is completed. |

### onNavigationRedirected

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0) Deprecated in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void [onNavigationRedirected](https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationRedirected(androidx.webkit.Navigation))(@NonNull Navigation navigation)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationRedirected(androidx.webkit.NavigationState,androidx.webkit.NavigationRedirectParameters)` instead.

Called when a navigation is redirected.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Navigation navigation` | The Navigation object representing the redirected navigation. |

### onNavigationRedirected

Added in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void onNavigationRedirected(
    @NonNull NavigationState navigationState,
    @NonNull NavigationRedirectParameters navigationRedirectParameters
)
```

Called when a navigation is redirected.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/NavigationState navigationState` | An immutable snapshot of the Navigation's state at the point the Navigation is redirected. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/NavigationRedirectParameters navigationRedirectParameters` | An object which exposes response headers for the callback |

### onNavigationStarted

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0) Deprecated in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void [onNavigationStarted](https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationStarted(androidx.webkit.Navigation))(@NonNull Navigation navigation)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationStarted(androidx.webkit.NavigationState)` instead.

Called when a navigation starts, including same-document navigations.

Note: These navigation callbacks only fire for navigations happening on the main frame.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Navigation navigation` | The Navigation object representing the started navigation. |

### onNavigationStarted

Added in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void onNavigationStarted(@NonNull NavigationState navigationState)
```

Called when a navigation starts, including same-document navigations.

Note: These navigation callbacks only fire for navigations happening on the main frame.

Note: Calling super will call the old `https://developer.android.com/reference/androidx/webkit/NavigationListener#onNavigationStarted(androidx.webkit.Navigation)`

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/NavigationState navigationState` | An immutable snapshot of the Navigation's state at the point when the Navigation is started. |

### onNavigationVisible

Added in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
@NavigationListener.ExperimentalOnNavigationVisible
default void onNavigationVisible(@NonNull NavigationState navigationState)
```

Called when a navigation is made visible

Note: This method is only called if `https://developer.android.com/reference/androidx/webkit/WebViewFeature#NAVIGATION_LISTENER_NAVIGATION_VISIBLE()` is supported.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/NavigationState navigationState` | An immutable snapshot of the Navigation's state at the point the Navigation is visible. |

### onPageDeleted

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0) Deprecated in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void [onPageDeleted](https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageDeleted(androidx.webkit.Page))(@NonNull Page page)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageDeleted(androidx.webkit.PageState)` instead.

Called when any Page is evicted/destroyed. This can occur immediately on navigation, or later if the page is BFCached and subsequently evicted.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Page page` | The Page that was evicted or destroyed. |

### onPageDeleted

Added in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void onPageDeleted(@NonNull PageState pageState)
```

Called when any Page is evicted/destroyed. This can occur immediately on navigation, or later if the page is BFCached and subsequently evicted.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState pageState` | An immutable snapshot of the Page's state at the point the Page is deleted. |

### onPageDomContentLoadedEvent

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0) Deprecated in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void [onPageDomContentLoadedEvent](https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageDomContentLoadedEvent(androidx.webkit.Page))(@NonNull Page page)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageDomContentLoadedEvent(androidx.webkit.PageState)` instead.

Called when the `DOMContentLoaded` event is fired for the current page.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Page page` | The Page for which the `DOMContentLoaded` event fired. |

### onPageDomContentLoadedEvent

Added in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void onPageDomContentLoadedEvent(@NonNull PageState pageState)
```

Called when the `DOMContentLoaded` event is fired for the current page.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState pageState` | An immutable snapshot of the Page's state at the point the DOMContentLoaded event is fired. |

### onPageLoadEvent

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0) Deprecated in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void [onPageLoadEvent](https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageLoadEvent(androidx.webkit.Page))(@NonNull Page page)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPageLoadEvent(androidx.webkit.PageState)` instead.

Called when the `window.load` event is fired for the current page.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Page page` | The Page for which the `window.load` event fired. |

### onPageLoadEvent

Added in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void onPageLoadEvent(@NonNull PageState pageState)
```

Called when the `window.load` event is fired for the current page.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState pageState` | An immutable snapshot of the Page's state at the point the Page is loaded. |

### onPerformanceMarkMillis

Added in [1.16.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.16.0) Deprecated in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void [onPerformanceMarkMillis](https://developer.android.com/reference/androidx/webkit/NavigationListener#onPerformanceMarkMillis(androidx.webkit.Page,java.lang.String,long))(
    @NonNull Page page,
    @NonNull String markName,
    long markTimeMillis
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/webkit/NavigationListener#onPerformanceMarkMillis(androidx.webkit.PageState,java.lang.String,long)` instead.

Called when the page registers a performance mark.

See [Performance: mark() method](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) for a definition.
Note: Delivery of this event may be delayed due to batching with other events, so it may not be sent in real-time.

This method is called only if `https://developer.android.com/reference/androidx/webkit/WebViewFeature#NAVIGATION_LISTENER()` is supported. You can check whether that flag is supported using `https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/Page page` | The Page for which the performance mark was registered. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html markName` | The name of the performance mark. |
| `long markTimeMillis` | The time of the performance mark in milliseconds since Performance.timeOrigin. |

### onPerformanceMarkMillis

Added in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
default void onPerformanceMarkMillis(
    @NonNull PageState pageState,
    @NonNull String markName,
    long markTimeMillis
)
```

Called when the page registers a performance mark.

See [Performance: mark() method](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) for a definition.
Note: Delivery of this event may be delayed due to batching with other events, so it may not be sent in real-time.

This method is called only if `https://developer.android.com/reference/androidx/webkit/WebViewFeature#NAVIGATION_LISTENER()` is supported. You can check whether that flag is supported using `https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState pageState` | The Page's state at which the performance mark was registered. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html markName` | The name of the performance mark. |
| `long markTimeMillis` | The time of the performance mark in milliseconds since Performance.timeOrigin. |