I am writing a Python program using Selenium Webdriver api that utilizes Firefox browser to browse, and I need the first page of the add on that shows it's version to be disabled and not gets shown when the browser gets to work. My add-on is NoScript.
Here is my code for Firefox profile :
def fpp():
ffprofile = webdriver.FirefoxProfile()
ffprofile.add_extension(extension='NS.xpi')
ffprofile.set_preference("extensions.noscript.currentVerison" , "2.6.9.35")
ffprofile.update_preferences()
return webdriver.Firefox(ffprofile)
def driver(url1):
m = fpp()
m.get(url1)
However, this line doesn't prevent the starting windows from showing up:
ffprofile.set_preference("extensions.noscript.currentVerison" , "2.6.9.35")
What is the problem and how do I fix it?
noscript preferences start with noscript (no need for extensions.). And you need to set the version instead of currentVersion. Works for me:
ffprofile.set_preference("noscript.version", "2.6.9.35")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With