<!--
{
  "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(_:presentActionPopup:for:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WKWebExtensionControllerDelegate(im)webExtensionController:presentPopupForAction:forExtensionContext:completionHandler:"
  },
  "title" : "webExtensionController(_:presentActionPopup:for:completionHandler:)"
}
-->

# webExtensionController(_:presentActionPopup:for:completionHandler:)

Called when a popup is requested to be displayed for a specific action.

```
optional func webExtensionController(_ controller: WKWebExtensionController, presentActionPopup action: WKWebExtension.Action, for context: WKWebExtensionContext, completionHandler: @escaping ((any Error)?) -> Void)
```

## Parameters

`controller`

The web extension controller initiating the request.

`action`

The action for which the popup is requested.

`context`

The context within which the web extension is running.

`completionHandler`

A block to be called once the popup display operation is completed.

## Discussion

This method is called in response to the extension’s scripts or when invoking [`performAction(for:)`](/documentation/WebKit/WKWebExtensionContext/performAction(for:)) if the action has a popup.

The associated tab, if applicable, can be located through the [`associatedTab`](/documentation/WebKit/WKWebExtension/Action/associatedTab) property of the `action` parameter. This delegate method is called when the web view for the popup is fully loaded and ready to display. Implementing this method is needed if the app intends to support programmatically showing the popup by the extension, although it is recommended for handling both programmatic and user-initiated cases.

---

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)