I developed a Chrome Extension which manipulates response headers of network requests.
chrome.webRequest.onHeadersReceived.addListener(
manipulateResponseHeaders,
{ urls: ['<all_urls>'] },
['blocking', 'responseHeaders']
);
function manipulateResponseHeaders(details) {
var modifiedHeaders = someModification(details.responseHeaders);
return {responseHeaders: modifiedHeaders};
}
Consider website URL: http://www.myntra.com
This website redirects to https://www.myntra.com
with status 301 Moved Permanently
.
My extension successfully intercepts http://www.myntra.com
but not https://www.myntra.com
.
Permissions in manifest.json:
"permissions": [
"contextMenus",
"declarativeContent",
"storage",
"webRequest",
"webRequestBlocking",
"webNavigation",
"tabs",
"http://*/*",
"https://*/*"
]
Is it a restriction from Chrome WebRequest APIs or I'm missing some permissions?