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

# clearUserGesture(in:)

Called by the app to clear a user gesture in a specific tab.

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

## Parameters

`tab`

The tab from which the user gesture should be cleared.

## Discussion

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

This will revoke the extension’s access to features that require active user interaction, such as `activeTab`. User gestures are automatically cleared during navigation in certain scenarios; this method is needed if the app intends to clear the gesture more aggressively.

## See Also

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

Should be called by the app when a user gesture is performed in a specific 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)