appController(_:evaluateAppJavaScriptIn:)
Tells the delegate to add JavaScript classes and objects.
Declaration
optional func appController(_ appController: TVApplicationController, evaluateAppJavaScriptIn jsContext: JSContext)Parameters
- appController:
The Tvapplicationcontroller object that is evaluating the JavaScript context.
- jsContext:
The Jscontext object being evaluated.
Discussion
This method serves as a callback function, giving the delegate the ability to add JavaScript classes and objects through the setObject(_:forKey:) method using the jsContext parameter. This method is called before the JavaScript is parsed into the execution context and is called on the JavaScript execution thread, not the main thread. Any object exposed to JSContext must not be retained on any other thread.