by untog · 12y ago · 0 comments
See: http://oleb.net/blog/2012/10/remote-view-controllers-in-ios-...
(I suspect there are some constraints on how a remote view controller can be used, and they'd have to do some additional work to shunt in NSURLProtocol and all.)
WebKit2 is done differently. The UIWebView still handles all the user interaction and whatnot, and it talks to the Web Process to send it requests (e.g. "load this URL", "run this JavaScript in the context of the page", etc). I'm not quite sure how the compositing of the web content works, but it's not the same system as remote view controllers.
http://oleb.net/blog/2012/10/more-on-remote-view-controllers...
https://github.com/nst/iOS-Runtime-Headers/blob/master/Frame... https://github.com/nst/iOS-Runtime-Headers/blob/master/Frame...
So may be we get Webkit2 for iOS 8?
So hopefully, they will come in iOS8.
[1] it's already in iOS since v4, but only activated for iAds
[1] http://www.cnet.com/news/mozilla-says-no-plans-to-return-to-...
[2] http://thenextweb.com/apple/2013/04/04/will-chrome-for-ios-b...
What Apple does on iOS goes beyond W^X. They give you a one-way trap door, where you're not allowed to mark any memory as executable, ever, once it's marked non-executable. (Obviously, there is an exception made for the OS facilities that actually load your code from the disk, and an exception made for Safari's JIT, but us mere mortals don't get access to that stuff.)
As for the reason, it's hard to say. It's probably because of code signing and Apple's desire for control to prevent you from downloading and running unreviewed, unapproved code, although even that doesn't entirely make sense, because you can always embed an interpreter and download and run code in that.
Any secure JIT would have to exist out-of-process with extended permissions, and would require some sort of RPC back-and-forth as the code was shuttled between the two processes.
Why is no one up in arms about Apple doing essentially the same thing with Safari vs. UIWebView?
It's not like it's not the fastest web view widget among mobile operating systems already.
In fact I far prefer companies serve me the full desktop site.
As for preferring the desktop sites, I'm afraid you are in a minority there.
We use apps like Photoshop, Word, Logic, Lightroom etc and not once has anyone come close to replicating the full experience within a web browser. Performance was never an issue then so why do people believe that once mobile browsers are faster that magically native apps will disappear ?
As a consequence, performance of JS outside of Safari is notably poor, and developers choose to go the "native" route for the sake of user experience.
My point is that we can do better. Tossing WebGL into the mix wouldn't hurt.