diff options
author | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-18 15:28:08 +0000 |
---|---|---|
committer | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-18 15:28:08 +0000 |
commit | a570a39f2e2234de74c0032fde002695049b9f08 (patch) | |
tree | b1aa5b57cbc99fada141d3171cb0935946ffaae2 /chrome/common/extensions/docs/static | |
parent | a64ad24dc8c840f4cdde3c30120abb03e2a07043 (diff) | |
download | chromium_src-a570a39f2e2234de74c0032fde002695049b9f08.zip chromium_src-a570a39f2e2234de74c0032fde002695049b9f08.tar.gz chromium_src-a570a39f2e2234de74c0032fde002695049b9f08.tar.bz2 |
Fix example of onBeforeSendHeaders in webRequest API documentation
BUG=110359
TEST=no
Review URL: https://chromiumcodereview.appspot.com/9215008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118094 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs/static')
-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 |