gpt4 book ai didi

google-chrome - Chrome 扩展程序 - 在 Debug模式后清除信息栏标签

转载 作者:行者123 更新时间:2023-12-04 12:10:04 25 4
gpt4 key购买 nike

在基于 Chrome 的浏览器的最新版本中,出于某种原因(可能不是错误,它是一个功能), Debug模式之后是 分离 ,Chrome 留下此通知:
“程序开始调试这个浏览器”
Screenshot
基本上,我运行这段代码

let debugee = {tabId: sender.tab.id};
chrome.debugger.attach(debugee, '1.2', ()=>{});
chrome.debugger.detach(debugee);
并看上图。 Chrome 在 detach 上删除了此通知直到版本 80(左右)。
我找到了问题的描述:
https://chromium.googlesource.com/chromium/src/+/HEAD/chrome/app/generated_resources.grd
<!-- DevTools attached infobar -->
<message name="IDS_DEV_TOOLS_INFOBAR_LABEL" desc="Label displayed in an infobar when external debugger is attached to the browser. The label does not disappear until the user dismisses it, even if the debugger is detached, and so should not imply that the debugger must still be debugging the browser, only that it was, and could still be.">
"<ph name="CLIENT_NAME">$1<ex>Extension Foo</ex></ph>" started debugging this browser
</message>
我正在寻找有关如何从 chrome 扩展程序自动清除或禁用此消息的建议。

最佳答案

TL;DR 没有这样的方法。
Chrome 中的新行为是对安全问题进行尴尬修复的结果:恶意扩展程序可以通过 chrome.debugger API 迅速造成大量损害,如果工作不到说导出,则没有人会知道发生了什么100 毫秒。
由于涉及安全问题,旧行为不会恢复,但他们同意 UI 至少应反射(reflect)当前调试器状态,请参阅 https://crbug.com/1096262 .他们目前的计划是如果扩展程序已分离并更新按钮/字符串以与状态同步,则在可见时间 >=5 秒后自动关闭信息栏。
解决方法是使用 --silent-debugger-extension-api 运行 chrome命令行开关。这是一个危险的开关,尽管您必须小心不要安装使用 debugger 的恶意扩展。立即或在更新时获得许可。

关于google-chrome - Chrome 扩展程序 - 在 Debug模式后清除信息栏标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63441002/

25 4 0