add:whistle抓包手机端、UserAgent
This commit is contained in:
parent
8158a719e7
commit
a01c37d552
19
00-前端工具/whistle网络抓包.md
Normal file
19
00-前端工具/whistle网络抓包.md
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
## 手机设置代理
|
||||
|
||||
连接好指定的wifi后,点击那个wifi里的设置,将「代理」那一项,设置为手动,然后输入ip(电脑上的ip)、端口号(8899)。然后就可以通过电脑上的whistle工具,查看手机的网页请求。
|
||||
|
||||
注意,要保证手机和电脑在同一个网络下。
|
||||
|
||||
参考链接:
|
||||
|
||||
- [Android 手机如何设置http代理?](https://www.zhihu.com/question/21474174)
|
||||
|
||||
- [使用 Whistle 对 iOS HTTPS 进行抓包](http://zhuscat.com/2017/09/20/https-proxy-on-ios/)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
62
20-前端综合/UserAgent.md
Normal file
62
20-前端综合/UserAgent.md
Normal file
@ -0,0 +1,62 @@
|
||||
|
||||
|
||||
## 前言
|
||||
|
||||
|
||||
我们知道,在控制台里可以添加很多设备。我们需要点击 edit,手动添加:
|
||||
|
||||
img
|
||||
|
||||
添加时,是根据 User agent 来识别的:
|
||||
|
||||
img
|
||||
|
||||
不同浏览器(包括微信内置的浏览器)的 useragent 信息,是不一样的,我们可以根据 `navigator.userAgent`属性来获取。
|
||||
|
||||
比如说,我们在控制台输入`navigator.userAgent`,如下:
|
||||
|
||||
|
||||
20180425_1656.png
|
||||
|
||||
上图显示,MacOS上的Chrome浏览器的 UserAgent 是:
|
||||
|
||||
```
|
||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36"
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 不同浏览器的 UserAgent
|
||||
|
||||
iPhone版微信:
|
||||
|
||||
```
|
||||
Mozilla/5.0 (iPhone; CPU iPhone OS 9_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13E233 MicroMessenger/6.3.15 NetType/WIFI Language/zh_CN
|
||||
```
|
||||
|
||||
Android版微信:
|
||||
|
||||
```
|
||||
Mozilla/5.0 (Linux; Android 5.0.1; GT-I9502 Build/LRX22C; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36 MicroMessenger/6.1.0.78_r1129455.543 NetType/WIFI
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Android版微信:
|
||||
|
||||
```
|
||||
Mozilla/5.0 (Linux; Android 5.0.1; GT-I9502 Build/LRX22C; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36 MicroMessenger/6.1.0.78_r1129455.543 NetType/WIFI
|
||||
```
|
||||
|
||||
## 参考链接
|
||||
|
||||
- [判断微信内置浏览器的UserAgent](http://www.cnblogs.com/7z7chn/p/5370352.html)
|
||||
|
||||
- [微信内置浏览器UserAgent的判断](https://gist.github.com/wjp2013/fff34c063cf0cf227d65)
|
||||
|
||||
|
||||
|
@ -47,6 +47,8 @@
|
||||
|
||||
上方代码中,绿框部分的内容,就是我想定义的整个组件。
|
||||
|
||||
在注册组件时,第一个参数是标签名,第二个参数是组件的定义。
|
||||
|
||||
运行结果如下:
|
||||
|
||||
![](http://img.smyhvae.com/20180422_2230.png)
|
||||
|
Loading…
Reference in New Issue
Block a user