diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json
index da45b2756be..aa171074f5f 100644
--- a/apps/browser/src/_locales/en/messages.json
+++ b/apps/browser/src/_locales/en/messages.json
@@ -2111,25 +2111,49 @@
}
}
},
- "tryAutofillPageLoad": {
- "message": "Try auto-fill on page load?"
- },
- "tryAutofill": {
+ "howToAutofill": {
"message": "How to auto-fill"
},
- "autofillPageLoadInfo": {
- "message": "Login forms will automatically fill in matching credentials if you turn on auto-fill on page load."
- },
"autofillSelectInfo": {
- "message": "Select an item from this page to auto-fill the active tab's form."
+ "message": "Select an item from this page or use the shortcut: $COMMAND$. You can also try auto-fill on page load.",
+ "placeholders": {
+ "command": {
+ "content": "$1",
+ "example": "CTRL+Shift+L"
+ }
+ }
},
- "autofillTurnedOn": {
- "message": "Auto-fill on page load turned on"
+ "autofillSelectInfoNoCommand": {
+ "message": "Select an item from this page or set a shortcut in settings. You can also try auto-fill on page load."
},
- "turnOn": {
- "message": "Turn on"
+ "gotIt": {
+ "message": "Got it"
},
- "notNow": {
- "message": "Not now"
+ "autofillSettings": {
+ "message": "Auto-fill settings"
+ },
+ "autofillShortcut": {
+ "message": "Auto-fill keyboard shortcut"
+ },
+ "autofillShortcutNotSet": {
+ "message": "The auto-fill shortcut is not set. Change this in the browser's settings."
+ },
+ "autofillShortcutText": {
+ "message": "The auto-fill shortcut is: $COMMAND$. Change this in the browser's settings.",
+ "placeholders": {
+ "command": {
+ "content": "$1",
+ "example": "CTRL+Shift+L"
+ }
+ }
+ },
+ "autofillShortcutTextSafari": {
+ "message": "Default auto-fill shortcut: $COMMAND$.",
+ "placeholders": {
+ "command": {
+ "content": "$1",
+ "example": "CTRL+Shift+L"
+ }
+ }
}
}
diff --git a/apps/browser/src/popup/scss/box.scss b/apps/browser/src/popup/scss/box.scss
index ef13a7f5455..c026c780889 100644
--- a/apps/browser/src/popup/scss/box.scss
+++ b/apps/browser/src/popup/scss/box.scss
@@ -354,6 +354,7 @@
&.box-content-row-flex,
.box-content-row-flex,
&.box-content-row-checkbox,
+ &.box-content-row-link,
&.box-content-row-input,
&.box-content-row-slider,
&.box-content-row-multi {
@@ -398,6 +399,7 @@
}
&.box-content-row-checkbox,
+ &.box-content-row-link,
&.box-content-row-input,
&.box-content-row-slider {
padding-top: 10px;
diff --git a/apps/browser/src/popup/scss/buttons.scss b/apps/browser/src/popup/scss/buttons.scss
index 4c5141cf8f7..e9af536dc3d 100644
--- a/apps/browser/src/popup/scss/buttons.scss
+++ b/apps/browser/src/popup/scss/buttons.scss
@@ -28,7 +28,7 @@
&.callout-half {
font-weight: bold;
- max-width: 45%;
+ max-width: 50%;
}
&:hover:not([disabled]) {
diff --git a/apps/browser/src/popup/settings/autofill.component.html b/apps/browser/src/popup/settings/autofill.component.html
index c3a76e145e7..a3ff1936711 100644
--- a/apps/browser/src/popup/settings/autofill.component.html
+++ b/apps/browser/src/popup/settings/autofill.component.html
@@ -72,4 +72,19 @@
{{ "defaultUriMatchDetectionDesc" | i18n }}
+
+
+
+
+
+
diff --git a/apps/browser/src/popup/settings/autofill.component.ts b/apps/browser/src/popup/settings/autofill.component.ts
index 7c949921b87..dfe5925e2e7 100644
--- a/apps/browser/src/popup/settings/autofill.component.ts
+++ b/apps/browser/src/popup/settings/autofill.component.ts
@@ -1,6 +1,7 @@
import { Component, OnInit } from "@angular/core";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
+import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
import { StateService } from "@bitwarden/common/abstractions/state.service";
import { UriMatchType } from "@bitwarden/common/enums/uriMatchType";
@@ -16,8 +17,13 @@ export class AutofillComponent implements OnInit {
autoFillOnPageLoadOptions: any[];
defaultUriMatch = UriMatchType.Domain;
uriMatchOptions: any[];
+ autofillKeyboardHelperText: string;
- constructor(private stateService: StateService, i18nService: I18nService) {
+ constructor(
+ private stateService: StateService,
+ private i18nService: I18nService,
+ private platformUtilsService: PlatformUtilsService
+ ) {
this.autoFillOnPageLoadOptions = [
{ name: i18nService.t("autoFillOnPageLoadYes"), value: true },
{ name: i18nService.t("autoFillOnPageLoadNo"), value: false },
@@ -40,6 +46,9 @@ export class AutofillComponent implements OnInit {
const defaultUriMatch = await this.stateService.getDefaultUriMatch();
this.defaultUriMatch = defaultUriMatch == null ? UriMatchType.Domain : defaultUriMatch;
+
+ const command = await this.platformUtilsService.getAutofillKeyboardShortcut();
+ await this.setAutofillKeyboardHelperText(command);
}
async updateAutoFillOnPageLoad() {
@@ -57,4 +66,26 @@ export class AutofillComponent implements OnInit {
AboutAutofill() {
BrowserApi.createNewTab("https://bitwarden.com/help/auto-fill-browser/");
}
+
+ private async setAutofillKeyboardHelperText(command: string) {
+ if (command) {
+ this.autofillKeyboardHelperText = this.i18nService.t("autofillShortcutText", command);
+ } else {
+ this.autofillKeyboardHelperText = this.i18nService.t("autofillShortcutNotSet");
+ }
+ }
+
+ async commandSettings() {
+ if (this.platformUtilsService.isChrome()) {
+ BrowserApi.createNewTab("chrome://extensions/shortcuts");
+ } else if (this.platformUtilsService.isOpera()) {
+ BrowserApi.createNewTab("opera://extensions/shortcuts");
+ } else if (this.platformUtilsService.isEdge()) {
+ BrowserApi.createNewTab("edge://extensions/shortcuts");
+ } else if (this.platformUtilsService.isVivaldi()) {
+ BrowserApi.createNewTab("vivaldi://extensions/shortcuts");
+ } else {
+ BrowserApi.createNewTab("https://bitwarden.com/help/keyboard-shortcuts");
+ }
+ }
}
diff --git a/apps/browser/src/services/browserPlatformUtils.service.ts b/apps/browser/src/services/browserPlatformUtils.service.ts
index 3d33fa174ec..2f4e2329968 100644
--- a/apps/browser/src/services/browserPlatformUtils.service.ts
+++ b/apps/browser/src/services/browserPlatformUtils.service.ts
@@ -377,4 +377,31 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
supportsSecureStorage(): boolean {
return false;
}
+
+ async getAutofillKeyboardShortcut(): Promise {
+ let autofillCommand: string;
+ // You can not change the command in Safari or obtain it programmatically
+ if (this.isSafari()) {
+ autofillCommand = "Cmd+Shift+L";
+ } else if (this.isFirefox()) {
+ autofillCommand = (await browser.commands.getAll()).find(
+ (c) => c.name === "autofill_login"
+ ).shortcut;
+ // Firefox is returing Ctrl instead of Cmd for the modifier key on macOS if
+ // the command is the default one set on installation.
+ if (
+ (await browser.runtime.getPlatformInfo()).os === "mac" &&
+ autofillCommand === "Ctrl+Shift+L"
+ ) {
+ autofillCommand = "Cmd+Shift+L";
+ }
+ } else {
+ await new Promise((resolve) =>
+ chrome.commands.getAll((c) =>
+ resolve((autofillCommand = c.find((c) => c.name === "autofill_login").shortcut))
+ )
+ );
+ }
+ return autofillCommand;
+ }
}
diff --git a/apps/browser/src/vault/popup/components/vault/current-tab.component.html b/apps/browser/src/vault/popup/components/vault/current-tab.component.html
index f2cc0305720..bec06919433 100644
--- a/apps/browser/src/vault/popup/components/vault/current-tab.component.html
+++ b/apps/browser/src/vault/popup/components/vault/current-tab.component.html
@@ -36,27 +36,20 @@
-
- {{ "autofillPageLoadInfo" | i18n }}
+
+ {{ autofillCalloutText }}
-
-
- {{ "autofillSelectInfo" | i18n }}
-