[PM-9876] Safari Passkeys Prompt is Not Triggered (#11471)

This commit is contained in:
Cesar Gonzalez 2024-10-09 08:45:28 -05:00 committed by GitHub
parent f1dab68e46
commit 36c965c453
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 10 deletions

View File

@ -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 {