Arun Stephens

Samsung S4 browser slow with bad performance? Force Chrome on Android!

The stock browser on the Samsung Galaxy S4 (launched with the “Internet” icon) has notoriously poor performance, particularly with JavaScript. In my particular case, I was trying to run an animation created in Adobe Edge. Chrome, on the same device, however, was flawless. Why the new Samsung browser is worse than the old one from the S-III is a topic for another conversation – one that I am never going to have now that I have found this solution.

Chrome is preinstalled on Samsung Galaxy S4 devices (that are sold in the UK, at least). What you’d love to be able to do is force the system to start Chrome. This is possible!

The Chrome for Android documentation suggests that you can start an Android Intent using a specially formulated URL. Intents are the way that Android apps launch other activities and services. The Samsung browser also supports this URL scheme functionality.

Part of intent is that you can specify the package name that the intent should be sent to. For Chrome this is com.android.chrome.

So, to open this page in Chrome:

intent://arunstephens.com/2013/12/06/samsung-s4-browser-slow-bad-performance-force-chrome-android#Intent;scheme=http;package=com.android.chrome;end

Add some user agent detection (here, in PHP) and you’ve got yourself a winner:

$s4BadBrowserRegex = '/SAMSUNG GT-I9505/'; $userAgent = $SERVER['HTTPUSERAGENT']; if (pregmatch($s4BadBrowserRegex, $userAgent)) { header("Location: intent://arunstephens.com/2013/12/06/samsung-s4-browser-slow-bad-performance-force-chrome-android#Intent;scheme=http;package=com.android.chrome;end"); return; }

Key to this is that in the URL you should replace http with intent, the append the rest after the hash. Presumably (but I haven’t tested this), if the original URL scheme was https, you should modify the scheme=http part of it accordingly.

I hope this helps someone!