How can I remove this message by default?
I'm using Puppeteer, when chromium launches, it shows this message.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With