Encountered a problem with Selenium in headless mode where Chrome extension page wouldn't render, resulting in blank screenshot. Disabling headless mode fixed the issue. Seeking a solution to render extension page while in headless mode.
from selenium import webdriverfrom selenium.webdriver.chrome.service import Servicefrom webdriver_manager.chrome import ChromeDriverManageroptions = webdriver.ChromeOptions()options.add_extension("ext.crx")options.add_argument("--window-size=1920,1080")options.add_argument("--no-sandbox")options.add_argument("--disable-dev-shm-usage")driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)driver.get("chrome-extension://*****/popup.html")driver.save_screenshot('1.png')driver.quit()
I expected Selenium to successfully render the Chrome extension page in headless mode and capture screenshots of the pages as they appeared.