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:
parent
8090a89a32
commit
b0c938ea7e
@ -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);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user