Manifest V3: declarativeNetRequest how to get parameter from URL and redirect the URL follow that parameter?

362 views
Skip to first unread message

Ngoc Duc Huynh

unread,
May 13, 2022, 7:59:12 PM5/13/22
to Chromium Extensions
- Hi, on Facebook when click to external request it will go to URL something like this:
l.facebook.com?url=www.examplewebsite.com
- In manifest V2 I simply get URL parameter and then close the tab(l.facebook.com) and open a new tab which URL is URL parameter I get and increase the totalBlocking value by 1 in chrome.storage, in manifest v3 I check the docs about declarativeNetRequest but don't know how to make this work

wOxxOm

unread,
May 14, 2022, 12:00:00 AM5/14/22
to Chromium Extensions, provan...@gmail.com
You could have used regexFilter + regexSubstitution as shown in examples from the documentation, but the problem is that the `url` parameter is percent-encoded:


AFAICT, declarativeNetRequest can't decode it automatically and we can't do it using regexSubstitution either.
Consider adding a feature request on https://crbug.com.
Reply all
Reply to author
Forward
0 new messages