We are using chrome webrequest API to intercept and modify headers on request.
I was working fine until Chrome 72, but it's not working anymore. But when I replacing the permission with "<all_urls>"
that's work.
Also, I tried with another domain, Google, like this example : https://developer.chrome.com/extensions/webRequest and that not working too.
Did you have any idea about why that not working anymore ?
We will use "<all_urls>"
for the moment but it's a huge permission that we do not really need.
manifest.json :
"permissions": [
"webRequest",
"webRequestBlocking",
"*://*.merchantos.com/*"
]
background.js
chrome.webRequest.onHeadersReceived.addListener(
details => ({
responseHeaders: filter(details.responseHeaders),
}),
{ urls: ['*://*.merchantos.com/*'] },
['blocking', 'responseHeaders']
)
EDIT :
Problem solved. For Chrome 72 you now need to add the host of the request into your permission to be able to edit headers.
manifest.json :
"permissions": [
"webRequest",
"webRequestBlocking",
"*://*.merchantos.com/*",
"*://*.mywebsite.coom/*/,
]