<!--
{
  "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/WKWebExtensionContext/userGesturePerformed(in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKWebExtensionContext(im)userGesturePerformedInTab:"
  },
  "title" : "userGesturePerformed(in:)"
}
-->

# userGesturePerformed(in:)

Should be called by the app when a user gesture is performed in a specific tab.

```
func userGesturePerformed(in tab: any WKWebExtensionTab)
```

## Parameters

`tab`

The tab in which the user gesture was performed.

## Discussion

When a user gesture is performed in a tab, this method should be called to update the extension context.

This enables the extension to be aware of the user gesture, potentially granting it access to features that require user interaction, such as `activeTab`. Not required if using [`performAction(for:)`](/documentation/WebKit/WKWebExtensionContext/performAction(for:)).

## See Also

[`hasActiveUserGesture(in:)`](/documentation/WebKit/WKWebExtensionContext/hasActiveUserGesture(in:))

Indicates if a user gesture is currently active in the specified tab.



---

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)