Chrome Dev Tools: How to trace network for a link that opens a new tab?

后端 未结 10 2048
我在风中等你
我在风中等你 2020-12-04 05:23

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 ope

10条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 05:40

    You can do it this way :

    1. set target="any_window_name" on wanted link.
    2. click on that link once, to open it in new tab.
    3. In opened tab, open developer tools.
    4. 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 : tag

提交回复
热议问题