I am migrating our v2 extension to manifest v3 and in the process of converting from the deprecated WebRequest API to the new DeclarativeNetRequest, I've found that the following rule does not intercept requests that originate while navigating through links, yet it does intercept the same request if the URL is entered into the address bar. I need it to intercept all requests and URL changes that happen in the top frame.
[
{
"id": 1,
"priority": 1,
"action": {
"type": "redirect",
"redirect": { "regexSubstitution": "some local web server address here" }
},
"condition": {
"regexFilter": "^(https?\://)?[^\:]+$",
"resourceTypes": [ "main_frame" ]
}
}]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…