I want to use declarativeNetRequest to redirect all URLs from a domain to a URL with the initiator URL as an encoded parameter e.g.
http://www.google.com --> http://www.newsite.com?url=http%3A%2F%2Fwww.google.com
http://www.google.com?param1=true --> http://www.newsite.com?url=http%3A%2F%2Fwww.google.com%3Fparam1%3Dtrue
Something like...
{
"id": 1,
"priority": 1,
"action": {
"type": "redirect",
"redirect": {
"url": `http://www.newsite.com?url=${encodeURIComponent(url)}`
}
}
}
Is this possible to do? If not is there another way to achieve this?