Disable developer mode chrome extensions

1,349 views
Skip to first unread message

niyaz hashmi

unread,
Aug 4, 2016, 2:34:41 AM8/4/16
to webdriver
Hi All,

I am using chrome driver 2.22 and selenium jar 2.53.1.but after launching chrome browser I am getting disable developer mode extensions pop up window.

Please find the my code below to handle developer chrome extensions

System.setProperty("webdriver.chrome.driver","path to chrome driver exe");

DesiredCapabilities capability = DesiredCapabilities.chrome();

capability.setCapaibilities("chrome.switches",Arrays.asList("--chrome-extensions"); 

driver = new ChromeDriver(capability);
 
But still the window is popping up all time.

I am running my code in Windows7 64-bit machine and chrome browser ver 52.0.

Can you please tell the resolution for this issue.

Regards,
Niyaz
 


SuperKevy

unread,
Aug 4, 2016, 9:33:44 AM8/4/16
to webdriver


 capabilities.setCapability("chrome.switches", Arrays.asList("--disable-extensions"));

ruby method:  
browser = Watir::Browser.new( :chrome, :switches => %w[ --disable-extensions" ], :prefs => profile )

darrell grainger

unread,
Aug 4, 2016, 12:14:05 PM8/4/16
to webdriver
Peter Beverloo has a nice page with all the Chrome command line switches at http://peter.sh/experiments/chromium-command-line-switches/. When you set the value of chrome.switches in Selenium, you are just passing command line switches to the launching of Chrome. Whatever the Chrome browser supports from the command line is what is a valid switch. As SuperKevy has pointed out, right now the --disable-extensions works. There is no switch --chrome-extensions (see Peter's page). So it does nothing.

There is no guarantee these switches will continue to work. I usually just google "Google Chrome command line switches" to find out what Chrome currently supports.
Reply all
Reply to author
Forward
0 new messages