I have a chrome extension redirecting webpages on specific website(like example.com) containing certain string(like docs) in url to my page using declarativeNetRequest. I want to show url of blocked page in my extension page, thus I need to somehow pass url of blocked page to my page. So the requirement is to redirect something like http://www.example.com/support/docs/index.html to https://example2.com?url=http://www.example.com/support/docs/index.html. I tried to use redirect.regexSubstution and redirect.transform, but couldn't make it. How can I achieve it? here is an example showing what I want to do
{
"id": 4,
"priority": 1,
"action": { "type": "redirect", "redirect": { "url": "https://example2.com?url=xxxx" } },
"condition": { "regexFilter": "docs",
"requestDomains": ["example.com"],
"resourceTypes": ["main_frame"] }
}