I've been trying to create a google chrome extension which could show (on page) the number of pending and errored requests made. I originally was looking into the chrome.devtools.network API however that's only available within the devtools window itself.Also was looking at the webRequest API but have been failing to get that working.

I am currently looking into monkeypatching XMLHttpRequest but when I try I just get an 'Illegal Invocation' error.Example of what I'm trying to do below: