diff options
Diffstat (limited to 'chrome/common/extensions/docs/static/webRequest.html')
-rw-r--r-- | chrome/common/extensions/docs/static/webRequest.html | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/common/extensions/docs/static/webRequest.html b/chrome/common/extensions/docs/static/webRequest.html index 33c61c7..a0c1342 100644 --- a/chrome/common/extensions/docs/static/webRequest.html +++ b/chrome/common/extensions/docs/static/webRequest.html @@ -281,11 +281,16 @@ all requests:</p> <pre> chrome.webRequest.onBeforeSendHeaders.addListener( function(details) { - delete details.requestHeaders['User-Agent']; + for (var i = 0; i < details.requestHeaders.length; ++i) { + if (details.requestHeaders[i].name === 'User-Agent') { + details.requestHeaders.splice(i, 1); + break; + } + } return {requestHeaders: details.requestHeaders}; }, {urls: ["<all_urls>"]}, - ["blocking"]); + ["blocking", "requestHeaders"]); </pre> <p> For more example code, see the <a href="samples.html#webrequest">web request |