問題描述
我需要在任何事件(如按鈕單擊或使用時間間隔)上使用 jquery 清除網絡選項卡中的 ajax 請求.這可能嗎?
I need to clear the ajax requests from network tab using jquery on any event like button click or using time interval. Is this possible?
推薦答案
如果你的意思是瀏覽器開發工具中的網絡選項卡,那么不,你無法通過 Javascript 控制它.開發工具是瀏覽器的一部分,而不是網頁的一部分,因此 Javascript 對它們一無所知.
If you mean the network tab in the browser's dev tools, then no, you cannot control it from Javascript. The dev tools are part of the browser and not part of the webpage, so Javascript has no knowledge of them.
這與您的問題沒有直接關系,但這證明您想要做的事情是非常不可能的:
This isn't directly related to your question, but this is evidence that the kind of thing you're looking to do would be very much not possible:
我們只允許顯式打開開發工具.
We only allow explicit devtools opening.
https://bugs.chromium.org/p/chromium/問題/詳細信息?id=112277
這篇關于如何使用 jquery 從網絡選項卡中清除 ajax 請求?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!