-
-
Save cary929/b2bc9bc8e45fe150658828e971a62a22 to your computer and use it in GitHub Desktop.
Revisions
-
loo2k renamed this gist
Oct 10, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
loo2k revised this gist
Oct 10, 2014 . No changes.There are no files selected for viewing
-
loo2k created this gist
Oct 10, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ // 使用 userAgent 判断是否微信内置浏览器 // 不推荐使用 用户可能会自行修改浏览器的 userAgent if( navigator.userAgent.toLowerCase().indexOf('micromessenger') > -1 || typeof navgator.wxuserAgent !== "undefined" ) { return true; } // 使用微信 JS 对象判断是否微信内置浏览器 // 建议使用此方法进行判断 if( typeof WeixinJSBridge !== "undefined" ) { return true; }