WebKit interop with AppIntents

Is there any new functionality in WebKit for bridging WebViews with the AppIntents framework? For example, is there a simple way to create an IndexedEntity whose content is provided by a WKWebView? Also, if I use appEntityIdentifer in a View that contains a WKWebView, will Siri see the web view’s content?

Answered by Frameworks Engineer in 891961022

Siri can only see what's on screen. If your app displays a WebKit view, Siri sees everything represented by pixels. You can provide additional context by annotating the webview with an app entity identifier that represents its content.

Your entity can be Transferable to a text representation that provides additional context about the webview's content.

Check out this documentation: https://developer.apple.com/documentation/appintents/providing-contextual-cues-to-apple-intelligence-and-siri

Siri can only see what's on screen. If your app displays a WebKit view, Siri sees everything represented by pixels. You can provide additional context by annotating the webview with an app entity identifier that represents its content.

Your entity can be Transferable to a text representation that provides additional context about the webview's content.

Check out this documentation: https://developer.apple.com/documentation/appintents/providing-contextual-cues-to-apple-intelligence-and-siri

To extract a text representation is the only solution to scrape the DOM using a JavaScript evaluation? Or is there a better approach to forward the content into an IndexedEntity?

WebKit interop with AppIntents
 
 
Q