Skip to content

[🐛 Bug]: Chrome 140 + Selenium BiDi: Extension is loaded but authentication popup opens but content renders incorrectly until manual refresh #17021

@kashishsinghyadav

Description

@kashishsinghyadav

Description

With Chrome 140+, --load-extension is no longer supported.
We migrated to Selenium BiDi WebExtension APIs to install a Chrome extension.

The extension installs successfully and the inline menu opens.
However, during extension authentication:

  • Clicking "Unlock / Authenticate" opens a new extension window (expected)
  • The authentication code SHOULD be visible immediately
  • Instead, the window shows a red error state
  • After manually refreshing the window, the auth code appears
  • This breaks automation logic because the content is not available on first load

This issue only occurs when the extension is installed via BiDi.
The same flow worked correctly earlier using --load-extension.

OS: Windows
Java: 17
Selenium: 4.40.0
Chrome: 140+
ChromeDriver: Matching Chrome version
WebDriverManager: 6.3.3

Image

Reproducible Code

case "chrome":
String chromeExtensionPath = extensionPath + "\\Chrome";
System.out.println("Loading Chrome extension from: " + chromeExtensionPath); // Debug
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--disable-features=IsolateOrigins,site-per-process");
chromeOptions.addArguments("--disable-site-isolation-trials");
chromeOptions.addArguments("--disable-web-security");
chromeOptions.addArguments("--user-data-dir=C:/Temp/ChromeProfile");

chromeOptions.setCapability("webSocketUrl", true);
chromeOptions.addArguments("--enable-unsafe-extension-debugging");
chromeOptions.addArguments("start-maximized");
chromeOptions.addArguments("--remote-debugging-pipe") ; 
chromeOptions.addArguments("--disable-features=DisableLoadExtensionCommandLineSwitch");
					
chromeOptions.setExperimentalOption("enableExtensionTargets", true);			     		            
WebDriverManager.chromedriver().setup();
browserDriver = new ChromeDriver(chromeOptions); 
WebExtension extension = new WebExtension(browserDriver);
 Map<String, Object> extensionResult = null;
 System.out.println("Installing extension from: " + extensionPath);
extensionResult = extension.install(
 new InstallExtensionParameters(new ExtensionPath(chromeExtensionPath)	      );
break;

ℹ️ Last known working version: 4.40.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions