Make linter happy
This commit is contained in:
parent
ca0fe76172
commit
79f849fd92
|
@ -45,6 +45,52 @@ export default class NotificationBackground {
|
|||
this.cleanupNotificationQueue();
|
||||
}
|
||||
|
||||
async processMessage(msg: any, sender: any, sendResponse: any) {
|
||||
switch (msg.command) {
|
||||
case 'bgGetDataForTab':
|
||||
await this.getDataForTab(sender.tab, msg.responseCommand);
|
||||
break;
|
||||
case 'bgCloseNotificationBar':
|
||||
await BrowserApi.tabSendMessageData(sender.tab, 'closeNotificationBar');
|
||||
break;
|
||||
case 'bgAdjustNotificationBar':
|
||||
await BrowserApi.tabSendMessageData(sender.tab, 'adjustNotificationBar', msg.data);
|
||||
break;
|
||||
case 'bgAddLogin':
|
||||
await this.addLogin(msg.login, sender.tab);
|
||||
break;
|
||||
case 'bgChangedPassword':
|
||||
await this.changedPassword(msg.data, sender.tab);
|
||||
break;
|
||||
case 'bgAddClose':
|
||||
case 'bgChangeClose':
|
||||
this.removeTabFromNotificationQueue(sender.tab);
|
||||
break;
|
||||
case 'bgAddSave':
|
||||
case 'bgChangeSave':
|
||||
await this.saveOrUpdateCredentials(sender.tab, msg.folder);
|
||||
break;
|
||||
case 'bgNeverSave':
|
||||
await this.saveNever(sender.tab);
|
||||
break;
|
||||
case 'collectPageDetailsResponse':
|
||||
switch (msg.sender) {
|
||||
case 'notificationBar':
|
||||
const forms = this.autofillService.getFormsWithPasswordFields(msg.details);
|
||||
await BrowserApi.tabSendMessageData(msg.tab, 'notificationBarPageDetails', {
|
||||
details: msg.details,
|
||||
forms: forms,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
async checkNotificationQueue(tab: any = null): Promise<any> {
|
||||
if (this.notificationQueue.length === 0) {
|
||||
return;
|
||||
|
@ -112,53 +158,6 @@ export default class NotificationBackground {
|
|||
}
|
||||
}
|
||||
|
||||
async processMessage(msg: any, sender: any, sendResponse: any) {
|
||||
switch (msg.command) {
|
||||
case 'bgGetDataForTab':
|
||||
await this.getDataForTab(sender.tab, msg.responseCommand);
|
||||
break;
|
||||
case 'bgCloseNotificationBar':
|
||||
await BrowserApi.tabSendMessageData(sender.tab, 'closeNotificationBar');
|
||||
break;
|
||||
case 'bgAdjustNotificationBar':
|
||||
await BrowserApi.tabSendMessageData(sender.tab, 'adjustNotificationBar', msg.data);
|
||||
break;
|
||||
case 'bgAddLogin':
|
||||
await this.addLogin(msg.login, sender.tab);
|
||||
break;
|
||||
case 'bgChangedPassword':
|
||||
await this.changedPassword(msg.data, sender.tab);
|
||||
break;
|
||||
case 'bgAddClose':
|
||||
case 'bgChangeClose':
|
||||
this.removeTabFromNotificationQueue(sender.tab);
|
||||
break;
|
||||
case 'bgAddSave':
|
||||
case 'bgChangeSave':
|
||||
await this.saveOrUpdateCredentials(sender.tab, msg.folder);
|
||||
break;
|
||||
case 'bgNeverSave':
|
||||
await this.saveNever(sender.tab);
|
||||
break;
|
||||
case 'collectPageDetailsResponse':
|
||||
switch (msg.sender) {
|
||||
case 'notificationBar':
|
||||
console.log('collectPageDetailsResponse for notificationBar received', msg.tab)
|
||||
const forms = this.autofillService.getFormsWithPasswordFields(msg.details);
|
||||
await BrowserApi.tabSendMessageData(msg.tab, 'notificationBarPageDetails', {
|
||||
details: msg.details,
|
||||
forms: forms,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private async addLogin(loginInfo: any, tab: any) {
|
||||
const loginDomain = Utils.getDomain(loginInfo.url);
|
||||
if (loginDomain == null) {
|
||||
|
|
|
@ -13,14 +13,7 @@ import { BrowserApi } from '../browser/browserApi';
|
|||
import MainBackground from './main.background';
|
||||
|
||||
import { Utils } from 'jslib-common/misc/utils';
|
||||
|
||||
import { PolicyType } from 'jslib-common/enums/policyType';
|
||||
|
||||
import AddChangePasswordQueueMessage from './models/addChangePasswordQueueMessage';
|
||||
import AddLoginQueueMessage from './models/addLoginQueueMessage';
|
||||
|
||||
export default class RuntimeBackground {
|
||||
private runtime: any;
|
||||
private autofillTimeout: any;
|
||||
private pageDetailsToAutoFill: any[] = [];
|
||||
private onInstalledReason: string = null;
|
||||
|
@ -72,7 +65,7 @@ export default class RuntimeBackground {
|
|||
const retryMessage = {
|
||||
commandToRetry: {
|
||||
...msg.retryItem,
|
||||
sender: sender
|
||||
sender: sender,
|
||||
},
|
||||
from: msg.from,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue