How to pass command-line arguments to the browser?

  • Created

We recommend that you read the Getting started with Kameleo Automation article before reading this one.

With Kameleo, you can fine-tune the browsers by passing command-line arguments. The arguments are passed either by using the startProfileWithWebDriverSettings function or with a POST request to the /profiles/{guid}/start endpoint. See the documentation on SwaggerHub for details.

Please note that some of the command line arguments are blacklisted as they may interfere with Kameleo. Blacklisted flags:

  • --incognito
  • --disable-infobars
  • --disable-gpu
  • --disable-blink-features
  • --disable-3d-apis
  • --user-data-dir
  • --user-agent
  • --remote-debugging-port
  • --enable-automation
  • --profile

For example, you can mute the Chromium-based browsers by setting the --mute-audio command line flag during the profile launch with the following code snippet:

  • await client.startProfileWithWebDriverSettings(profile.id, {
      body: {
        argumentsProperty: [
          'mute-audio',
        ],
      },
    });

    See the full example here.

  • await client.StartProfileWithWebDriverSettingsAsync(profile.Id, new WebDriverSettings
    {
      Arguments = new List<string> { "mute-audio" },
    });

    See the full example here.

  • client.start_profile_with_web_driver_settings(profile.id, WebDriverSettings(
      arguments=["mute-audio"],
    ))

    See the full example here.

Was this article helpful?

0 out of 0 found this helpful