0

I am sending fetch requests from chrome extension depending on current page data. But unfortunately when page loaded from cache it just doesn't send new request and I have to reload the page manually every time for request to happen. How to bypass it and make chrome send request explicitly? Thanks.

Ivan Kolyhalov
  • 902
  • 11
  • 16

1 Answers1

0

You can assign custom headers to fetch API like this. Maybe you can apply the same in chrome extension.

var myHeaders = new Headers();
myHeaders.append('cache-control', 'no-cache');

var myInit = {
  method: 'GET',
  headers: myHeaders,
};

fetch(myRequest, myInit)
  .then(function(response) {
    return response;
  })
Caleb Hillary
  • 525
  • 6
  • 10