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

Categories

0 votes
3.1k 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...