26 ms·
Open-sourcing Chrome on iOS
- wadetandy 10y agoMy understanding is that the reason Chrome has to use the iOS webkit view is because that's the only way to get JIT javascript compilation working for apps submitted to the app store. Does anyone have a sense of whether it would be possible to switch to Blink and V8 with a locally compiled and sideloaded version of the app? Would there be any benefit?
- bad_user 10y agoBefore iOS 9 (or something) that JIT engine wasn't even exposed in the web view available for apps, so no matter what you did, you couldn't match the performance of Safari. On iOS browsers like Chrome and Firefox are basically unable to compete in terms of performance, web standards or features like browser plugins. So people that use them do so just to get sync. Of course Safari Mobile is decent nowadays, but that's not the issue.
- oatmealsnap 10y agoYea, it was always an outdated version of WebKit.
- JonathonW 10y agoNot outdated (it's always been the same WebKit version as used by Safari), but security restrictions on iOS (specifically, third-party iOS apps can't JIT-- the OS won't let apps without a specific entitlement execute from a writable section of memory) prevented in-app web views from using the same Javascript engine as Safari. iOS 9 eliminated that performance penalty-- it introduced a new kind of web view backed by an out-of-process renderer and JS engine, which, since it's Apple-blessed, doesn't have the JIT restriction. Third-party browsers updated to use the new framework can get the same performance as Safari.
- gcp 10y agoThird-party browsers updated to use the new framework can get the same performance as Safari. But that framework is missing various things, such as content blocking. (That goes a long way to explain why there's both "Focus" and "Firefox" on iOS)
- hendersoon 10y agoExactly right. Lack of content blocking is why I don't use Chrome on iOS. I strongly prefer its UI and sync, but can't go back to seeing ads.
- djrogers 10y ago> But that framework is missing various things, such as content blocking Not really - SFSafariViewController uses content blockers, autofill, etc. There's also WKWebView for those that want to implement their own content blockers and autofill engines. Curious why you'd want safari's content blockers to run inside chrome or firefox though? That's not how browser plugins work anywhere else, and it seems like if content blockers were forced in to 3rd party browsers there'd be a lot more angst over that decision. [1] https://developer.apple.com/library/ios/documentation/SafariServices/Reference/SFSafariViewController_Ref/ https://developer.apple.com/library/ios/documentation/Safari...
- bad_user 10y agoExtensions like 1Password work in Firefox and Chrome but not content blockers. I know because I tested both. Mozilla also made a statement about it: https://motherboard.vice.com/read/heres-why-firefox-for-ios-cant-block-ads-like-it-can-on-the-desktop https://motherboard.vice.com/read/heres-why-firefox-for-ios-...
- st3fan 10y ago1Password only works in non-Safari browsers if those apps include a less optimal SDK that provides a generic password filling conduit. It is not something that WKWebView automagically does. See https://github.com/AgileBits/onepassword-app-extension https://github.com/AgileBits/onepassword-app-extension
- oatmealsnap 10y agoThat might allow Chrome Extensions on iOS, but it seems like a lot of work to make that happen.
- zwily 10y agoYou're not allowed to provide your own web render engine at all. The JIT issue was solved a couple versions of iOS ago - embedded webviews now get JIT just like Safari.
- DonHopkins 10y agoIt's my understanding that only embedded WKWebViews are allowed to enable the JIT compiler, but not UIWebViews (or in-process JavaScriptCore engines). WKWebView is an out-of-process web browser that uses IOSurface [1] to project the image into your embedding application and IPC to send messages. So WKWebView's dynamically generated code is running safely firewalled in a separate address space controlled by Apple and not accessible to your app, while older UIWebViews run in the address space of your application, and aren't allowed to write to code pages, so their JIT compiler is disabled. Since it's running in another process, WkWebView's JavaScriptEngine lacks the ability to expose your own Objective C classes to JavaScript so they can be called directly [2], but it does include a less efficient way of adding script message handlers that call back to Objective C code via IPC [3]. [1] https://developer.apple.com/reference/iosurface https://developer.apple.com/reference/iosurface [2] https://developer.apple.com/reference/javascriptcore/jsexport/ https://developer.apple.com/reference/javascriptcore/jsexpor... [3] https://developer.apple.com/reference/webkit/wkusercontentcontroller/1537172-addscriptmessagehandler?language=objc https://developer.apple.com/reference/webkit/wkusercontentco...
- eslaught 10y ago> You're not allowed to provide your own web render engine at all. Is that true? I understand the security argument against JITs, but I don't see why it would be objectionable to run a copy of e.g. Gecko if you excluded the JS JIT component. (Of course you would never actually do that. But I'm trying to tease apart the separate arguments and see if they're actually connected.) It seems to me that the root cause for this is all the JIT. If the JIT in iOS has to be exposed via IPC for security (as claimed in a sibling comment) it's simply not going to be a win to try to use it in combination with a separate rendering engine, if it's even possible at all.
- st3fan 10y ago
- spikengineer 10y agoIf you don't use Apple Webkit view apple doesn't even allow you put your browser on the appstore. All other browser engines are banned. See section 2.5.6 of the Appstore guidelines "2.5.6 Apps that browse the web must use the appropriate WebKit framework and WebKit Javascript." https://developer.apple.com/app-store/review/guidelines/ https://developer.apple.com/app-store/review/guidelines/
- therealmarv 10y agoOpera Mini bypasses this restriction with doing Server Rendering. I wonder why Apple is ok with them (because it'a a big security risk to server render HTTPS IMHO). And regarding your quesiton: I'm sure you cannot replace their webkit usage with one switch to Blink... I'm sure the iOS internal webview is deeply integrated/
- abrowne 10y agoOpera Mini, the app, is not rendering HTML as you say. They don't block VNC or RDP apps even though you can run a remote browser through them.
- madeofpalk 10y ago> locally compiled You can't "locally compile" code on iOS. That's against App Store guidelines.
- hawski 10y agoI am sure that he meant "locally" as on one's one computer without AppStore.
- rweichler 10y agoNo. You can't map executable pages in the sandbox. JITs (such as LuaJIT) only work while the debugger is attached (i.e., you open the app by clicking "run" in Xcode).
- tyingq 10y agoWould this allow for better ad blocking software (no internal vpn tricks, etc), or would Apple likely reject a forked Chrome with adblocking from their app store?
- joeblau 10y agoYou can already do ad blocking natively through Safari Content Blocking extensions. There is also another trick you can do where you can use a VPN that routes known top-level-domains to 0.0.0.0 which would allow for entire Apple System blocking (similar to /etc/hosts).
- gcp 10y agoYou can have ad blocking, but you can't have the fast JavaScript engine and ad blocking, unless you are Safari. So you can't have a Chrome or Firefox with both, unless Apple fixes their APIs or allows the "real" versions of those browsers.
- djrogers 10y agoNot true at all, and also nothing is stopping you from building your own ad-blocking logic in to your browser either - iCab Mobile for example does just that.
- gcp 10y agoIt's not possible to do that and use the fast JavaScript engine from WKWebView. I'm sorry but you have no idea what you're talking about.
- azinman2 10y agoWhy not? WKWebView has a delegate callback for the policy to load any given URL. You can implement ad blocking that way. Or you can chose to inject CSS rules if that's your fancy. What's the technical issue?
- 10y ago
- phs318u 10y agoThere seems to be an argument here that runs something like this "I've bought a ticket into this walled garden and I don't like the walls, and why do we only get to eat apples?" Yet, next door is a lovely (by all accounts) meadow where you are free to roam and even plant other fruit trees. Apple's environment is a walled garden. They don't hide this - in fact they make a virtue of it. And the market is so competitive that there are plenty of viable non-Apple alternatives. It's one thing to argue the merits or not of a walled garden as a business strategy. However most of the arguments being made here seem... petty?
- wmccullough 10y agoI think the real question is this. Why do so many prefer the walled garden? Sure, many will easily dismiss them as "stupid" but this can't surely be the case. iPhone owners make up about 43% of smart phone users according to CNN (Take it for what you will). I don't have an answer, but I think it's worth asking the question.
- azinman2 10y agoBecause they produce amazing beautiful hardware that works well with its software, no difficult configuration needed, a best-in-class UX, a high bar for all of its apps to meet (so thus overall UX is quality), an integrated ecosystem, and a marketing machine that makes you feel good and obtain social status for owning it. What's the mystery?
- evv 10y agoIts a shame Apple gets away with stifling browser competition and forcing everyone to use Webkit. Of course it's a brilliant move: by controlling the stagnation of web browser tech, they can force developers to implement apps with their high-lock-in native app frameworks. Google does the same thing with Android, but it is not nearly as blatant as Apple's flat-out blocking competitive browser implementations.
- deleted 10y ago[deleted]
- cptskippy 10y ago> Google does the same thing with Android How so? They have no restrictions on web browser development. Firefox has been there and I use it as my daily driver. Since KitKat, Android System WebView has been an app on in the Play Store based on Chrome that gets updated regularly.
- problems 10y agoNot to mention that Android also lacks a lot of restrictions that iOS has, JIT code = no problem, mono for android has many more features than the iOS one for that reason. You also don't have to use Google Cloud Messaging, you can do your own push notifications via IMAP, XMPP, etc. (Assuming you and your users are okay with pushing an 'okay I'm willing to sacrifice some battery life for this' button). Mapping components that use OSM are freely available, etc. Heck, you don't even have to use their phone app, you can install a SIP client. It's perfectly possible to use Android as it exists in AOSP without Google stuff at all. Some 3rd party apps may want to use things like Google Maps embedded, but there are projects that replace those and an Xposed module to fake the signatures to match. The Google-less Android system is really a decent experience if you're willing to put the work in to it.
- kuschku 10y ago> (Assuming you and your users are okay with pushing an 'okay I'm willing to sacrifice some battery life for this' button) That doesn’t work in Marshmallow, due to a bug, even if the user opts out, it will still disable the app during Doze. The bug has been fixed in later versions, but you as a dev obviously can’t just leave a huge share of your users without working push notifications.
- deleted 10y ago[deleted]
- DonHopkins 10y agoHow much is there even left for Chrome to do, once you are building on top of a WKWebView? Seems like Chrome would be a very thin layer on top of it, with WKWebView doing most of the work, and Chrome just implementing a thin layer of user interface widgetry on top of that (next and back button, url bar, etc). Sounds to me like it's just a branded "white label" version of Apple's standard Safari browser.
- hendersoon 10y agoIt is indeed. Chrome on iOS has some neat UI innovations, though-- when you drag down on a page you see three icons; a + sign for a new tab, a refresh icon, and an X to close the current tab. So you can drag straight down to refresh, down then left to add a new tab, etc. I really miss that in safari. It also syncs history, logins, open tabs, etc, with desktop Chrome.
- mdonahoe 10y agoI am glad they abandoned swipe-to-switch-tabs for swipe-to-go-back like Safari uses. Much more useful IMO
- curt15 10y agoI've always wondered why the Android version does not have swipe to go back.
- eggnet 10y agoAndroid has a system level back button.
- StRoy 10y agoWhich is not as convenient to use on larger phones, one handed, compared to a gesture that works anywhere on the web page. I have a Honor 8 and while overall I'm very satisfied with the apps, speediness of the phone, the lack of gestures in most Android apps compared to iOS gets old very fast, even more so because 99% of all the good android handsets on the market are much bigger than the iPhone 5s I had before. Saying you can press the back button located on the bottom left side of the screen really doesn't cut it.
- jmascart 10y agoWhy is it so rare for mobile apps to be open source? I've skimmed the top 100 free iOS apps, and none of them (besides chrome) are open source.
- rjvir 10y agoHow many of the top 100 websites are open source? Sure, it's not zero, but large open source production products are rare to begin with.
- e12e 10y agoBeing websites they're a "view source" away? Sure a few might be obfuscated/minimized - but in general not to the point that they are very hard to learn from and experiment with...
- Sargos 10y agoExecutables are just a hex editor away as well. Facebook.com's source is about as helpful as looking at Chrome.exe when learning to code or learn about them in any detailed way.
- wingerlang 10y agoThat's only the source of the generated document you are viewing.
- WildUtah 10y agoOf the top 100 websites (I got tired of counting) in the USA, the obvious open source ones from a quick review are, 4. Wikipedia 6. Reddit 33. Wikia 37. Wordpress 40. Twitch 60. Github 61. Reddit Uploads I'm not counting Craigslist, though its infrastructure is documented and open source, because you can't just download the engine and run it yourself without a lot of glue. Likewise Pirate Bay. There are probably more marginal cases like that among the top. And there are open data projects like Stack Exchange and Stack Overflow that essentially publish all their content on open source licenses and offer free download dumps. Both are top 100 sites. Then there are the news sites available without paywall. Those are just basic blogs with photos, video, and text accessible to the public. They aren't open source; you have to pay to republish their content. But there is essentially no special software you can't match with any open source CMS at CNN or the Washington Post or HuffPo or many, many other top sites. I'd say the solid majority of the top 100 sites don't have any special closed source software, except for the proprietary search engine projects: Google, Bing, Yahoo, their respective mail and document suite projects, and the like.
- frakkingcylons 10y agoCan we change the story's link to the announcement on the Chromium blog? https://blog.chromium.org/2017/01/open-sourcing-chrome-on-ios.html https://blog.chromium.org/2017/01/open-sourcing-chrome-on-io...
- dang 10y agoYup. Url changed from https://techcrunch.com/2017/01/31/google-open-sources-chrome-for-ios/ https://techcrunch.com/2017/01/31/google-open-sources-chrome..., which points to this.
- v3n0m 10y agoTry
- v3n0m 10y agoTry2
- robgibbons 10y agoDoes this mean we could see mobile extensions in the future? Not being able to use plugins, userscripts, etc is one of my least favorite things about mobile.
- beached_whale 10y agoI wasn't sure if I read this correctly but does this mean if one compiles it themselves they can use blink on ios? That would be great for all those unsupported ipad 2's out there
- barronli 10y agoThe reason for Apple to lock the web browser engine is simple: it prevents you to turn an iphone into your bare platform, as much as you turned AT&T into a bare pipe. They know money comes from services not bare platform.
- foodstances 10y agoHow does Chrome or Firefox running on iOS, using WKWebView for its backend rather than their own rendering engines, in any way turn the iPhone into a "bare platform"? How would users even know or care that these 3rd party browsers are not using their own rendering engine?
- Vinnl 10y agoBecause all websites with cool features like working offline don't have those features on the iPhone. Or at least, I hope this will soon be the case. Sadly, it not working on the iPhone will probably mean it's often not worth investing into at all.
- debt 10y agoI stopped using Chrome because I didn't want everything I did on the web sent to them. Now that it's open source I'll probably never look at the code. So idk. Probably just gonna stick with Safari.
- deavmi 10y agoiOS is a dead. Crap platform.