Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preventing Firefox add-on first page from showing up

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?

like image 626
The_Diver Avatar asked Nov 20 '25 21:11

The_Diver


1 Answers

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")
like image 189
alecxe Avatar answered Nov 24 '25 23:11

alecxe