mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-21 16:18:28 +01:00
[PM-9876] Safari Passkeys Prompt is Not Triggered (#11471)
This commit is contained in:
parent
f1dab68e46
commit
36c965c453
@ -43,23 +43,17 @@ function buildRegisterContentScriptsPolyfill() {
|
||||
function NestedProxy<T extends object>(target: T): T {
|
||||
return new Proxy(target, {
|
||||
get(target, prop) {
|
||||
const propertyValue = target[prop as keyof T];
|
||||
|
||||
if (!propertyValue) {
|
||||
if (!target[prop as keyof T]) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof propertyValue === "object") {
|
||||
return NestedProxy<typeof propertyValue>(propertyValue);
|
||||
}
|
||||
|
||||
if (typeof propertyValue !== "function") {
|
||||
return propertyValue;
|
||||
if (typeof target[prop as keyof T] !== "function") {
|
||||
return NestedProxy(target[prop as keyof T] as object);
|
||||
}
|
||||
|
||||
return (...arguments_: any[]) =>
|
||||
new Promise((resolve, reject) => {
|
||||
propertyValue(...arguments_, (result: any) => {
|
||||
(target[prop as keyof T] as CallableFunction)(...arguments_, (result: any) => {
|
||||
if (chrome.runtime.lastError) {
|
||||
reject(new Error(chrome.runtime.lastError.message));
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user