1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

History of generated passwords (#310)

* Save last 5 passwords.

* Move password history to seperate page.

* Use the util helpers for accessing the local storage.

* Change close to back for password history. Remove unused html.

* Change orderBy to use the date instead of magic array.

* Move historyService to background.

* Add passwords generated from shortcut and contextmenu to history.

* Fix return to edit/add not working in password generator history.

* Change password icon to clipboard.

* Change link to password history to use on-click.

* Clear password generator history on logout.

* Code style fix.

* Add new .wrap class for wrapping long text. Fix password icon.
This commit is contained in:
Oscar Hinton
2017-10-17 22:42:05 +02:00
committed by Kyle Spearrin
parent 358fb9b277
commit f1262147a3
11 changed files with 186 additions and 5 deletions

View File

@@ -45,7 +45,7 @@ var bg_isBackground = true,
setIcon, refreshBadgeAndMenu);
bg_syncService = new SyncService(bg_cipherService, bg_folderService, bg_userService, bg_apiService, bg_settingsService,
bg_cryptoService, logout);
bg_passwordGenerationService = new PasswordGenerationService();
bg_passwordGenerationService = new PasswordGenerationService(bg_constantsService, bg_utilsService, bg_cryptoService);
bg_totpService = new TotpService(bg_constantsService);
bg_autofillService = new AutofillService(bg_utilsService, bg_totpService, bg_tokenService, bg_cipherService);
@@ -59,6 +59,7 @@ var bg_isBackground = true,
bg_passwordGenerationService.getOptions().then(function (options) {
var password = bg_passwordGenerationService.generatePassword(options);
bg_utilsService.copyToClipboard(password);
bg_passwordGenerationService.addHistory(password);
});
}
else if (command === 'autofill_login') {
@@ -193,6 +194,7 @@ var bg_isBackground = true,
bg_passwordGenerationService.getOptions().then(function (options) {
var password = bg_passwordGenerationService.generatePassword(options);
bg_utilsService.copyToClipboard(password);
bg_passwordGenerationService.addHistory(password);
});
}
else if (info.parentMenuItemId === 'autofill' || info.parentMenuItemId === 'copy-username' ||
@@ -817,7 +819,8 @@ var bg_isBackground = true,
bg_userService.clear(),
bg_settingsService.clear(userId),
bg_cipherService.clear(userId),
bg_folderService.clear(userId)
bg_folderService.clear(userId),
bg_passwordGenerationService.clear()
]).then(function () {
chrome.runtime.sendMessage({
command: 'doneLoggingOut', expired: expired