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:
@@ -105,7 +105,19 @@ export async function sendExtensionMessage(
|
|||||||
command: string,
|
command: string,
|
||||||
options: Record<string, any> = {},
|
options: Record<string, any> = {},
|
||||||
): Promise<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);
|
||||||
|
}),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user