[Webkit-unassigned] [Bug 221655] New: WKWebView needs a synchronous API for JavaScript/DOM access
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Feb 9 23:21:21 PST 2021
https://bugs.webkit.org/show_bug.cgi?id=221655
Bug ID: 221655
Summary: WKWebView needs a synchronous API for JavaScript/DOM
access
Product: WebKit
Version: Safari 14
Hardware: Mac (Apple Silicon)
OS: macOS 11
Status: NEW
Severity: Blocker
Priority: P2
Component: WebKit API
Assignee: webkit-unassigned at lists.webkit.org
Reporter: jonathan at tumult.com
Practically speaking, applications that are tightly integrated with a web view have to go through clunky control flow contortions to deal with the callback structure of WKWebView's -evaluateJavaScript:/-callAsyncJavaScript: methods to access the DOM.
The only reasonable solution for handling this is to shove more and more of the application logic into JavaScript, at which point there is less of a reason to develop a native Mac app anymore.
For the time being, I have developed my own synchronous solution that reproduces the WebView Legacy DOM API. This uses run loop shenanigans and has significant drawbacks.
At the very least, WKWebView could at least not use the main run loop for its communication channel and not have locks where the child process will not respond properly if it cannot talk to to the main app. This would at least allow for using a dispatch_semaphore_wait() that gets signaled in the callback.
WKWebView could easily provide a better API, and it could probably be more performant too. I am surprised WebView was deprecated without providing this.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210210/213b4c49/attachment.htm>
More information about the webkit-unassigned
mailing list