'Error/Bug while installing MetaMask Extension with Firefox(geckodriver) in Selenium Python

I am currently trying to add the Metamask Extension for Firefox for using it with Selenium, but after installation both the setting window and the metamask popup stay blank and arent able to load.

from selenium import webdriver

crx = "./firefox.xpi"
profile = webdriver.FirefoxProfile()
profile.add_extension(extension=crx)
driver = webdriver.Firefox(firefox_profile=profile)
driver.set_window_size(1600, 1000)

Metamask Extension screenshot

Normally i would just use the Chrome(for which the extension works just fine), but i am i need of the headless functionality where chrome does not support extensions.

Any tips are appreciated :D
Or is there another headless alternative which supports extensions :D

thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source