301个重定向请求未被Chrome WebRequest API拦截

时间:2019-01-16 03:47:52

标签: google-chrome-extension http-status-code-301 chrome-webrequest

我开发了一个Chrome扩展程序,用于处理网络请求的响应标头。

chrome.webRequest.onHeadersReceived.addListener(
  manipulateResponseHeaders,
  { urls: ['<all_urls>'] },
  ['blocking', 'responseHeaders']
);

function manipulateResponseHeaders(details) {
  var modifiedHeaders = someModification(details.responseHeaders);
  return {responseHeaders: modifiedHeaders};
}

考虑网站网址:http://www.myntra.com 此网站以状态https://www.myntra.com重定向到301 Moved Permanently

我的扩展名成功拦截了http://www.myntra.com,但没有拦截https://www.myntra.com

manifest.json中的权限:

"permissions": [
  "contextMenus",
  "declarativeContent",
  "storage",
  "webRequest",
  "webRequestBlocking",
  "webNavigation",
  "tabs",
  "http://*/*",
  "https://*/*"
]

这是Chrome WebRequest API的限制,还是缺少某些权限?

0 个答案:

没有答案