In google chrome extensions, How can i replace a request URL with a different one before it loads?
I took a look at chrome.webRequest and i think one of them is what i am looking for, I don't know which one exactly.
I believe google limits some kind of stuff, not sure if this is one of them.
I found an example that does this :
chrome.webRequest.onBeforeRequest.addListener(
function(info) {
// Redirect the original request to a given URL.
var url = "http://site.com/image.png";
return {redirectUrl: url};
},
// filters
{
urls: [
"http://original.com/*"
],
types: ["image"]
},
// extraInfoSpec
["blocking"]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With