python, selenium, firefox. how do i control the addon installed after start the driver?

31 views Asked by At

for now i'm using this to add a firefox addon image-block:

driver.install_addon(addon_path)

but how do i control it after this?

for now i have to manually click on that extension after the browser startup to make it work
is there any way to control it in the script?

i've seen some answer using profile like this(came from here):

 from selenium import webdriver
 firefox_profile = webdriver.FirefoxProfile()

 firefox_profile.add_extension(folder_xpi_file_saved_in + "\\quickjava-2.0.6-fx.xpi")
 firefox_profile.set_preference("thatoneguydotnet.QuickJava.curVersion", "2.0.6.1") ## Prevents loading the 'thank you for installing screen'
 firefox_profile.set_preference("thatoneguydotnet.QuickJava.startupStatus.Images", 2)  ## Turns images off
 firefox_profile.set_preference("thatoneguydotnet.QuickJava.startupStatus.AnimatedImage", 2)  ## Turns animated images off

 driver = webdriver.Firefox(firefox_profile)

but the profile thing is deprecated

0

There are 0 answers