检测来自原始HTML的ajax请求 [英] Detect ajax requests from raw HTML
本文介绍了检测来自原始HTML的ajax请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果你得到一个页面的初始HTML,你能检测到后续的ajax请求吗?
If you get a page's initial HTML, can you detect subsequent ajax requests?
您可以在开发者控制台中以编程方式进行操作。已广泛搜索解决方案,但未找到解决方案。
Much like you can in the Developer Console, but programmatically. Have searched extensively for a solution but found none.
推荐答案
您可以使用 PerformanceObserver
, entryType
设置为resource
function perf_observer(list, observer) {
// Process the "resource" event
}
var observer2 = new PerformanceObserver(perf_observer);
observer2.observe({entryTypes: ["resource"]});
参见
处理<?xml-样式表>类似于< link rel =" stylesheet">?
这篇关于检测来自原始HTML的ajax请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文