JavaScript - access network tab via JavaScript [duplicate]

柔情痞子 提交于 2021-02-07 19:41:50

问题


I need to access the (for example) Chrome Developer Tools network tab with JavaScript. I only need

1.) Source Name (column 1) and
2.) Type (column 3)

But I have absolutely no idea how to do this.

Links are very apprecciated!

Thanks in advance!


回答1:


I've made some research, but it seems like you can't do it, you can't access the devtools directly from js, but from what I have read you could use console.profile() as follow:

console.profile()
console.profileEnd()

But it seems it does not return the value of the profile, its accessible from the devTools... not ideal...

But you could use PhantomJS or something similar, dont know if would accomplish wwat you are after...

Or check this google group discussion about the topic:

  • Programmatic access to network panel entries through console / javascript


来源:https://stackoverflow.com/questions/50571529/javascript-access-network-tab-via-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!