0

I want to add header AppVersion to my chrome os app here what I did

chrome.webRequest.onHeadersReceived.addListener(
    function(details) {
      const newHeader = {name:"appVersion", value:"chrome|2.1"};
      const responseHeaders = details.responseHeaders.concat(newHeader);
      return { responseHeaders };
    },
    // filters
    {
      urls: ["https://website.link/*"],
    },
    // extraInfoSpec
    ["blocking","responseHeaders", "extraHeaders"]
    );

but it is not working

  • It's unclear whether you are creating a chrome app or a chrome extension. Chrome apps can't use webRequest API. – wOxxOm Jul 06 '20 at 16:21
  • I’m creating chrome app, is there any way to add headers using chrome app? – Mohamed Elsayed Jul 07 '20 at 17:12
  • Chrome apps can use webRequest inside webview, see the [documentation](https://developer.chrome.com/apps/tags/webview#type-WebRequestEventInterface). – wOxxOm Jul 07 '20 at 17:21

0 Answers0