<!--
{
  "availability" : [
    "iOS: 18.4.0 -",
    "iPadOS: 18.4.0 -",
    "macCatalyst: 18.4.0 -",
    "macOS: 15.4.0 -",
    "visionOS: 2.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKWebExtensionControllerDelegate/webExtensionController(_:openOptionsPageFor:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WKWebExtensionControllerDelegate(im)webExtensionController:openOptionsPageForExtensionContext:completionHandler:"
  },
  "title" : "webExtensionController(_:openOptionsPageFor:completionHandler:)"
}
-->

# webExtensionController(_:openOptionsPageFor:completionHandler:)

Called when an extension context requests its options page to be opened.

```
optional func webExtensionController(_ controller: WKWebExtensionController, openOptionsPageFor extensionContext: WKWebExtensionContext, completionHandler: @escaping ((any Error)?) -> Void)
```

## Parameters

`controller`

The web extension controller that is managing the extension.

`extensionContext`

The context in which the web extension is running.

`completionHandler`

A block to be called once the options page has been displayed or with an error if the page could not be shown.

## Discussion

This method should be implemented by the app to handle requests to display the extension’s options page. The app can decide how and where to display the options page (e.g., in a new tab or a separate window). The app should call the completion handler once the options page is visible to the user, or with an error if the operation was declined or failed. If not implemented, the options page will be opened in a new tab using the [`webExtensionController(_:openNewTabUsing:for:completionHandler:)`](/documentation/WebKit/WKWebExtensionControllerDelegate/webExtensionController(_:openNewTabUsing:for:completionHandler:)) delegate method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)