1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 11:13:46 +00:00

Merge branch 'master' of https://github.com/bitwarden/browser into add-login-with-locked-vault

This commit is contained in:
Daniel James Smith
2021-10-08 12:45:35 +02:00
51 changed files with 395 additions and 275 deletions

View File

@@ -30,7 +30,7 @@ export default class ContextMenusBackground {
if (info.menuItemId === 'generate-password') {
await this.generatePasswordToClipboard();
} else if (info.menuItemId === 'copy-identifier') {
await this.getClickedElement();
await this.getClickedElement(info.frameId);
} else if (info.parentMenuItemId === 'autofill' ||
info.parentMenuItemId === 'copy-username' ||
info.parentMenuItemId === 'copy-password' ||
@@ -47,13 +47,13 @@ export default class ContextMenusBackground {
this.passwordGenerationService.addHistory(password);
}
private async getClickedElement() {
private async getClickedElement(frameId: number) {
const tab = await BrowserApi.getTabFromCurrentWindow();
if (tab == null) {
return;
}
BrowserApi.tabSendMessageData(tab, 'getClickedElement');
BrowserApi.tabSendMessage(tab, { command: 'getClickedElement' }, { frameId: frameId });
}
private async cipherAction(info: any) {

View File

@@ -147,7 +147,8 @@ export default class MainBackground {
constructor() {
// Services
this.messagingService = new BrowserMessagingService();
this.platformUtilsService = new BrowserPlatformUtilsService(this.messagingService,
this.storageService = new BrowserStorageService();
this.platformUtilsService = new BrowserPlatformUtilsService(this.messagingService, this.storageService,
(clipboardValue, clearMs) => {
if (this.systemService != null) {
this.systemService.clearClipboard(clipboardValue, clearMs);
@@ -166,7 +167,6 @@ export default class MainBackground {
return promise.then(result => result.response === 'unlocked');
}
});
this.storageService = new BrowserStorageService();
this.secureStorageService = new BrowserStorageService();
this.i18nService = new I18nService(BrowserApi.getUILanguage(window));
this.cryptoFunctionService = new WebCryptoFunctionService(window, this.platformUtilsService);