
Making Chrome better on iOS - raphaelcaixeta
http://raphaelcaixeta.com/blog/2012/07/09/making-chrome-better-on-ios/
======
Greenisus
I like the spirit of this idea, but I don't think the code is complete. I
installed Chrome but do _not_ want it to be my default browser. If apps
started doing this, I'd just uninstall Chrome. A better choice would be to
present a UIActionSheet asking the user which browser to use and then save
that preference to the app's Settings bundle with NSUserDefaults.

~~~
kennywinker
That sounds much better than just defaulting to chrome if available.

That said, this is a bit too much overhead for most developers to actually
implement. For instance, you would also need to create a settings bundle, so
users can reset this setting if they want.

What I'd really like to see is Apple enable this at a system level. FireFox
for iOS would be nice to see, and we don't want developers to have to revisit
this issue if/when it comes.

~~~
Greenisus
It sounds like a lot of overhead, but it's really quite simple. Objective-C is
a bit verbose for a Hacker News comment, so I put it up as a Github Gist:
<https://gist.github.com/3080870>

As for making a Settings bundle, that's pretty easy too and you wouldn't
_have_ to do it unless you wanted an easy way to let someone change their
preference later.

Besides all that, I think everyone agrees with you that Apple should make it
possible to do it at a system level. The simplest way to do this in my opinion
would be to allow users to remove pre-installed apps if there is an
alternative on the device. For instance, if I have an app that responds to
"<http://> URLs, allow Safari to be removed.

~~~
kennywinker
I guess my point was, without a settings option to re-set this, it's an
incomplete feature. It works for a very narrow scenario, but not for the vast
diversity of scenarios that the real world will bring. For instance, your code
has a fairly large bug... if the user sets chrome as the default, then at some
later point they delete chrome, it won't open urls anymore.

I would definitely encourage you to polish up that gist into some kind of
easily incorporated module (a category on UIApplication, perhaps?)... the more
people who start doing this sort of thing, the more pressure there will be on
Apple to enable this the "right" way.

~~~
Greenisus
Polishing it up as a category is a good idea; I might do that tomorrow. But
yeah, the point of all this is that you can't set a default browser in iOS.

------
travisjeffery
> Google Chrome is nothing more than a UIWebView skin on iOS

Mobile Chrome's networking stack is the same as Desktop Chrome, providing
SPDY, prefetching, etc.

~~~
igrigorik
"Chrome for iOS has some pretty major technical restrictions imposed by the
App Store, such as the requirement to use the built-in UIWebView for
rendering, no V8, and a single-process model. As a result it’s been
challenging to re-use critical Chromium infrastructure components.

That said, there is a lot of code we do leverage, such as the network layer,
the sync and bookmarks infrastructure, omnibox, metrics and crash reporting,
and a growing portion of content."

[https://groups.google.com/a/chromium.org/forum/?fromgroups#!...](https://groups.google.com/a/chromium.org/forum/?fromgroups#!topic/chromium-
dev/vYGxPx-tVKE)

~~~
statictype
Just wanted to say, great job on the Chrome app.

Only 2 things I don't like about it:

1) Getting at bookmarks requires too many clicks.

2) Sometimes my bookmarks get rearranged on the desktop after I use them in
iOS.

Otherwise, great job. Syncing my browser history/bookmarks/passwords is great.
And it feels more snappy than Safari, which I didn't think was even
technically possible.

------
mark_integerdsv
Cydia has a tweak to change your default browser. Sorted.

iOS Chrome has greater issues.

Tab management is all whizz bang but very unintuitive.

I have used it for about a day and can it fathom how to email a link to the
current page to someone.

Emailing a link to the current page is not a standard use case for desktop but
it is typical on mobile.

Further: it's hard to see where to arrest the loading of a page, the progress
thermometer 'blue zing' thing is very attractive but it doesnt allow any
interaction.

Somehow the load new incognito tab button is nearer my fingers than the load a
tab in background button. It's annoying that you'd assume I'm fapping.

I think the guys developing this app need to spend more time using other
mobile browsers to get a feel for the knds of things people want to do on
mobile... iOS Chrome feels like a desktop experience squeezed into 3.5 inches.

~~~
elithrar
In order to email the current page, or stop a page from loading, hit the menu
button to the right of the omnibar.

Email will be the 5th text row down.

Note that I do not think it is a side effect of desktop to mobile, but instead
their attempt to maximise the content area.

~~~
mark_integerdsv
After googling 'omnibar', I found the menu you speak of and I swear blind the
option to email the page is not there...

~~~
elithrar
> After googling 'omnibar', I found the menu you speak of and I swear blind
> the option to email the page is not there...

Hopefully you get this - see the areas marked in red on the attached
screenshot: <http://imgur.com/N2tL9>

------
delackner
Why not take this idea in a more comprehensive direction: a donation supported
site with API to register your app as consuming specific mime-types, so any
compliant app wanting a producer of emails for instance, could grab a list
from this site and then ask the user which they prefer, out of those apps they
have installed (since those apps would all phone home to the server and say
"user foo@bar.com has installed app Y on device with MAC ID M".

~~~
nicw
This is a start: <http://handleopenurl.com/scheme/> Register your URL scheme
there to avoid collisions and help garner support from those who want to
support your app.

------
beggi
I don't think this would make Chrome better but rather make every app that
uses this code pretty crummy. What would make Chrome (and iOS) better would be
Apple setting up some kind of default app system for links, mail, photo
editing etc. Out of very few things, Intent is something that Android still
has over iOS. Plus of course Chrome would be better with some Nitro on top :)

~~~
tomflack
How would it make it crummy?

~~~
kennywinker
I may have chrome installed, but not want it to be my default browser. That
is, in fact the case on my phone.

If apps started doing this, I suppose I could just delete chrome, but as with
my Mac, I like having a few different browsers installed.

~~~
ralfn
On your mac, Chrome is a browser with its own render engine, and javascript
engine. Thats not the case on iOS.

So, the only reaon to use Chrome on iOS, is because you like the interface
better. If not, why keep it installed?

------
saurik
If you are using a jailbroken device, there are a few extensions that can
provide this functionality. I believe the most comprehensive is by Ryan
Petrich.

[http://www.lifehacker.com.au/2012/07/make-chrome-your-
iphone...](http://www.lifehacker.com.au/2012/07/make-chrome-your-iphones-
default-browser/)

------
reidmain
"If a user has Chrome installed, chances are they wish that it would be their
default browser."

Horrible assumption. I am all for Apple stealing Android's intents. Assuming
that because the user has an app installed they want it to be the default is
wrong.

I think the better approach would be each app could ask the user once if they
want Google Chrome to be their default browser and then store which one they
should open. Sure it is more code but it will be a better user experience than
forcing them to uninstall Google Chrome if they don't want it.

~~~
draz
What's stopping the app creator from asking the user (in a settings" page)
which browser s/he wants to open web pages in? Default will be Safari, unless
changed explicitly

~~~
reidmain
Nothing. That is another totally viable alternative.

------
ricardobeat
I have Chrome installed but don't want it as a default, this would just annoy
the hell out of me.

~~~
crazygringo
Curious, why? You don't really need more than one browser on your phone. If
you installed Chrome and haven't deleted it, one can assume it's because the
person prefers Chrome. Otherwise you can just delete it after having tried it
out. Or am I missing something?

It can't really even be for testing, since on iOS it's not like it's possible
for Chrome to render any differently than in Safari!

~~~
ricardobeat
My iPad has lots of rarely-used apps in it, as do most of my friends'. I
haven't used Chrome enough to decide if I want to keep it or not, the mere
fact that it exists shouldn't indicate preference.

------
nathan_f77
This is one the many reasons why I would never buy another iPhone if it
couldn't be jailbroken. It seems weird that 'hacker news' readers aren't more
excited about 'hacking' the incredible computer in their pockets.

We don't need to beg developers to support Chrome if we can just change the
default browser ourselves - <http://i.imgur.com/f50Kxl.png>

Other reasons to jailbreak:

* Grooveshark - Seems to have a bigger music collection than Spotify, best $9 I spend each month.

* VLC media player

* SSH - how is that not useful?

* SBSettings

* 5 columns for Springboard icons

* Compiling and installing any open source iPhone apps

* Being able to write tweaks like this: [http://madebynathan.com/2010/12/26/ios-tweak-replace-operato...](http://madebynathan.com/2010/12/26/ios-tweak-replace-operator-with-current-prepaid-balance/)

------
clarky07
While this is an interesting idea, it is pretty useless in practice, IMO.
Email is by far the app I (and I assume most others) am going to be clicking
the most links from, and I'm gonna go out on a limb and say that Apple won't
be changing their links to go to chrome.

If you use something like the gmail app, they (if they don't already) should
probably be doing something like this.

~~~
rogerchucker
or sparrow

------
vitno
what chrome on iOS really needs is access to the JIT. Till then, it will be
much slower than safari...

~~~
mtgx
That's a bit of a stretch. You shouldn't notice that much of a performance
difference unless you go to the desktop version of Gizmodo or BusinessInsider.
Fortunately they already have mobile versions (at least Gizmodo does).

------
obtu
Good idea to come up with a minimal implementation of intents on the caller
side. Apple will probably block it if it threatens to become useful though,
because that would challenge iOS Safari.

------
Derbasti
I wish Apple would open up its system so the user can select her own default
programs. Oh my, daydreaming.

------
AshleysBrain
Just a heads up: the page doesn't scroll on android, so its impossible to read
the whole article.

------
drivebyacct2
Please Apple. I will downvote every person who whines about "stealing" if you
just hurry up and steal Android's Intents.

~~~
youngtaff
Yup it's a major missing element on iOS and many iOS supporters just don't
understand how great it really is...

~~~
jsight
I haven't used iOS, but as an Android user I can definitely see why they
haven't implemented it yet. It's a powerful feature, but at least on Android,
it's also a usability disaster.

Basically, the way it works on Android is that whenever an intent is passed
for which there is no default, the user gets a dialog. The dialog will contain
the applications that the user has installed for handling that intent. When
there are 4+ items (eg, PDF) this can be confusing.

Then when they pick one (hopefully the one they really wanted) they check the
box to make it default. So far this is confusing for some people, but they
generally muddle through somewhat happily.

But there are issues... which protocols does the browser accept? Oh, http,
https, and possible one or two more. So later they tap an https url and have
to go through the same process again.

The next day, one of their four web browsers auto-updates from the Play store.
This clears the defaults, and they have to go through the whole process again.

Seriously, the underlying concept seems solid, but the implementation is
severely lacking. I hope that they (or someone) does this right in the future.
I'm not entirely sure what a solid solution would look like, but I certainly
don't expect Apple to copy the Android approach. It's completely incompatible
with a number of their UX goals for the platform, IMO.

------
wavephorm
Is Chrome for iOS open source? Would there be a way to add V8 back in and
release it on Cydia? That may extend the lifespan of Apple products
indefinitely. My iPad 1 is already deemed obsolete by Apple and will never
receive another web browser update ever, which is obviously retarded. Apple
seriously needs to get that giant stick out of their ass.

~~~
saurik
a) AFAIK, no (as in, it is not open source). b) The change would not just be
to mess with the JavaScript engine: it would require totally replacing out the
UIWebView backend they are currently using from Apple and, well, pretty much
putting back Chrome. They are not rendering the HTML, Apple's UIWebView class
is; it would probably be easier to just attempt to recompile/replace
JavaScriptCore system wide to stub into v8. c) According to Apple (whom you
may or may not believe), v8 is not actually much faster (if not slower) than
Nitro right now, so you may as well just turn on Nitro in Chrome (which is
easy to do on a jailbroken device).

~~~
superasn
> so you may as well just turn on Nitro in Chrome (which is easy to do on a
> jailbroken device).

I know you may mean that it is easy to implement this but just checking if
there already exists something which can do this. I searched Google and Cydia
with no results. This definitely can be very very useful to a lot of people,
esp hackers.

~~~
saurik
I believe it is just a matter of adding the "dynamic-codesigning" entitlement.
I started typing up instructions for how to do it with a few shell commands,
but then I ran into a limitation with my ancient version of codesign_allocate
that caused me to fail. :( You should definitely be able to do it from a Mac
fairly easily, however.

~~~
lparry
I'd also love any pointers for how to do this; I've been checking cydia daily
waiting for a hack that does this

------
zbuc
First step to making it better might be fixing the awful scrolling. Chrome on
iOS is slick but it stutters like hell when scrolling large vertical pages.
Safari has no problem.

~~~
smackfu
May not even be fixable, if it's just calling out to an Apple webview
component.

