问题
I want to create a snippet of code that display the list of all files loaded and shown in the network tab of chrome devtools.
Load a page in chrome, press CTRL+SHIFT+I, click network tab, press CTRL+SHIFT+I again to debug the debugger. There's an array called _nodesByRequestId in network_module.js. You can put some breakpoints, refresh the first page so code will halt on them, and then type this._nodesByRequestId to see its content. It works because the debugger is halted in local scope.
How can I check if there is a way to display this array in console without using breakpoint ? Some kind of path to the var from global scope (sub object of window object or static WebInspector class or anything).
For info, here is a snippet that display the list of url
for (var [key, val] of this._nodesByRequestId) {
console.log(val._request._url);
}
来源:https://stackoverflow.com/questions/39392729/how-to-get-access-to-the-list-of-files-of-the-network-tab-in-chrome-devtools