Skip to content

Instantly share code, notes, and snippets.

@cgravier
Last active December 10, 2015 20:59
Show Gist options
  • Save cgravier/4491991 to your computer and use it in GitHub Desktop.
Save cgravier/4491991 to your computer and use it in GitHub Desktop.
Map<String, Object> contentSettings = new HashMap<String, Object>();
contentSettings.put("images", 2);
contentSettings.put("plugins", 2);
contentSettings.put("popups", 2);
contentSettings.put("audio", 2);
Map<String, Object> preferences = new HashMap<String, Object>();
preferences.put("profile.default_content_settings", contentSettings);
DesiredCapabilities caps = DesiredCapabilities.chrome();
caps.setCapability("chrome.prefs", preferences);
driver = new RemoteWebDriver(service.getUrl(), caps);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment