捕获的JavaScript的HTTP请求 [英] Capture HTTP requests with Javascript
问题描述
是否有可能用JavaScript来监听并捕获传出HTTP请求? (例如,AJAX调用)。有点像萤火虫等
is it possible with javascript to listen for and capture outgoing HTTP requests? (For example, AJAX calls). Sort of like firebug, etc
推荐答案
当然,你可以跟踪你自己的网页AJAX请求。做一个包装的XMLHtt prequest构造,记录你感兴趣的信息。
Sure, you can trace AJAX requests on your own pages. Make a wrapper for the XMLHttpRequest constructor that records the information you're interested in.
编辑:一个扩展可以让你观察到的内部浏览器操作。例如,你可以看到<一href="http://$c$c.google.com/p/fbug/source/browse/branches/firebug1.7/modules/firebug-http-observer.js?r=HEAD#77"相对=nofollow> Firebug的来源的,它遵守所有的Firefox的 HTTP的话题。这些是的http上 - 修改 - 请求,HTTP上审查响应,和HTTP上审视缓存响应。
An extension lets you observe internal browser operations. For example, you can see in Firebug's source that it observes all of Firefox's HTTP topics. These are "http-on-modify-request", "http-on-examine-response", and "http-on-examine-cached-response."
这篇关于捕获的JavaScript的HTTP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!