Class

WKUserContentController

A WKUserContentController object provides a way for JavaScript to post messages and inject user scripts to a web view.

Topics

Adding Message Handlers

addScriptMessageHandler:name:

Adds a script message handler.

Adding and Removing User Scripts

addUserScript:

Adds a user script.

removeAllUserScripts

Removes all associated user scripts.

removeScriptMessageHandlerForName:

Removes a script message handler.

userScripts

The user scripts associated with the user content controller.

Adding and Removing Content Rules

addContentRuleList:

Adds a list of content rules.

removeContentRuleList:

Removes a rules list.

removeAllContentRuleLists

Removes all rules lists.

WKContentRuleList

A compiled list of rules to apply to web content.

Relationships

Inherits From

Conforms To

See Also

Scripts

WKScriptMessage

A WKScriptMessage object contains information about a message sent from a webpage.

WKUserScript

A WKUserScript object represents a script that can be injected into a webpage.

WKScriptMessageHandler

A class conforming to the WKScriptMessageHandler protocol provides a method for receiving messages from JavaScript running in a webpage.