I want to use, on a webdriver Firefox instance, the "new tab instead of window" option. 1/ I created a profile with this option on, but when I use the profile a lot of options are OK but not this one. 2/ After the load of the profile I tried to change the option in the code but it does n't work. My code :
profile = webdriver.FirefoxProfile(os.path.join(s_path, name))
profile.set_preference("browser.link.open_newwindow.restriction", 0)
profile.set_preference("browser.link.open_newwindow", 3)
profile.set_preference("browser.link.open_external", 3)
profile.set_preference("browser.startup.homepage","http://www.google.fr")
profile.update_preferences()
print(os.path.join(s_path, name))
driver = webdriver.Firefox(set_profile())
All is OK (the start homepage is google.fr) except this option which is not OK.
It seems that Selenium copy the profile in a temp dir. where users.js have the wrong line :
user_pref("browser.link.open_newwindow", 2);
Python 3.4.2, Windows 7, Firefox 39.0, Selenium lib 2.46