News for hackers. Stuff that matters.
Re:Locking in WebKit (2016) by Someone on Monday December 17, 2018 @05:41AM (#18698114)
Various browsers on iOS use WebKit because that’s the only way to ship a browser on iOS.
Re:Locking in WebKit (2016) by akskos on Monday December 17, 2018 @06:01AM (#18698197)
Is it true for Firefox as well? I remember Firefox wasn't available for iOS long time ago because of this issue but these days it is.
Re:Locking in WebKit (2016) by orta on Monday December 17, 2018 @06:21AM (#18698269)
Yep, roughly speaking you can't compete on speed with your own rendering engine because you cannot do Just In Time style memory optimizations in the iOS sandbox.

Only Apple can ship that type of code, so any browser from the App Store competes on features with Safari, not on memory/speed etc.

Re:Locking in WebKit (2016) by solarkraft on Monday December 17, 2018 @10:15AM (#18699394)
All browsers on iOS have to use Safari, so Firefox for iOS is just Safari with Firefox's UI and Sync.
Re:Locking in WebKit (2016) by kevin_b_er on Monday December 17, 2018 @11:23AM (#18699887)
It is still true for Firefox. Apple does not permit or approve applications that can execute their own code. Such a thing permits you to have "webapps" that are not under the purview of Apple and the walled garden. As a result, all browsers are just reskinning Apple's browser.

They had to make a small exception for educational programming apps, but that isn't Firefox.

Re:Locking in WebKit (2016) by bfred_it on Monday December 17, 2018 @05:55AM (#18698177)
Nitpick: They don't "use WebKit" but Safari itself. They can only offer "web views" (which are always just Safari)

Edit: maybe this isn't entirely correct, Apple calls them WebKit APIs in their docs. Only the latest view is actually called `SFSafariViewController`

Re:Locking in WebKit (2016) by saagarjha on Monday December 17, 2018 @06:44AM (#18698356)
Most standalone browsers use WKWebView, which is a WebKit-based UI component that applications can interact with. SFSafariViewController is more appropriate for in-app browsers, because it provides UI and has very few customization points.
Re:Locking in WebKit (2016) by jeffbax on Monday December 17, 2018 @09:04AM (#18698951)
Most small apps have ditched the web view for safari due to speed, maintenance, and integration with things like password management and content blocker support - but the big guys like Google and FB which don't want to support an ad blocking vector or native share extensions still tend to use the WK framework.
Re:Locking in WebKit (2016) by untog on Monday December 17, 2018 @09:51AM (#18699249)
WkWebView is used a lot in apps to present content that isn't immediately obviously web content, rather it is just using HTML/CSS as a presentation layer. One example is the activity feed in Instagram - I only know this because once upon a time the page lost CSS on a reload and I got to see it in all its link-blue-bordered glory.

The Safari controller is for when you're linking out to an external web site and want the user to behave the way they would in a normal browsing session.

Re:Locking in WebKit (2016) by saagarjha on Monday December 17, 2018 @02:28PM (#18701400)
A notable reason to use UIWebView is that it allows for changing network requests (for example, to add special headers). WKWebView does not because it runs out-of-process. So some of the web views you're seeing might actually be UIWebViews, depending on the context you're seeing them in.
Re:Locking in WebKit (2016) by untog on Monday December 17, 2018 @04:31PM (#18702393)
WKWebView now does allow that, in a roundabout way, through WKURLSchemeHandler.
Re:Locking in WebKit (2016) by saagarjha on Monday December 17, 2018 @04:40PM (#18702474)
It seems like this can only be used to support URL schemes "that WebKit doesn't know how to handle"?
Re:Locking in WebKit (2016) by untog on Monday December 17, 2018 @11:40PM (#18704564)
Yes, you create your own. In my example of the Instagram activity feed you'd point the view at instagram://activity-view or something like that in order to intercept the request and send a custom response. You could use the same method to "proxy" through to HTTP.
Re:Locking in WebKit (2016) by saagarjha on Monday December 17, 2018 @02:31PM (#18701418)
Like I mentioned, SFSafariViewController and WKWebView serve fundamentally different purposes; the former is for when you are trying to open a link and don't particularly care how it would be shown, and this would replace your own custom in-app browser implementation or opening links in Safari. The latter is used when you want to display a webpage and have full control over the content and the surrounding chrome, which makes it useful as both a general-purpose embedding view as well as the centerpiece of your browser app.