Created
June 13, 2014 14:48
-
-
Save reyramos/65b8ad1d05eb476d41f7 to your computer and use it in GitHub Desktop.
script to detect IOS devices to run jsconsole, BECAREFUL
do not load this on production
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(window){ | |
| var key = "ee0256032e288b780f41513765b59254"; | |
| var ua = window.navigator ? window.navigator.userAgent : | |
| window.request ? window.request.headers['user-agent'] : 'No User Agent' | |
| var isMobile = { | |
| Android: function () { | |
| return ua.match(/Android/i); | |
| } | |
| , iOS: function () { | |
| return ua.match(/iPhone|iPad|iPod/i); | |
| } | |
| }; | |
| if(isMobile.iOS()){ | |
| var jc = document.createElement('script'); jc.type = 'text/javascript'; jc.async = true; | |
| jc.src = 'http://jsconsole.com/remote.js?'+key; | |
| var s = document.getElementsByTagName('script')[0]; | |
| s.parentNode.insertBefore(jc, s); | |
| } | |
| })(window) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment