A class conforming to the WKScript
protocol provides a method for receiving messages from JavaScript running in a webpage.
SDKs
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
Framework
- Web
Kit
Declaration
protocol WKScriptMessageHandler
A class conforming to the WKScript
protocol provides a method for receiving messages from JavaScript running in a webpage.
SDKs
Framework
protocol WKScriptMessageHandler
func user Content Controller(WKUser Content Controller, did Receive: WKScript Message)
Invoked when a script message is received from a webpage.
Required.
class WKUser Content Controller
A WKUser
object provides a way for JavaScript to post messages and inject user scripts to a web view.
class WKScript Message
A WKScript
object contains information about a message sent from a webpage.
class WKUser Script
A WKUser
object represents a script that can be injected into a webpage.