3

I am writing a Chrome Extension which adds a request header. My code seems to work as expected but on some requests, Chrome says Provisional headers are shown, showing only the Referer and User-Agent:

Chrome Inspector Request Headers I have checked "Disable cache" in the network inspector, and "hard" reloaded the page multiple times with a cache clear. Even with the extension disabled, I see this happen on the same certain requests when made by a parent webpage, but it is worrying that I do not see my header there when I would expect to. For example, testing on twitter.com, this request ( https://abs.twimg.com/a/1538144154/img/t1/web_sprite.png ) has the issue I'm describing, but not when loaded directly with the link in the address bar.

I'm testing my extension on bbc.co.uk, wikipedia.org and twitter.com, and each have a few requests which do this every time. My extension code in case it's relevant:

const setCustomReqHeader = (details) => {
    if (bCustomHeader) {
        const oNewHeaderEntry = {name: sHeaderName, value: sHeaderValue}
        details.requestHeaders.push(oNewHeaderEntry)
        return {requestHeaders: details.requestHeaders}
    }
    return {requestHeaders: details.requestHeaders};
}
chrome.webRequest.onBeforeSendHeaders.addListener(
    setCustomReqHeader,
    {urls: ["all_urls"]},
    ["blocking", "requestHeaders"]
);

Thanks to anyone who can help!

tripRev
  • 830
  • 3
  • 12
  • 27
  • Have you check this [SO post](https://stackoverflow.com/questions/21177387/caution-provisional-headers-are-shown-in-chrome-debugger) related to your problem? – MαπμQμαπkγVπ.0 Oct 01 '18 at 09:58
  • @MαπμQμαπkγVπ.0 Yes I followed the guide in this reply to that question ( https://stackoverflow.com/a/21179105/1330374 ) on using `chrome://net-internals`, and noticed one "Source Type" entry said DISK_CACHE_ENTRY, so that sounds like it could still be getting cached somehow, but not really sure. – tripRev Oct 03 '18 at 00:50

0 Answers0