lusteng / daily-notes Goto Github PK
View Code? Open in Web Editor NEW记录点日常的问题~~
记录点日常的问题~~
vue 可以通过对$route 对象的watch来监听路由对象的变化,但是react并没有对这块很好的封装,下面总结在平时的业务中使用的三种方法
this.props.history.listen(location => {
// 路由变化了,do something
});
window.addEventListener('hashchange', function(e){
console.log(e.oldURL, e.newURL);
})
上面废话那么多,也不浪费写的时间,直接引入正主,这位大哥内部集成了weinre,可以通过代理的方式拦截所有html自动注入weinre所需的js代码,相对weinre简便很多
1.操作简单
2.调试&抓包
3.支持HTTPS(手机安装证书,略麻烦)
4.混合app下只拦截webview发起的https请求。(最近混合app搞得少了,这块用的少)
全局安装
npm install spy-debugger -g //window
运行
spy-debugger
设置手机代理
网站证书安装不了?
1.生成证书
//生成本地证书
//生成目录 /Users/yourName/node-mitmproxy
spy-debugger initCA
2.安装证书
把node-mitmproxy文件夹下的 node-mitmproxy.ca.crt 传到手机上,点击安装即可。
IOS 打开Safari浏览器
3.iOS新安装的证书需要手动打开证书信任
(https://github.com/wuchangming/spy-debugger/issues/42)[https://github.com/wuchangming/spy-debugger/issues/42]
经历上面几步,就可以愉快的拿手机点开页面,然后直接pc上进行调试了。Of course, 你的手机和电脑必须处于同一网段
如果您有更好的真机调试方案,欢迎给我提issues,本人感激不尽~(虽然github写的少,推广更加米有,云笔记依赖症者,无奈(ノ﹏ヽ))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.