There is a website called x. Upon opening website x it makes a request for a css file from website y. I am making a darkmode chrome extension for website x. I want to redirect the request website x is making to getting the css file data from my extension (website z). But I don't want to open the css file (I redirect to), instead just make the website get the data from the css file. Is it possible? How can I achieve this?
More info: chrome manifest version: 3 For the redirection: chrome.declarativeNetRequest API
I tried making a basic redirect rule with the chrome.declarativeNetRequest api. I expected the website to get the data from the file I redirected it to. But instead upon opening the website, the css file opened (as raw text).