Created
February 12, 2015 08:34
-
-
Save naoyeye/92c61ac33ef238c78756 to your computer and use it in GitHub Desktop.
判断是不是在淘宝中、是不是在虾米中、是不是在微博中、是不是在微信中
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
| var j = window.navigator.userAgent; | |
| var g = { | |
| android: j.match(/(Android);?[\s\/]+([\d.]+)?/), | |
| iphone: j.match(/(iPhone\sOS)\s([\d_]+)/) | |
| }; | |
| var d = { | |
| aliapp: j.match(/\AliApp\(([^\/]+)\/([\d\.\w]+)\)/), | |
| xiami: j.match(/(AliApp)\((XM)\/([0-9.]+)\)*/), | |
| weibo: j.match(/.*?(weibo\_\_([0-9.]+))\s*/), | |
| weixin: j.match(/.*?(MicroMessenger\/([0-9.]+))\s*/) | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment