Created
January 13, 2016 13:03
-
-
Save peponi/bd45120c836c835c0634 to your computer and use it in GitHub Desktop.
detect android stock browser. Adds class "is-android-stock-browser" to the html element.
You will need this only in rare cases.
For example: text-rendering bug with webfonts in Android 4.x.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
/* | |
Use this only if really really necessary. | |
This plugin tries to detect android stock browser. | |
Place it in the head tag. And after Modernizr. | |
https://developer.chrome.com/multidevice/user-agent#webview_user_agent | |
*/ | |
var ua = navigator.userAgent, | |
reg = /(Version\/\d\.\d)/i; | |
if(ua.indexOf('Android') > -1 && ua.match(reg) !== null){ | |
// you're most likely on a android stock browser | |
document.documentElement.className += ' is-android-stock-browser'; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment