browser.webRequest.onAuthRequired
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 564
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
弹出代理认证信息输入框,却没有执行进入监听事件中
browser.webRequest.onAuthRequired 和 chrome.webRequest.onAuthRequired 都试过,在网页刷新也是,监听似乎无效。 请大佬帮看看。
Reproduction
heyo。
Steps to reproduce
加载扩展程序:
打开 Chrome 或其他基于 Chromium 的浏览器,进入 chrome://extensions 页面。
启用右上角的 “开发者模式”。
点击 “加载已解压的扩展程序”。
选择项目中的 .output/chrome-mv3 目录。
打开开发者工具:
在扩展程序列表中找到 “onAuthRequired MV3 Bug”,点击 “服务工作线程” (Service Worker) 链接。这会打开背景脚本的开发者工具,我们可以在其控制台中看到 console.log 的输出。
触发事件:
点击浏览器工具栏上的扩展图标,会弹出一个小窗口 (Popup)。
点击窗口中的 “Trigger Auth Request” 按钮。
验证结果:
切换到你之前打开的 “服务工作线程” 控制台。
你应该能看到类似下面的日志输出,这证明 onAuthRequired 事件监听器已经成功触发
System Info
Mac 15 & Chrome 137
Used Package Manager
pnpm
Validations
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached reproduction and its .output/chrome-mv3 build; inspect the service worker console while reproducing the auth prompt in Chrome 137. Trace how the popup's “Trigger Auth Request” reaches browser.webRequest.onAuthRequired, and consider the issue complete when the listener reliably logs for the reproduced request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100