如何在服务器到达浏览器之前编辑服务器发送的js文件?

问题描述:

在正常浏览会话期间,我想在浏览器收到之前编辑特定的javascript文件,因为一旦它到达那里就无法编辑。这有什么工具吗?对于我需要它,我不能只保存它并在我的磁盘上编辑它。

During a normal browsing session I want to edit a specific javascript file before the browser receives since once it gets there it's impossible to edit. Is there are any tool for this? For what I need it I can't just save it and edit it on my disk.

我已经准备好学习如何自己编程但是如果有人可以点或多或少我要做的事我会非常感激。我必须拦截数据包,直到我拥有整个文件,同时阻止浏览器接收它的任何部分,然后手动编辑它并将其转发到同一个端口。

I'm ready to learn how to program it myself but if anyone can point out more or less what I have to do I'd be very grateful. I'd have to intercept the packets until I have the whole file while blocking the browser from receiving it any part of it, then edit it manually and forward it to the same port.

我不认为我可以通过使用pcap来做到这一点,我读过一些关于scapy但我不确定它是否也可以帮助我。

I don't think I can do this by just using pcap, I've read a bit about scapy but I'm not sure if it can help me either.

提前致谢。

如果您愿意,而不是编辑文件,用本地文件替换它,然后我会*使用 Charles 及其Map To本地功能。

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.


  • 实际上,确实。这帮我调试了浏览器和我昨天无法编辑的JS文件的问题。