mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-22 16:29:09 +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 {
|
function NestedProxy<T extends object>(target: T): T {
|
||||||
return new Proxy(target, {
|
return new Proxy(target, {
|
||||||
get(target, prop) {
|
get(target, prop) {
|
||||||
const propertyValue = target[prop as keyof T];
|
if (!target[prop as keyof T]) {
|
||||||
|
|
||||||
if (!propertyValue) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof propertyValue === "object") {
|
if (typeof target[prop as keyof T] !== "function") {
|
||||||
return NestedProxy<typeof propertyValue>(propertyValue);
|
return NestedProxy(target[prop as keyof T] as object);
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof propertyValue !== "function") {
|
|
||||||
return propertyValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (...arguments_: any[]) =>
|
return (...arguments_: any[]) =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
propertyValue(...arguments_, (result: any) => {
|
(target[prop as keyof T] as CallableFunction)(...arguments_, (result: any) => {
|
||||||
if (chrome.runtime.lastError) {
|
if (chrome.runtime.lastError) {
|
||||||
reject(new Error(chrome.runtime.lastError.message));
|
reject(new Error(chrome.runtime.lastError.message));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user