There was an interesting thread on Twitter today that turned into what
seems to be an invitation from a WebKit team member to start a discussion
about improving the WKWebView API.
https://twitter.com/awfulben/status/597899138231967745
I think this is a great opportunity to highlight some things that we have
found difficult to do using WKWebView. We can at least get some bugs filed
with them or hopefully get a discussion going. I would also be interested
to find out to what degree they accept patches and what the changes are of
those ending up in iOS.
Here are some things that I would be interesting in, mostly based on our
immediate needs for features we have on our roadmap:
- The WKWebView does not participate in state preservation/restoration.
This means it is impossible to restore a WKWebView including its previous
WKBackForwardList. It would be great if the WKWebView would do the right
thing, or as an alternative have a more flexible (non read-only)
WKBackForwardList so that applications can implement it.
- It is currently not possible to change the User Agent per WKWebView.
There is a private API for this that could be exposed. This would allow us
to implement 'Show Desktop Version'.
- It is very difficult to provide in-content error pages like Safari does,
while maintaining a sane WKBackForwardList. Opening up the _existing
loadAlternateHTMLString:baseURL:forUnreachableURL: private method would
likely make this possible.
- It is currently not possible to implement Private Mode. There is a
private API on CFNetworking that WebKit uses that could be exposed.
- There are no, or incomplete APIs to manage web site data. Cookies, Local
Storage, Cache, HSTS status, etc. It is currently impossible to manage site
data like iOS provides in Settings -> Safari -> Advanced -> Website Data.
Or even to do a reliable 'Clear All Data'.
- It is currently not possible to override or participate in the context
menu that shows when you long press on an item. Old WebKit used to have a
delegate method for this.
- The _WKVisitedLinkProvider is private and does not seem to be used by
WKWebView. Having this available as a public API would let us highlight
previously visited links based on the history collection that we do.
- It is currently not possible to participate in SSL/TLS negotiation. It
would be nice to get a callback so that we could for example check the
certificates and session parameters.
I copied the above to https://etherpad.mozilla.org/LAbr1f81wN
Please add some more thigns that we would like to see improved and i'll
turn it into a nice document with some longer explanations if individual
items so that they can understand the use-cases better.
S.
_______________________________________________
mobile-firefox-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/mobile-firefox-dev