I’m using chrome devtools network API and the following code but always the alert window is launch when I opened the devtool windows (F12). Is there any way to launch the alert just without open that window, for example, when the page load?
background
chrome.experimental.devtools.network.getHAR(
function(result) {
alert(result);
});
If the web inspector isn’t open, the devtools APIs are non-functional. This is the same reason that, for example, network events don’t show up in the web inspector if it isn’t open when you initially load the page.
You are able, however, to use the WebRequest APIs from extensions regardless of the web inspector’s state. That won’t give you HAR formatted data, but it does give you access to every request generated for a page. That might be a reasonable option for you, depending on what information you’re looking for.