1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 15:23:33 +00:00

[PM-10654] Inline menu not working in MS Edge (#10414)

This commit is contained in:
Cesar Gonzalez
2024-08-06 08:32:16 -05:00
committed by GitHub
parent 8090a89a32
commit b0c938ea7e

View File

@@ -105,7 +105,19 @@ export async function sendExtensionMessage(
command: string,
options: Record<string, any> = {},
): Promise<any> {
return chrome.runtime.sendMessage({ command, ...options });
if (typeof browser !== "undefined") {
return browser.runtime.sendMessage({ command, ...options });
}
return new Promise((resolve) =>
chrome.runtime.sendMessage(Object.assign({ command }, options), (response) => {
if (chrome.runtime.lastError) {
resolve(null);
}
resolve(response);
}),
);
}
/**