Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit 2f05ed0

Browse files
authored
Merge pull request #42 from Hi-Fi/explicitAutomationExtensionsDisable
Automation extension explixit disable on disable-extensions
2 parents a03d8e8 + 997fd06 commit 2f05ed0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/github/markusbernhardt/seleniumlibrary/keywords/BrowserManagement.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,9 @@ protected void parseBrowserOptionsChrome(String browserOptions, Capabilities des
790790
chromeOptions.put(key, entry.getValue());
791791
}
792792
((ChromeOptions) desiredCapabilities).setCapability(ChromeOptions.CAPABILITY, chromeOptions);
793+
if (browserOptions.contains("disable-extensions")) {
794+
((ChromeOptions) desiredCapabilities).setExperimentalOption("useAutomationExtension", false);
795+
}
793796
} else {
794797
logging.warn("Invalid browserOptions: " + browserOptions);
795798
}
@@ -893,4 +896,4 @@ protected void setRemoteWebDriverProxy(HttpCommandExecutor httpCommandExecutor)
893896
String.format("The %s field does not contain a %s.", fieldName, className));
894897
}
895898
}
896-
}
899+
}

0 commit comments

Comments
 (0)