如何删除 "Chrome is being controlled by automated test software"

How to remove "Chrome is being controlled by automated test software"

如何默认删除此消息?

我正在使用 Puppeteer,当 chromium 启动时,它会显示此消息。

您正在寻找 --disable-infobars 标志。

将此传递给 puppeteer.launch([options])

在哪里

options = {
args: ['--disable-infobars']
}

https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions https://peter.sh/experiments/chromium-command-line-switches/#disable-infobars

2020 年更新:

此标志已 deprecated by chromium 指出它存在安全风险并且 "can be misused for malicious purposes"

您可以使用以下方法达到相同的效果:

options = {
    ignoreDefaultArgs: ["--enable-automation"]
}

然而,这可能会产生其他副作用。