mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
Remove old IE Edge hacks
This commit is contained in:
@@ -10,25 +10,23 @@ import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service';
|
||||
|
||||
export default class CommandsBackground {
|
||||
private isSafari: boolean;
|
||||
private isEdge: boolean;
|
||||
private isVivaldi: boolean;
|
||||
|
||||
constructor(private main: MainBackground, private passwordGenerationService: PasswordGenerationService,
|
||||
private platformUtilsService: PlatformUtilsService, private analytics: Analytics,
|
||||
private vaultTimeoutService: VaultTimeoutService) {
|
||||
this.isSafari = this.platformUtilsService.isSafari();
|
||||
this.isEdge = this.platformUtilsService.isEdge();
|
||||
this.isVivaldi = this.platformUtilsService.isVivaldi();
|
||||
}
|
||||
|
||||
async init() {
|
||||
if (this.isSafari || this.isEdge || this.isVivaldi) {
|
||||
if (this.isSafari || this.isVivaldi) {
|
||||
BrowserApi.messageListener('commands.background', async (msg: any, sender: any, sendResponse: any) => {
|
||||
if (msg.command === 'keyboardShortcutTriggered' && msg.shortcut) {
|
||||
await this.processCommand(msg.shortcut, sender);
|
||||
}
|
||||
});
|
||||
} else if (chrome && chrome.commands && !this.isEdge) {
|
||||
} else if (chrome && chrome.commands) {
|
||||
chrome.commands.onCommand.addListener(async (command: any) => {
|
||||
await this.processCommand(command);
|
||||
});
|
||||
@@ -52,11 +50,6 @@ export default class CommandsBackground {
|
||||
}
|
||||
|
||||
private async generatePasswordToClipboard() {
|
||||
if (this.isEdge) {
|
||||
// Edge does not support access to clipboard from background
|
||||
return;
|
||||
}
|
||||
|
||||
const options = (await this.passwordGenerationService.getOptions())[0];
|
||||
const password = await this.passwordGenerationService.generatePassword(options);
|
||||
this.platformUtilsService.copyToClipboard(password, { window: window });
|
||||
|
||||
Reference in New Issue
Block a user