我想跟踪单击链接时发生的网络活动。问题是这个链接打开了一个新标签,显然开发工具在每个打开的标签上都能工作。“在导航时保存日志”没有帮助。

我目前的解决方案是移动到FireFox和HttpFox没有这个问题。我想知道Chrome的开发人员是如何管理的,这听起来相当基本(当然我已经搜索了答案,没有找到任何有用的东西)。


检查chrome://net-internals/#events(或chrome://net-export在最新版本的chrome)的所有网络事件发生在你的浏览器的详细概述。


其他可能的解决方案,取决于你的具体问题,可能是在“网络”选项卡上启用“保存日志”:

并通过在控制台中执行以下代码强制所有链接在同一个选项卡中打开:

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

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

如果打开的链接没有重定向,您可以在新选项卡中打开Network选项卡,然后刷新该选项卡。

你可以这样做:

set target="any_window_name" on wanted link. click on that link once, to open it in new tab. In opened tab, open developer tools. go back to origin page and hit that link again. The result will be loaded in already prepared window with developer tools opened. You can activate "preserve log" option in dev tools (see in Konrad Dzwinel excellent answer) to catch any redirect traffic on that link. Note : most people familiar with link target ∈ { _self,_blank,_parent,_top }. But actually any name can be given, this will open a new window with that name, and any subsequent clicks on links,forms or window.open with same target value will be opened in same window. further reading - mdn : window.open , mdn : <a> tag

添加/更新target="_self"的链接 在“网络”页签中选择“导航时保留日志”。 单击链接并记录您的请求

当新标签打开时,快速按F12

https://stackoverflow.com/a/13747562/660408

当我监视谷歌驱动器下载响应时,为我工作

phsource注释中提到的功能请求已经实现。

在最近的版本中(从Chrome 50开始),你可以去开发人员工具设置菜单(打开开发人员工具,然后使用3点菜单或点击F1),并选中“自动打开弹出的开发工具”。

在Chrome 61.0.3163.100,你现在有以下选项可用。 它是通过去Chrome开发工具设置访问。它在底部。

免责声明:由HttpWatch的开发者发布

Windows上的HttpWatch可以通过在“工具->选项->录音”中启用自动录音功能来记录新Chrome选项卡或窗口打开时产生的网络流量。在新窗口中单击HttpWatch图标以查看网络跟踪。

免费版将为每个请求提供URL、状态码和运行时间等基本信息。

免责声明:由HttpWatch的开发者发布

在Chrome 85中(在Chrome 100中仍然有效)“自动打开弹出式开发工具”被隐藏在一个新的地方

DevTools (F12)/Settings (F1, Ctrl + ?)/Preferences/Global(在列表的末尾)

现在它保留了“保存日志”的设置。