1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-11 10:10:25 +01: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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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);
}),
);
}
/**