---
title: closePopup()
framework: webkit
role: symbol
role_heading: Instance Method
path: webkit/wkwebextension/action/closepopup()
---

# closePopup()

Triggers the dismissal process of the pop-up.

## Declaration

```swift
func closePopup()
```

## Discussion

Discussion Invoke this method to manage the pop-up’s lifecycle, ensuring the web view is unloaded and resources are released once the pop-up closes. This method is automatically called upon the dismissal of the action’s UIViewController or NSPopover.  For custom scenarios where the pop-up’s lifecycle is manually managed, it must be explicitly invoked to ensure proper closure.
