puppeteer: --disable-infobars arg not working
Steps to reproduce
- Puppeteer version: 1.1.0
- Platform / OS version: High Sierra 10.13.2
- Node.js version: 9.2
What steps will reproduce the problem?
await puppeteer.launch({
headless: false,
args: ['--disable-infobars', `--window-size=${800},${680}`],
})
window-size
works as expected, but Chromium still shows the “this browser is being controlled by automated software” infobar at the top.
What is the expected result?
Not showing the infobar.
What happens instead?
Shows infobar.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 37 (1 by maintainers)
Commits related to this issue
- Get rid of "Chrome is being controlled..." banner Closes #8 See https://github.com/puppeteer/puppeteer/issues/2070#issuecomment-525556114 — committed to steinnes/bord by eirikur-grid 4 years ago
Adding the following to the options argument in puppeteer.launch solved the issue for me
ignoreDefaultArgs: ['--enable-automation'],
such as:
const browser = await puppeteer.launch({ headless: false, slowMo: 120, ignoreDefaultArgs: ['--enable-automation'], args: [
–proxy-server=${newproxy},
–no-sandbox, '--disable-setuid-sandbox' ], slowMo: 20 });
apparently the enable-automation flag is a default argument that we have to ignore. that removes the infobars.
hope this helps
I could hide infobar by using the
--no-startup-window
option as below.This works for me
await puppeteer.launch({ headless: false, args: [ '--app=https://www.google.com/' ] })
no it does not, at least for me
Note that removing
enable-automation
could have an undesirable impact on your automation:https://github.com/GoogleChrome/chrome-launcher/blob/master/docs/chrome-flags-for-tools.md#--enable-automation
I really wish there was a workaround for this without using policy.
You can try these two options:
options.setExperimentalOption("useAutomationExtension", false); options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
--no-default-browser-check
is needed if you get the default browser notification@jacobjithin the link is correct, but here is the solution:
ChromeOptions options = new ChromeOptions();
options.AddArguments("--start-maximized");
//options.AddArguments("--disable-infobar"); //not working anymore
Solution to Chrome version 76:
options.AddExcludedArgument("enable-automation");
options.AddAdditionalCapability("useAutomationExtension", false);
Had to disable browser’s save password option too:
options.AddUserProfilePreference("credentials_enable_service", false);
options.AddUserProfilePreference("profile.password_manager_enabled", false);
for java, following workaround is working for me…
options.setExperimentalOption(“excludeSwitches”, Collections.singletonList(“enable-automation”)); options.setExperimentalOption(“useAutomationExtension”, false);
any better code, pls do suggest!
Because of the latest Chrome update (v76), Chrome now also shows a ‘Disable developer mode extensions’ popup if you add any extensions through code. Is there any new way to hide this popup?
Solution for ChromeDriver tested with Selenium WebDriver https://help.applitools.com/hc/en-us/articles/360007189411--Chrome-is-being-controlled-by-automated-test-software-notification
@CarolCiola : Thanks ! I tried the below two lines and the save browser password option was coming up. options.AddExcludedArgument(“enable-automation”); options.AddAdditionalCapability(“useAutomationExtension”, false);
And now your line of code of disable the save password “options.AddUserProfilePreference(“credentials_enable_service”, false);” worked for it. I believe only that one line is needed Thank you again
if anyone is needed, here’s workaround:
--disable-infobars
as now it does nothingadd_experimental_option('useAutomationExtension', False)
add_experimental_option('excludeSwitches', ['enable-automation'])
p.s. it’s a python syntax so adapt code for your needs.
Actually, looks like
--disable-infobars
works again now.@bezeklik with the new version this no longer works well. It prevents Chromium for actually showing until you click it in the dock.
I’m sure there’s some way we could “focus” it using maybe AppleScript, but that is pretty hacky.