Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.8k views
in Technique[技术] by (71.8m points)

chromium - Chrome web extension DeclarativeNetRequest does not block intercept requests in main_frame

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" ]
      
    }
  }]

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Turned out it's a bug in Opera's requests originating from the Speed Dial shortcuts. Chromium Canary does not exhibit the same issue with the start page shortcuts.

I have reported the issue to the Opera team.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...