chrome-devtools-java-client icon indicating copy to clipboard operation
chrome-devtools-java-client copied to clipboard

Settings resetted?

Open xLevision opened this issue 6 years ago • 3 comments

Hi, I need for my project the setting "Autoplay policy" unfortunately this setting is reset every time. Is there a way to change this promatically?

On the other hand, the settings should be taken over from the normal browser.

xLevision avatar Oct 05 '19 01:10 xLevision

There is a way to pass the autoplay-policy as argument?

.additionalArguments("autoplay-policy", "no-user-gesture-required")

This seems not working.

xLevision avatar Oct 07 '19 19:10 xLevision

no-user-gesture-required policy is a default one, from what I can understand: https://cs.chromium.org/chromium/src/media/base/media_switches.cc?sq=package:chromium&type=cs&g=0&l=527

On the other hand, the following arguments disable auto play, that is user gesture is required to start playing:

ChromeArguments chromeArguments = ChromeArguments.defaults(false)
        .additionalArguments("autoplay-policy", "user-gesture-required")
        .build();

final ChromeService chromeService = launcher.launch(chromeArguments);

I've tested this on Chrome version 77.0.3865.120.

kklisura avatar Oct 18 '19 14:10 kklisura

The same to 'no-sandbox', you could add it with additionalArguments as well: ... .additionalArguments("no-sandbox", Boolean.TRUE) ...

fragaLY avatar Oct 28 '19 11:10 fragaLY