mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +00:00
@@ -9,10 +9,12 @@ import LockedVaultPendingNotificationsItem from './models/lockedVaultPendingNoti
|
|||||||
|
|
||||||
export default class CommandsBackground {
|
export default class CommandsBackground {
|
||||||
private isSafari: boolean;
|
private isSafari: boolean;
|
||||||
|
private isVivaldi: boolean;
|
||||||
|
|
||||||
constructor(private main: MainBackground, private passwordGenerationService: PasswordGenerationService,
|
constructor(private main: MainBackground, private passwordGenerationService: PasswordGenerationService,
|
||||||
private platformUtilsService: PlatformUtilsService, private vaultTimeoutService: VaultTimeoutService) {
|
private platformUtilsService: PlatformUtilsService, private vaultTimeoutService: VaultTimeoutService) {
|
||||||
this.isSafari = this.platformUtilsService.isSafari();
|
this.isSafari = this.platformUtilsService.isSafari();
|
||||||
|
this.isVivaldi = this.platformUtilsService.isVivaldi();
|
||||||
}
|
}
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
@@ -21,12 +23,12 @@ export default class CommandsBackground {
|
|||||||
await this.processCommand(msg.data.commandToRetry.msg.command, msg.data.commandToRetry.sender);
|
await this.processCommand(msg.data.commandToRetry.msg.command, msg.data.commandToRetry.sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.command === 'keyboardShortcutTriggered' && msg.shortcut) {
|
if (this.isVivaldi && msg.command === 'keyboardShortcutTriggered' && msg.shortcut) {
|
||||||
await this.processCommand(msg.shortcut, sender);
|
await this.processCommand(msg.shortcut, sender);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (chrome && chrome.commands) {
|
if (!this.isVivaldi && chrome && chrome.commands) {
|
||||||
chrome.commands.onCommand.addListener(async (command: string) => {
|
chrome.commands.onCommand.addListener(async (command: string) => {
|
||||||
await this.processCommand(command);
|
await this.processCommand(command);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user