Is there a way to disable the WebAuthn-API in the ChromeDriver?
I tried to add an extension, but this did not work.
final ChromeOptions options = new ChromeOptions();
options.addArguments("--load-extension=/path/to/extension");
...
manifest.json:
{
"name": "Disable WebAuthn",
"version": "1.0",
"manifest_version": 3,
"description": "Disables Web Authentication API for testing purposes.",
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["disable_webauthn.js"],
"run_at": "document_start"
}
]
}
disable_webauthn.js:
Object.defineProperty(navigator, "credentials", {
get: () => undefined
});```