evaluate(inJavaScriptContext:completion:)
Evaluates a block in the JavaScript execution queue.
Declaration
func evaluate(inJavaScriptContext evaluation: @escaping (JSContext) -> Void, completion: (@Sendable (Bool) -> Void)? = nil)func evaluate(inJavaScriptContext evaluation: @escaping (JSContext) -> Void) async -> BoolParameters
Discussion
This method adds a block to the JavaScript execution queue and invokes the completion block after the evaluation block has finished execution. The context block parameter is valid within the scope of the evaluation block and should not be referenced by the app outside the block.