
Open-sourcing Chrome on iOS - coloneltcb
https://blog.chromium.org/2017/01/open-sourcing-chrome-on-ios.html
======
evv
Its 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.

~~~
abalone
It's tempting to be cynical but there are good reasons for this. The main good
reason is power efficiency. As the seller of the device Apple is the chief
party held accountable for poor battery life. You or I or other technical folk
might point the finger at particular apps but the typical consumer will just
bemoan the "poor battery life on my phone". Apple takes ownership of that
outcome and if that means forcing it to be a priority for all browsers, so be
it. It's what lets them advertise the battery life for web browsing that they
do.

Additionally, I would like to challenge the unsupported notion that WebKit is
"stagnation of web browser tech". While there may be issues here and there, my
impression is that Apple is overall committed to pushing the envelope[1] and
adding compelling features.[2]

[1] [https://webkit.org/blog/7122/introducing-riptide-webkits-
ret...](https://webkit.org/blog/7122/introducing-riptide-webkits-retreating-
wavefront-concurrent-garbage-collector/)

[2]
[https://developer.apple.com/library/prerelease/content/relea...](https://developer.apple.com/library/prerelease/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_10_1.html)

~~~
irrational
Um, no. Just look at sites like caniuse.com and see how much farther ahead
Chrome and Firefox are than Safari iOS. Safari iOS has become this generations
IE 6. It is seriously holding back the web. And worst of all it really only
gets one update a year!

~~~
jalfresi
It's not holding back the web, settle down! It can still render websites
perfectly fine and will continue to do so.

Seriously, what horse are you backing where iOS Safari is compared to IE6?!?
What oh-so important feature you simply must-have, that would even begin to
signify that iOS Safari is "holding back the web"?

The web dev world is absolutely mental at the moment...

~~~
varenc
I'd pay top $$$ if someone could show me how to let a mobile Safari user
record audio on their microphone and submit it. iOS doesn't permit this in any
way, whether it be with getUserMedia or media capture forms. The only way to
do audio recording is to build an iOS app just so I can get this one simple
feature which is exactly what they want. Repeat this story for a dozen other
features as well.

Apple's total opaqueness on what their plans are for the future functionality
of their browser certainly doesn't help either.

~~~
jalfresi
Web pages that can access the microphone sounds like an absolutely insane idea
to me, but then like I said, web dev is absolutely mental at the moment...

get off my lawn etc.

~~~
Drakim
So Safari doesn't hold the web back like IE6, because the ways it's hold the
web back doesn't count because you don't want those features.

Not buying it.

~~~
jalfresi
I'm suggesting that the web is fine - its stupid nonsense like javascript
access to the microphone that gives the illusion that the web is moving
forward, and that some people are freaking out proclaiming the end of days
because some ridiculous feature hasn't been implemented.

~~~
manigandham
How is it ridiculous just because it's a feature you don't use?

There are plenty of uses for newer standards, that's why they're created, but
it only works if the browsers carry their weight and implement them
consistently. Safari doesnt, and is thus holding back the progress, just like
IE6+ did.

------
phs318u
There 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
I 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
Because 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?

~~~
Sir_Cmpwn
s/.*/Because it's sexy and trendy above anything else/g

~~~
azinman2
You say that as if that's some easy, cheap thing to achieve. Those words are
also not concrete at all as to what they mean, exactly. All of these things
are designed with purpose and are extremely difficult.

~~~
Sir_Cmpwn
>You say that as if that's some easy, cheap thing to achieve.

No, I don't. I say it as if there are more important things to consider in the
products you buy.

~~~
azinman2
Maybe for YOU, but considering Apple just posted their most revenue ever last
quarter, there are billions of reasons to disagree.

(Their products are also not _just_ sexy/trendy, clearly. They basically
invented this entire category of modern smartphone despite many previous
attempts by others.)

~~~
Sir_Cmpwn
Logical fallacy. Just because a product is successful doesn't make it the best
product - in fact I'd wager that it isn't more often than not.

~~~
azinman2
The question wasn't "what's the best product," it was "Why do so many prefer
the walled garden?"

~~~
NTripleOne
Because to the average, non-technically minded user, they bought the phone for
the logo on the back.

Sadly, average, non-technically minded users make up a large proportion of the
global populace.

------
wadetandy
My 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?

~~~
zwily
You'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.

~~~
eslaught
> 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.

~~~
bzbarsky
You're not allowed to ship a interpreter that interprets code that doesn't
come from insider your app.

So you can maybe ship Gecko + SpiderMonkey, as long as you only run JS that's
part of your app. But if you want to run JS from a website (or indeed any code
from anywhere), you're not allowed to do that on iOS.

I haven't checked whether it would be OK to ship a browser engine that doesn't
support JS at all, but that's a fairly academic question anyway.

~~~
st3fan
> You're not allowed to ship a interpreter that interprets code that doesn't
> come from insider your app.

That is not true. Many apps do this. Games have been doing this for a decade.
It is not a problem to do this. Apple has never made a big deal of that. Only
if you are trying to build a shadow app store.

~~~
wvenable
Games interpret code that's shipped with the app. You cannot create an app
which downloads code off the Internet (for example) and executes it.

~~~
solidr53
not true, checkout codepush from microsoft which enables OTA updates for
cordova, react native, etc.

~~~
ec109685
Yeah, because JavaScript is exempted from their rules.

~~~
bzbarsky
JavaScript in general, or JavaScript only if it's run via Apple's
JavaScriptCore?

~~~
wvenable
JavaScript only if it's run via Apple's JavaScriptCore.

Pebble used this quite effectively to add phone-side apps to their product.

------
DonHopkins
How 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.

~~~
jmascart
> How much is there even left for Chrome to do

Looking at
[https://chromium.googlesource.com/chromium/src.git/+/master/...](https://chromium.googlesource.com/chromium/src.git/+/master/ios/chrome/browser/)
there is:

autocomplete, autofill, content settings, content suggestions, crash
reporting, desktop promotion, device sharing, dom distiller, favicon, find in
page, first run, geolocation, history, infobars, metrics, open from clipboard,
passwords, payments, physical web, prefs, reading list, search engines, share
extension, signin, ssl, suggestions, sync, translate, voice

~~~
mmphosis
Many of the things that I want removed from Chromium / Chrome.

~~~
eriknstr
Well now that it's open source you could in theory remove the things you don't
want and keep only the good parts. In practice it's not realistic for a single
person to do it and even if it was you'd still have to maintain it.

------
jmascart
Why 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
How 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.

~~~
WildUtah
Of 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.

~~~
igravious
Wow. I never knew that Reddit was open sauce:
[https://github.com/reddit/reddit](https://github.com/reddit/reddit) That's an
eye-opener! I always assumed Wikia was Mediawiki powered but apparently nope:
[https://github.com/Wikia](https://github.com/Wikia) I guess it's a separate
entity to Wikipedia. Twitch don't appear to be open source but they do promote
open source clients?
[https://www.twitch.tv/broadcast](https://www.twitch.tv/broadcast)

~~~
ihuman
IIRC not all of reddit is open source. The code that is in charge of vote
fuzzing/scoring and spam is closed source.

------
tyingq
Would 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?

~~~
gcp
You 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
Not 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
It'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
Why 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?

~~~
ash_gti
Are you referring to the `-[WKWebView navigationDelegate]`?

Thats only used for user initiated navigation, not loading of assets.

You could still inject a JavaScript file or CSS file though to help hide
pieces of the view. But that would be content blocking after the HTTP requests
have been made.

I don’t know of a way to intercept the HTTP requests as they’re being made
from a WKWebView like Safari does for content blocking.

~~~
solidr53
Could attach a service worker if it can load before the assets. I know safari
has this under consideration, but it's a w3 standard now anyway.

~~~
ash_gti
Isn’t it still a working draft?

~~~
solidr53
you're right, too soon.

------
beached_whale
I 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
The 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
How 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
Because 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
I 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.

------
robgibbons
Does 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.

------
frakkingcylons
Can we change the story's link to the announcement on the Chromium blog?

[https://blog.chromium.org/2017/01/open-sourcing-chrome-on-
io...](https://blog.chromium.org/2017/01/open-sourcing-chrome-on-ios.html)

~~~
dang
Yup. Url changed from [https://techcrunch.com/2017/01/31/google-open-sources-
chrome...](https://techcrunch.com/2017/01/31/google-open-sources-chrome-for-
ios/), which points to this.

