One Logo Pool Ball
WebKit · IOS API REFERENCE

WKUserContentController

class · iOS 8.0+ · SDK 27.1

@MainActor class WKUserContentController

Members (15)

method · iOS 11.0+

add

TypeScript
add(contentRuleList: WKContentRuleList): Promise<void>
Swift declaration
func add(_ contentRuleList: WKContentRuleList)
method · iOS 14.0+

add

TypeScript
addContentWorldName(scriptMessageHandler: Implements<WKScriptMessageHandler> | SDKHandle, world: WKContentWorld, name: string): Promise<void>
Swift declaration
func add(_ scriptMessageHandler: any WKScriptMessageHandler, contentWorld world: WKContentWorld, name: String)
method · iOS 8.0+

add

TypeScript
addName(scriptMessageHandler: Implements<WKScriptMessageHandler> | SDKHandle, name: string): Promise<void>
Swift declaration
func add(_ scriptMessageHandler: any WKScriptMessageHandler, name: String)
method · iOS 14.0+

addScriptMessageHandler

TypeScript
addScriptMessageHandler(scriptMessageHandlerWithReply: SDKHandle, contentWorld: WKContentWorld, name: string): Promise<void>
Swift declaration
func addScriptMessageHandler(_ scriptMessageHandlerWithReply: any WKScriptMessageHandlerWithReply, contentWorld: WKContentWorld, name: String)
method · iOS 8.0+

addUserScript

TypeScript
addUserScript(userScript: WKUserScript): Promise<void>
Swift declaration
func addUserScript(_ userScript: WKUserScript)
init

init

TypeScript
static init(): Promise<WKUserContentController>
Swift declaration
init()
method · iOS 11.0+

removeAllContentRuleLists

TypeScript
removeAllContentRuleLists(): Promise<void>
Swift declaration
func removeAllContentRuleLists()
method · iOS 14.0+

removeAllScriptMessageHandlers

TypeScript
removeAllScriptMessageHandlers(): Promise<void>
Swift declaration
func removeAllScriptMessageHandlers()
method · iOS 14.0+

removeAllScriptMessageHandlers

TypeScript
removeAllScriptMessageHandlersFrom(contentWorld: WKContentWorld): Promise<void>
Swift declaration
func removeAllScriptMessageHandlers(from contentWorld: WKContentWorld)
method · iOS 8.0+

removeAllUserScripts

TypeScript
removeAllUserScripts(): Promise<void>
Swift declaration
func removeAllUserScripts()
method · iOS 11.0+

remove

TypeScript
remove(contentRuleList: WKContentRuleList): Promise<void>
Swift declaration
func remove(_ contentRuleList: WKContentRuleList)
method · iOS 8.0+

removeScriptMessageHandler

TypeScript
removeScriptMessageHandlerForName(name: string): Promise<void>
Swift declaration
func removeScriptMessageHandler(forName name: String)
method · iOS 14.0+

removeScriptMessageHandler

TypeScript
removeScriptMessageHandlerForNameContentWorld(name: string, contentWorld: WKContentWorld): Promise<void>
Swift declaration
func removeScriptMessageHandler(forName name: String, contentWorld: WKContentWorld)
get · iOS 8.0+

userScripts

TypeScript
get userScripts(): Promise<Array<WKUserScript>>
Swift declaration
var userScripts: [WKUserScript] { get }
method · iOS 27.0+

removeBuffer

TypeScript
removeBuffer(name: string, contentWorld: WKContentWorld): Promise<void>
Swift declaration
@MainActor @preconcurrency func removeBuffer(named name: String, from contentWorld: WKContentWorld)

Removes a previously added data buffer from the given `WKContentWorld`. - Parameters: - name: The name of the buffer to remove. - contentWorld: The `WKContentWorld` from which to remove the buffer.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

WKUserContentController.addBuffer(_:name:to:)

The iOS SDK compiler rejected this binding: instance method 'arg' requires that 'RawSpan' conform to 'Escapable'

All WebKit types →