[PM-5639] Fix Safari Window Popouts Issues When Manually Locking Extension (#7953)
* [PM-5639] Safari Browser Shows Issues When Manually Locking Extension * [PM-5639] Safari Browser Shows Issues When Manually Locking Extension
This commit is contained in:
parent
b46eb274bb
commit
caa998c5b1
|
@ -34,9 +34,9 @@ const windowMessageHandlers: ContentMessageWindowEventHandlers = {
|
|||
* @param data - Data from the window message
|
||||
* @param referrer - The referrer of the window
|
||||
*/
|
||||
async function handleAuthResultMessage(data: ContentMessageWindowData, referrer: string) {
|
||||
function handleAuthResultMessage(data: ContentMessageWindowData, referrer: string) {
|
||||
const { command, lastpass, code, state } = data;
|
||||
await chrome.runtime.sendMessage({ command, code, state, lastpass, referrer });
|
||||
sendExtensionRuntimeMessage({ command, code, state, lastpass, referrer });
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -47,7 +47,7 @@ async function handleAuthResultMessage(data: ContentMessageWindowData, referrer:
|
|||
*/
|
||||
async function handleDuoResultMessage(data: ContentMessageWindowData, referrer: string) {
|
||||
const { command, code, state } = data;
|
||||
await chrome.runtime.sendMessage({ command, code, state, referrer });
|
||||
sendExtensionRuntimeMessage({ command, code, state, referrer });
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,9 +56,9 @@ async function handleDuoResultMessage(data: ContentMessageWindowData, referrer:
|
|||
* @param data - Data from the window message
|
||||
* @param referrer - The referrer of the window
|
||||
*/
|
||||
async function handleWebAuthnResultMessage(data: ContentMessageWindowData, referrer: string) {
|
||||
function handleWebAuthnResultMessage(data: ContentMessageWindowData, referrer: string) {
|
||||
const { command, remember } = data;
|
||||
await chrome.runtime.sendMessage({ command, data: data.data, remember, referrer });
|
||||
sendExtensionRuntimeMessage({ command, data: data.data, remember, referrer });
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,12 +96,23 @@ const forwardCommands = new Set([
|
|||
*
|
||||
* @param message - The message from the extension
|
||||
*/
|
||||
async function handleExtensionMessage(message: any) {
|
||||
function handleExtensionMessage(message: any) {
|
||||
if (forwardCommands.has(message.command)) {
|
||||
await chrome.runtime.sendMessage(message);
|
||||
sendExtensionRuntimeMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a message to the extension runtime, and ignores
|
||||
* any potential promises that should be handled using
|
||||
* the `void` operator.
|
||||
*
|
||||
* @param message - The message to send to the extension runtime
|
||||
*/
|
||||
function sendExtensionRuntimeMessage(message: any) {
|
||||
void chrome.runtime.sendMessage(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Duplicate implementation of the same named method within `apps/browser/src/autofill/utils/index.ts`.
|
||||
* This is done due to some strange observed compilation behavior present when importing the method from
|
||||
|
|
Loading…
Reference in New Issue