Skip to content

Commit ff09229

Browse files
committed
do not attempt inline menu insertion if it has been disabled for security concerns
1 parent fb52323 commit ff09229

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

apps/browser/src/autofill/overlay/inline-menu/content/autofill-inline-menu-content.service.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ export class AutofillInlineMenuContentService implements AutofillInlineMenuConte
166166
* Updates the position of both the inline menu button and inline menu list.
167167
*/
168168
private async appendInlineMenuElements({ overlayElement }: AutofillExtensionMessage) {
169+
if (!this.inlineMenuEnabled) {
170+
return;
171+
}
172+
169173
if (overlayElement === AutofillOverlayElement.Button) {
170174
return this.appendButtonElement();
171175
}
@@ -177,6 +181,10 @@ export class AutofillInlineMenuContentService implements AutofillInlineMenuConte
177181
* Updates the position of the inline menu button.
178182
*/
179183
private async appendButtonElement(): Promise<void> {
184+
if (!this.inlineMenuEnabled) {
185+
return;
186+
}
187+
180188
if (!this.buttonElement) {
181189
this.createButtonElement();
182190
this.updateCustomElementDefaultStyles(this.buttonElement);
@@ -193,6 +201,10 @@ export class AutofillInlineMenuContentService implements AutofillInlineMenuConte
193201
* Updates the position of the inline menu list.
194202
*/
195203
private async appendListElement(): Promise<void> {
204+
if (!this.inlineMenuEnabled) {
205+
return;
206+
}
207+
196208
if (!this.listElement) {
197209
this.createListElement();
198210
this.updateCustomElementDefaultStyles(this.listElement);

0 commit comments

Comments
 (0)