All Projects → huanz → JSSDK

huanz / JSSDK

Licence: other
微信JS-SDK分析

Programming Languages

javascript
184084 projects - #8 most used programming language

JSSDK

微信JS-SDK分析

微信JS-SDK分为两部分,一部分是暴露给用户的接口wx,即jweixin-1.2.0.js,是对底层接口WeixinJSBridge的封装,需要用户自己引入,有完善的接口文档:微信JS-SDK说明文档;一部分是直接注入到微信webview的,用户是没办法直接看到源代码的,我下载了微信官方提供的最新安卓版本:weixin658android1060.apk,修改为.zip解压在assets/jsapi/发现了其注入的wx.js文件。下面就这两个js进行分析,剖析微信JS-SDK的技术细节。

流程

wx.js

  • polyfills: trimreduce
  • window._WXJS:zeptojs->event、detect、fx、ajax、form、touch(wx-swipewx-swipeLeftwx-swipeRightwx-swipeUpwx-swipeDownwx-doubleTapwx-tap、wx-singleTapwx-longTap)
  • WeixinJSBridgeinvoke(call)、onenvlog_fetchQueue_continueSetResult_handleMessageFromWeixin

jweixin.js

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].