Send Current Webpage to Chrome from Safari in iOS with a Bookmarklet
The recently released Chrome browser for iOS is pretty good, and even if it’s not replacing Safari as your primary web browser on an iPhone or iPad quite yet, you may still find this bookmarklet handy which lets you instantly send the currently active web page from Safari into Chrome:
- From the iOS device, launch Safari and copy the following line javascript code:
- Bookmark this webpage (or any other) by tapping the Arrow and selecting “Add Bookmark”
- Open Safari Bookmarks and tap “Edit” and then tap to edit the newly created bookmark
- Rename it to “Send to Chrome” and hit the ‘x’ alongside the URL, then tap and hold to paste in the javascript code copied above
- Test it out by opening the bookmarks bar and selecting “Send to Chrome”
javascript:location.href="googlechrome"+location.href.substring(4);
Safari switches and Google Chrome launches with a new browser tab containing the URL you activated the bookmarklet from. If you have any issues with this not working, check how the quotations are handled when editing the bookmarklet in iOS Safari. You may need to replace each ” with %22 instead, which would look like this:
javascript:location.href=%22googlechrome%22+location.href.substring(4);
Another variation is to use this javascript snippet, which apparently works better with https URLs:
javascript:location=location.href.replace(/^https?/, 'googlechrome');
Both variations worked fine in our testing, so go with what works for you. This is a great tweak for web developers and designers who need to perform browser compatibility tests on as many different browsers as possible.
Bookmarklets are a fairly popular way to add functionality to Safari that otherwise is impossible, allowing you to do things like “View Source” from Safari in iOS, adjust font sizes of web pages, and even run Firebug lite in iOS. This particular one has circled around the web recently but originates from jonabrams.com.
Ive been finding chrome faster than safari. I wish there was a way to make it the default.
I start use chrome but nothing better than Safari, very slow to render web pages! There’s a lot o work to do on iOS Chrome.
I could imagine this being useful for webdevs worried about compliance, but I just don’t find Chrome to be useful enough to become my browser of choice for iPad. I use it on the desktop, but it will be a revision or two before Google gets the iOS version sufficiently speedy to make it worthwhile. Also, has anyone else noticed some of the assets are fit for the iPad 3 retina display yet?