1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-16 10:45:20 +01:00

[EC-598] feat: succesfully intercept methods

This commit is contained in:
Andreas Coroiu 2022-11-18 10:20:51 +01:00
parent 62cfcb6dc0
commit 02fe5bf0c5
No known key found for this signature in database
GPG Key ID: E70B5FFC81DFEC1A

View File

@ -1,2 +1,21 @@
// eslint-disable-next-line no-console
console.log("page-script loaded");
const browserCredentials = {
create: navigator.credentials.create.bind(navigator.credentials),
get: navigator.credentials.get.bind(navigator.credentials),
};
// Intercept
navigator.credentials.create = async (options?: CredentialCreationOptions): Promise<Credential> => {
alert("Intercepted: create");
return await browserCredentials.create(options);
};
navigator.credentials.get = async (options?: CredentialRequestOptions): Promise<Credential> => {
alert("Intercepted: get");
return await browserCredentials.get(options);
};