chrome-devtools-java-client
chrome-devtools-java-client copied to clipboard
Settings resetted?
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.
There is a way to pass the autoplay-policy as argument?
.additionalArguments("autoplay-policy", "no-user-gesture-required")
This seems not working.
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.
The same to 'no-sandbox', you could add it with additionalArguments as well:
... .additionalArguments("no-sandbox", Boolean.TRUE) ...