Though both are Webkit based browsers, Safari urlencodes quotation marks in the URL while Chrome does not.
Therefore I need to distinguish between these two in JS.
jQuery's browser detection docs mark "safari" as deprecated.
Is there a better method or do I just stick with the deprecated value for now?
The following identifies Safari 3.0+ and distinguishes it from Chrome:
A very useful way to fix this is to detect the browsers webkit version and check if it is at least the one we need, else do something else.
Using jQuery it goes like this:
This provides a safe and permanent fix for dealing with problems with browser's different webkit implementations.
Happy coding!
unfortunately the above examples will also detect android's default browser as Safari, which it is not. I used
navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 && navigator.userAgent.indexOf('Android') == -1
Generic FUNCTION
Apparently the only reliable and accepted solution would be to do feature detection like this:
The only way I found is check if navigator.userAgent contains iPhone or iPad word