---
title: WKJSHandle
framework: WebKit
role: symbol
role_heading: Class
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, visionOS 27.0+]
path: webkit/wkjshandle
---

# WKJSHandle

A WKJSHandle object contains a reference to a JavaScript object.

## Declaration

```swift
class WKJSHandle
```

## Overview

Overview There are various ways that JavaScript executing inside web content results in some return value being passed up to the WebKit application. Examples include calls to [WKWebView evaluateJavaScript:...], [WKWebView callAsyncJavaScript:...], and the body of a WKScriptMessage. Usually these result objects are a foundational type, such as a number, string, array, dictionary, etc. In some environments the result object can be a WKJSHandle or be a container that contains one or more WKJSHandle objects. These environments are: The JavaScript in question executed in a WKContentWorld that has allowJSHandleCreation set to YES The most recent navigation in the WKWebView had WKWebpagePreferences.allowsJSHandleCreationInPageWorld set to YES JavaScript running in those environments can make a WKJSHandle instead of following normal serialization rules by calling window.webkit.createJSHandle(...) with the target value as an argument. Whatever JavaScript object the WKJSHandle represents, it will be protected from garbage collection for the lifetime of the WKJSHandle The WKJSHandle can also be used as an argument to future JavaScript run via [WKWebView callAsyncJavaScript:...]

## Topics

### Instance Properties

- [frame](webkit/wkjshandle/frame.md)
- [world](webkit/wkjshandle/world.md)

### Instance Methods

- [windowProxyFrameInfo(_:)](webkit/wkjshandle/windowproxyframeinfo(_:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Page content

- [WKUserContentController](webkit/wkusercontentcontroller.md)
- [WKContentRuleListStore](webkit/wkcontentruleliststore.md)
- [WKContentWorld](webkit/wkcontentworld.md)
- [WKFrameInfo](webkit/wkframeinfo.md)
- [WKSecurityOrigin](webkit/wksecurityorigin.md)
- [WKUserScript](webkit/wkuserscript.md)
- [WKContentWorldConfiguration](webkit/wkcontentworldconfiguration.md)
- [WKJSSerializedNode](webkit/wkjsserializednode.md)
