diff options
-rw-r--r-- | chrome/common/extensions/docs/static/webRequest.html | 9 | ||||
-rw-r--r-- | chrome/common/extensions/docs/webRequest.html | 9 |
2 files changed, 14 insertions, 4 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 diff --git a/chrome/common/extensions/docs/webRequest.html b/chrome/common/extensions/docs/webRequest.html index 3b50876..e559ce7 100644 --- a/chrome/common/extensions/docs/webRequest.html +++ b/chrome/common/extensions/docs/webRequest.html @@ -734,11 +734,16 @@ passed to the extension:</p> 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 |