Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

How can I remove this message by default?

I'm using Puppeteer, when chromium launches, it shows this message.

enter image description here

like image 484
Mehdi Raash Avatar asked Nov 13 '17 17:11

Mehdi Raash


People also ask

How do I stop selenium from loading in Chrome?

We can stop a page loading with Selenium webdriver in Chrome browser by using the JavaScript Executor. Selenium can execute JavaScript commands with the help of the executeScript command. To stop a page loading, the command window. stop() is passed as a parameter to the executeScript method.

What is excludeSwitches?

excludeSwitches is a list of strings chrome_options.add_experimental_option('excludeSwitches', ['load-extension', 'enable-automation']) Follow this answer to receive notifications.04-Nov-2019.


1 Answers

You're looking for the --disable-infobars flag.

Pass this to puppeteer.launch([options])

Where

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

UPDATE in 2020:

This flag has been deprecated by chromium citing that its a security risk and "can be misused for malicious purposes"

You can achieve the same effect by using:

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

This however may have other side effects.

like image 187
Pandelis Avatar answered Oct 14 '22 23:10

Pandelis