I'm working on a devtool Chrome extension and would like to log all XHR request of the current website. So in my injected script ea "messageback-script"
I have this:
(function(open) {
XMLHttpRequest.prototype.open = function(method, url, async) {
console.log('The URL is: ' + url);
};
})(XMLHttpRequest.prototype.open);
And I have given required permissions in the manifest.json
:
{
"name": "DevToolsPanel",
"version": "0.1",
"description": "Log XHR requests",
"devtools_page": "devtools.html",
"background": {
"scripts": [
"background.js"
]
},
"permissions": [
"tabs",
"http://*/*",
"https://*/*"
],
"manifest_version": 2
}
The problem is that I don't see anything in the console log (blank). What am I doing wrong?