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:
parent
62cfcb6dc0
commit
02fe5bf0c5
@ -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);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user