I'm working on a chrome extension Manifest.json:
{
"name": "Managebac Grade Calculator",
"version": "1.2",
"manifest_version": 2,
"content_scripts": [
{
"matches": [
"https://opengate.managebac.com/student/*"
],
"js": [
"jquery.js",
"content.js"
]
}
],
"permissions": [
"storage",
"<all_urls>",
"webRequest"
],
"icons": {
"16": "pfp.jpg",
"48": "pfp.jpg",
"128": "pfp.jpg"
},
"browser_action": {
"default_icon": "pfp.jpg",
"default_popup": "popup.html"
}
}
content.js:
chrome.webRequest.onSendHeaders.addListener(function(details){
console.log(details)
},{
urls:["<all_urls>"],
types: ["xmlhttprequests"]
},["requestHeaders"])
But for some reason it doesn't work, it throws me this error:
Uncaught TypeError: Cannot read properties of undefined (reading 'onSendHeaders')
at content.js:1
I think its something very dumb with permission but I have no idea what, please help