How can I edit a js file sent by the server before it gets to my browser?

*爱你&永不变心* 提交于 2019-12-06 11:07:41

If you are happy to, rather then editing a file, replace it with a local one, then I would* use Charles and its Map To Local function.

  • Actually, "did". This helped me debug a problem with a browser and a JS file I couldn't edit yesterday.

You'd need to implement some sort of proxy, or hook into an existing one, and intercept the file as it's being downloaded and replace it.

Not trivial for a beginner, but a good learning project.

You can probably achieve whatever it is you are wanting to do by using the firefox firebug plugin, chrome's development tools or the firefox greasemonkey plugin.

Or you could enter the files domain into your hosts file and point that domain to your local machine (running a web server), edit & save that javascript file locally and serve it from your own web server.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!