chrome.webRequest.onBeforeSendHeaders.addListener failed to insert X-Timestamp into requestHeaders.

16 views
Skip to first unread message

Zh Meng

unread,
May 17, 2017, 1:27:44 AM5/17/17
to Chromium-Extensions-Announce
From the log captured via Wireshark, we found that there was no X-Timestamp in the requests sent at the very begining while  X-Timestamp were found in other requests sent later, it happens only when re-open the browser. Could you please help clarify why there is no X-Timestamp in the requests sent at the very begining or is there any solution to add X-Timestamp in all the requests including the requests sent when openning the browser (without X-Timestamp)?

Code:
function modifyRequestHeaderHandler_(details) { 
  details.requestHeaders.push({name: "X-Timestamp", value: "xxxx-xx-xxxx"});
  return {requestHeaders: details.requestHeaders};
};
//add a listener onberforesendherders
chrome.webRequest.onBeforeSendHeaders.addListener(
  modifyRequestHeaderHandler_,
  {urls: []},
  ['requestHeaders', 'blocking']
);
Reply all
Reply to author
Forward
0 new messages