mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +00:00
[PM-5189] Working through content script port improvement
This commit is contained in:
@@ -99,10 +99,6 @@ export type OverlayBackgroundExtensionMessageHandlers = {
|
|||||||
checkIsFieldCurrentlyFilling: () => boolean;
|
checkIsFieldCurrentlyFilling: () => boolean;
|
||||||
getAutofillInlineMenuVisibility: () => void;
|
getAutofillInlineMenuVisibility: () => void;
|
||||||
|
|
||||||
updateAutofillInlineMenuPosition: ({
|
|
||||||
message,
|
|
||||||
sender,
|
|
||||||
}: BackgroundOnMessageHandlerParams) => Promise<void>;
|
|
||||||
toggleAutofillInlineMenuHidden: ({ message, sender }: BackgroundOnMessageHandlerParams) => void;
|
toggleAutofillInlineMenuHidden: ({ message, sender }: BackgroundOnMessageHandlerParams) => void;
|
||||||
checkIsAutofillInlineMenuButtonVisible: ({ sender }: BackgroundSenderParam) => void;
|
checkIsAutofillInlineMenuButtonVisible: ({ sender }: BackgroundSenderParam) => void;
|
||||||
checkIsAutofillInlineMenuListVisible: ({ sender }: BackgroundSenderParam) => void;
|
checkIsAutofillInlineMenuListVisible: ({ sender }: BackgroundSenderParam) => void;
|
||||||
@@ -144,6 +140,10 @@ export type OverlayContentScriptPortMessageHandlers = {
|
|||||||
closeAutofillInlineMenu: ({ message, port }: PortOnMessageHandlerParams) => void;
|
closeAutofillInlineMenu: ({ message, port }: PortOnMessageHandlerParams) => void;
|
||||||
checkAutofillInlineMenuFocused: () => void;
|
checkAutofillInlineMenuFocused: () => void;
|
||||||
focusAutofillInlineMenuList: () => void;
|
focusAutofillInlineMenuList: () => void;
|
||||||
|
updateAutofillInlineMenuPosition: ({
|
||||||
|
message,
|
||||||
|
port,
|
||||||
|
}: PortOnMessageHandlerParams) => Promise<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type InlineMenuButtonPortMessageHandlers = {
|
export type InlineMenuButtonPortMessageHandlers = {
|
||||||
|
|||||||
@@ -82,8 +82,6 @@ export class OverlayBackground implements OverlayBackgroundInterface {
|
|||||||
checkIsFieldCurrentlyFilling: () => this.checkIsFieldCurrentlyFilling(),
|
checkIsFieldCurrentlyFilling: () => this.checkIsFieldCurrentlyFilling(),
|
||||||
getAutofillInlineMenuVisibility: () => this.getInlineMenuVisibility(),
|
getAutofillInlineMenuVisibility: () => this.getInlineMenuVisibility(),
|
||||||
|
|
||||||
updateAutofillInlineMenuPosition: ({ message, sender }) =>
|
|
||||||
this.updateInlineMenuPosition(message, sender),
|
|
||||||
toggleAutofillInlineMenuHidden: ({ message, sender }) =>
|
toggleAutofillInlineMenuHidden: ({ message, sender }) =>
|
||||||
this.toggleInlineMenuHidden(message, sender),
|
this.toggleInlineMenuHidden(message, sender),
|
||||||
checkIsAutofillInlineMenuButtonVisible: ({ sender }) =>
|
checkIsAutofillInlineMenuButtonVisible: ({ sender }) =>
|
||||||
@@ -111,6 +109,8 @@ export class OverlayBackground implements OverlayBackgroundInterface {
|
|||||||
closeAutofillInlineMenu: ({ message, port }) => this.closeInlineMenu(port.sender, message),
|
closeAutofillInlineMenu: ({ message, port }) => this.closeInlineMenu(port.sender, message),
|
||||||
checkAutofillInlineMenuFocused: () => this.checkInlineMenuFocused(),
|
checkAutofillInlineMenuFocused: () => this.checkInlineMenuFocused(),
|
||||||
focusAutofillInlineMenuList: () => this.focusInlineMenuList(),
|
focusAutofillInlineMenuList: () => this.focusInlineMenuList(),
|
||||||
|
updateAutofillInlineMenuPosition: ({ message, port }) =>
|
||||||
|
this.updateInlineMenuPosition(message, port.sender),
|
||||||
};
|
};
|
||||||
private readonly inlineMenuButtonPortMessageHandlers: InlineMenuButtonPortMessageHandlers = {
|
private readonly inlineMenuButtonPortMessageHandlers: InlineMenuButtonPortMessageHandlers = {
|
||||||
closeAutofillInlineMenu: ({ message, port }) => this.closeInlineMenu(port.sender, message),
|
closeAutofillInlineMenu: ({ message, port }) => this.closeInlineMenu(port.sender, message),
|
||||||
|
|||||||
@@ -562,7 +562,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
|||||||
* Updates the position of the inline menu button.
|
* Updates the position of the inline menu button.
|
||||||
*/
|
*/
|
||||||
private updateInlineMenuButtonPosition() {
|
private updateInlineMenuButtonPosition() {
|
||||||
void this.sendExtensionMessage("updateAutofillInlineMenuPosition", {
|
this.sendPortMessage("updateAutofillInlineMenuPosition", {
|
||||||
overlayElement: AutofillOverlayElement.Button,
|
overlayElement: AutofillOverlayElement.Button,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -571,7 +571,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
|||||||
* Updates the position of the inline menu list.
|
* Updates the position of the inline menu list.
|
||||||
*/
|
*/
|
||||||
private updateInlineMenuListPosition() {
|
private updateInlineMenuListPosition() {
|
||||||
void this.sendExtensionMessage("updateAutofillInlineMenuPosition", {
|
this.sendPortMessage("updateAutofillInlineMenuPosition", {
|
||||||
overlayElement: AutofillOverlayElement.List,
|
overlayElement: AutofillOverlayElement.List,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user