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...
However, I have no idea if there are enough hybrid apps out there, with javascript performance issues, to justify going to the trouble of doing this.
WebKit2 is an existing effort by Apple to do out-of-process rendering. Various desktop apps already use it, including Safari, Mail, and iBooks. It features new APIs for doing everything, because it's all asynchronous. If third-party iOS apps gain out-of-process rendering it will be through WebKit2 and not some attempt to port UIWebView to the remote view controller system.
Incidentally, the same synchronous issues with UIWebView that I mentioned above suggest that porting to WebKit2 is a non-backwards-compatible change. If Apple makes this change, I would guess that either they'll introduce a separate UIWebView class that's used for WebKit2 and leave the existing UIWebView alone, or they'll give UIWebView two modes, a WebKit mode and a WebKit2 mode, and whichever mode it uses will be selected at initialization time (and using a WebKit method on a WebKit2 UIWebView would be an error, and vice versa). Either way, apps will have to be rewritten to take advantage of WebKit2.
Also, apple has changed the internal subviews of system views before. In some cases they seem to provide a backwards compatible subview layout mode triggered by looking at the compiler/linker/sdk version so existing binaries will keep running. For sure I have seen previously working code like this breaking merely by recompiling with a newer xcode, as if it is taken to be an opt-in to new internal layouts - but not always; sometimes even existing apps needs rush updates if they have been assuming too much about undocumented subview hierarchies.
Because it's blocking the main thread. Worse, it's blocking the main thread doing something that has effectively no upper bound on how long it can take. Web Process is blocked trying to handle a previous request to calculate Pi to a trillion digits in javascript? Oops, your synchronous call to execute more javascript will just have to wait. Indefinitely.
> Also, apple has changed the internal subviews of system views before.
I'm not talking about internals. UIWebView directly exposes its scrollView as public API. And you can muck with the view properties of the UIWebView too to make changes. For example, if you really want to you could set your UIWebView to 50% alpha (and this is totally legit, not depending on internal subview hierarchies). Whereas Remote View Controllers explicitly prevent you from mucking with any aspect of the view hierarchy.
Fair enough about the scrollviews, although maybe they could be proxied somehow.
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...
Apple's case, if I understand, is different, because you cannot generate code at runtime and hence you cannot compile something "just in time". Nothing about Firefox OS disallows this, and so the two situations are not comparable
Firefox OS is providing the same thing. They don't allow you to just replace the OS, which in this case is the browser, but all applications, including their own are written with the same APIs available to you the developer. They aren't writing some of their own apps in C++ and then demanding everyone else write in Javascript. Apple is writing their own JIT and then demanding that everyone else interpret, which is not at all equivalent.
The difference here is that the browser is the OS. So the OS is at a certain level which you cannot replace or step into willy nilly. Think of it like Windows enforcing Hardware access through its drivers, not allowing you to just send whatever you want to someone's disk drive and possibly do damage to the device. In the same way, they enforce a level of Memory protection through the runtime, and after that they are on the same footing as you. We accept these constraints when we run OSs all the time, and I don't see it as being much different here.
So, while Google could probably build Chrome out of Javascript and run it atop the Firefox OS engine, it wouldn't make sense to do so. Asking if you can is basically like asking if you can create Chrome as a Firefox extension on Windows. Sure, you probably could with enough effort, but it would be a bit pointless in terms of functionality, speed, practicality, etc.
Additionally, this is a bit of a straw man that Apple fans trot out when people accuse Apple of being anti-competitive with iOS. It's not an equivalent situation. An equivalent situation would be if Google forbid other browser engines from running on Android. But, they don't. So, we have a nice competitive browser ecosystem on Android with solid browsers like Firefox that I use every day.
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.
One can debate the security implications of allowing programs to mark code as executable at all, but that debate is unrelated to W^X.
1. Preventing any app code from allocating memory and setting it executable: Apple doesn't seem to want to allow dynamically adding code to any app store apps. See: No .dylib support, the earlier bans on all types of interpreters, etc. It would be too easy to get a "Loader"-type app into the app store that could download and execute random app code from the internet that hasn't been vetted by the app store review team. (Emulators, plugins, addons that call private APIs, etc. etc. etc.)
2. Limiting the vulnerability surface: Reduce the risk of webkit exploits targeting app store apps (or even non-webkit random exploits in the app's code allowing loading of shellcode)
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.
If all the device manufacturers come together tomorrow and propose a cross-platform native programming platform then I'm all for it. Until then we'll rely on HTML.
That is, developing for the web doesn't magically make these fragmentation issues you attribute to native development disappear. The cost is lower because the quality expectations are lower, both in terms of the end-product and the developers putting the product together.
Put another way, if browsers become sophisticated enough to make them an appropriate medium for native-like apps that are more sophisticated than basic form data entry, what makes you think the cost to find competent, quality developers to write these apps to the level of quality expectation the end users will have won't be higher than it is today?
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 ?
I'm not sure that I've seen anyone suggest that. In any case, your point assumes that every app has the level of complexity that Photoshop, Lightroom etc. do and that's clearly not the case.
The simple fact remains that mobile web performance is sub-par, so every mobile web experience you've seen so far has also been sub-par. That doesn't automatically mean that amazing mobile web performance will result in amazing mobile web apps, but without trying it we won't ever know.
Everyone who uses Gmail and/or Google Docs is "detached from reality"?
Okay.
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.