---
title: "url(for:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebextensiontab/url(for:)"
---

# url(for:)

Called when the URL of the tab is needed.

## Declaration

```swift
optional func url(for context: WKWebExtensionContext) -> URL?
```

## Parameters

- `context`: The context in which the web extension is running.

## Discussion

Discussion Defaults to URL of the tab’s web view if not implemented.
