File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 2929 return theRequest ;
3030 } ;
3131
32- var base = new Base ( ) ;
32+ Base . prototype . checkPlatforms = function ( ) {
33+ var u = navigator . userAgent , app = navigator . appVersion ;
34+ return {
35+ trident : u . indexOf ( 'Trident' ) > - 1 , //IE内核
36+ presto : u . indexOf ( 'Presto' ) > - 1 , //opera内核
37+ webKit : u . indexOf ( 'AppleWebKit' ) > - 1 , //苹果、谷歌内核
38+ gecko : u . indexOf ( 'Gecko' ) > - 1 && u . indexOf ( 'KHTML' ) == - 1 , //火狐内核
39+ mobile : ! ! u . match ( / A p p l e W e b K i t .* M o b i l e .* / ) , //是否为移动终端
40+ ios : ! ! u . match ( / \( i [ ^ ; ] + ; ( U ; ) ? C P U .+ M a c O S X / ) , //ios终端
41+ android : u . indexOf ( 'Android' ) > - 1 || u . indexOf ( 'Linux' ) > - 1 , //android终端或者uc浏览器
42+ iPhone : u . indexOf ( 'iPhone' ) > - 1 , //是否为iPhone或者QQHD浏览器
43+ iPad : u . indexOf ( 'iPad' ) > - 1 , //是否iPad
44+ webApp : u . indexOf ( 'Safari' ) == - 1 , //是否web应该程序,没有头部与底部
45+ weixin : u . indexOf ( 'MicroMessenger' ) > - 1 , //是否微信 (2015-01-22新增)
46+ qq : u . match ( / \s Q Q / i) == " qq" //是否QQ
47+ } ;
48+ } ;
49+
50+ var basefn = new Base ( ) ;
3351
34- window . base = base ;
52+ window . basefn = basefn ;
3553
3654} ) ( window , document ) ;
3755
3856if ( typeof module !== 'undefined' ) {
39- module . exports = window . base ;
57+ module . exports = window . basefn ;
4058} else if ( typeof define === 'function' && define . amd ) {
4159 define ( [ ] , function ( ) {
4260 'use strict' ;
43- return window . base ;
61+ return window . basefn ;
4462 } ) ;
4563}
You can’t perform that action at this time.
0 commit comments