Chrome开发工具:如何跟踪打开新选项卡的链接的网络? [英] Chrome Dev Tools: How to trace network for a link that opens a new tab?

查看:718
本文介绍了Chrome开发工具:如何跟踪打开新选项卡的链接的网络?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想跟踪点击链接时发生的网络活动。问题在于链接打开了一个新选项卡,显然开发工具是针对每个标签打开的。 保留导航日志不起作用。



我现在的解决方案是转移到FireFox和HttpFox,这个问题没有。我想知道所有的Chrome开发人员如何管理,这听起来很基本(当然,我已经寻找答案,没有发现任何有用的东西)。

方案

查看 chrome:// net-internals /#events ,详细了解浏览器中发生的所有网络事件。




根据您的具体问题,其他可能的解决方案可能是在网络选项卡上启用保留日志 :



通过在控制台中执行以下代码,强制所有链接在同一个标​​签中打开:



<$ p $如果(link.attributes.target){
($),
函数(链接){
} [for $ c.call(document.querySelectorAll('a'),
function link.attributes.target.value ='_self';
}
});

window.open =函数(url){
location.href = url;
};


I want to trace the network activity that happens when I click on a link. The problem is that the link opens a new tab, and apparently the Dev Tools works per tab it was open for. "Preserve Log Upon Navigation" does not help.

My current solution is to move to FireFox and HttpFox which does not have this issue. I wonder how all the developers for Chrome manage, this sounds pretty basic (of course I've searched for the answer, didn't find anything helpful).

解决方案

Check out chrome://net-internals/#events for a detailed overview of all network events happening in your browser.


Other possible solution, depending on your specific problem, may be to enable 'Preserve log' on the 'Network' tab:

and force all links to open in the same tab by executing the following code in the console:

[].forEach.call(document.querySelectorAll('a'),
    function(link){
        if(link.attributes.target) {
            link.attributes.target.value = '_self';
        }
    });

window.open = function(url) {
    location.href = url;
};

这篇关于Chrome开发工具:如何跟踪打开新选项卡的链接的网络?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆