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

Most upvoted comments

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.

const puppeteer = require('puppeteer');
(async()=>{
  const browser = await puppeteer.launch({
    headless: false,
    args: ['--no-startup-window']
  });
  const page = await browser.newPage();
  await page.goto('https://github.com/');
})();

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

--enable-automation

Disable a few things considered not appropriate for automation. (Original design doc) codesearch

  • disables the password saving UI (which covers the usecase of the removed --disable-save-password-bubble flag)
  • disables infobar animations
  • disables dev mode extension bubbles (?), and doesn’t show some other info bars
  • disables auto-reloading on network errors (source)
  • means the default browser check prompt isn’t shown
  • avoids showing these 3 infobars: ShowBadFlagsPrompt, GoogleApiKeysInfoBarDelegate, ObsoleteSystemInfoBarDelegate

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

const browser = await puppeteer.launch({
    headless: false,
    devtools: true,
    args: ["--no-default-browser-check"],
    ignoreDefaultArgs: ['--enable-automation'],
  });

@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?

@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:

  • remove --disable-infobars as now it does nothing
  • add add_experimental_option('useAutomationExtension', False)
  • add 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.