How to disable Chrome Data saver with my worker

Chrome Data saver is enabled by default for all android users, this is causing a lot of issues in my website, my javascript does not work when Data saver is enabled, and my site needs javascript to work.

I have seen that you can detect if Data saver is enabled through the request header:


What is the best way to Disable Chrome’s Data Saver optimization?

I wonder if I can use my worker to force Chrome to use Cloudflare cache instead of Google Data saver.

Thanks for your help

Im trying removing the header ‘save-data’ but it’s not working I get an error

response = await fetch(request);

//Remove save-data header to prevent Chrome data saver feature
let requestHeaders = response.headers;
requestHeaders = requestHeaders.delete('save-data');
response.headers = requestHeaders;

return request;