---
title: "page(_:willNavigateTo:)"
framework: safariservices
role: symbol
role_heading: Instance Method
path: "safariservices/sfsafariextensionhandling/page(_:willnavigateto:)"
---

# page(_:willNavigateTo:)

A method the system calls when a webpage is about to navigate to a new URL.

## Declaration

```swift
optional func page(_ page: SFSafariPage, willNavigateTo url: URL?)
```

## Parameters

- `page`: The webpage from which the user or script initiated the navigation.
- `url`: A URL for the destination webpage.

## Discussion

Discussion The url parameter is nil if the extension does not have permission to access the destination webpage.
