2021-10-15 15:03:25 +02:00
|
|
|
import { CipherType } from 'jslib-common/enums/cipherType';
|
|
|
|
|
|
|
|
import { CipherView } from 'jslib-common/models/view/cipherView';
|
|
|
|
import { LoginUriView } from 'jslib-common/models/view/loginUriView';
|
|
|
|
import { LoginView } from 'jslib-common/models/view/loginView';
|
|
|
|
|
|
|
|
import { CipherService } from 'jslib-common/abstractions/cipher.service';
|
|
|
|
import { FolderService } from 'jslib-common/abstractions/folder.service';
|
|
|
|
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
|
|
|
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
|
|
|
import { VaultTimeoutService } from 'jslib-common/abstractions/vaultTimeout.service';
|
|
|
|
import { ConstantsService } from 'jslib-common/services/constants.service';
|
|
|
|
import { AutofillService } from '../services/abstractions/autofill.service';
|
|
|
|
|
|
|
|
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';
|
2021-10-19 12:10:31 +02:00
|
|
|
import AddLoginRuntimeMessage from './models/addLoginRuntimeMessage';
|
|
|
|
import ChangePasswordRuntimeMessage from './models/changePasswordRuntimeMessage';
|
2021-10-19 11:20:55 +02:00
|
|
|
import LockedVaultPendingNotificationsItem from './models/lockedVaultPendingNotificationsItem';
|
2021-10-20 15:11:46 +02:00
|
|
|
import { NotificationQueueMessageType } from './models/notificationQueueMessageType';
|
2021-10-15 15:03:25 +02:00
|
|
|
|
|
|
|
export default class NotificationBackground {
|
2021-10-15 15:09:13 +02:00
|
|
|
|
2021-10-15 19:47:48 +02:00
|
|
|
private notificationQueue: (AddLoginQueueMessage | AddChangePasswordQueueMessage)[] = [];
|
2021-10-15 15:09:13 +02:00
|
|
|
|
2021-10-15 15:03:25 +02:00
|
|
|
constructor(private main: MainBackground, private autofillService: AutofillService,
|
|
|
|
private cipherService: CipherService, private storageService: StorageService,
|
|
|
|
private vaultTimeoutService: VaultTimeoutService, private policyService: PolicyService,
|
|
|
|
private folderService: FolderService) {
|
|
|
|
}
|
|
|
|
|
|
|
|
async init() {
|
2021-10-18 16:31:59 +02:00
|
|
|
if (chrome.runtime == null) {
|
2021-10-15 15:03:25 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-18 16:34:14 +02:00
|
|
|
BrowserApi.messageListener('notification.background', async (msg: any, sender: chrome.runtime.MessageSender) => {
|
|
|
|
await this.processMessage(msg, sender);
|
2021-10-15 15:03:25 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
this.cleanupNotificationQueue();
|
|
|
|
}
|
|
|
|
|
2021-10-18 16:34:14 +02:00
|
|
|
async processMessage(msg: any, sender: chrome.runtime.MessageSender) {
|
2021-10-15 15:32:56 +02:00
|
|
|
switch (msg.command) {
|
2021-10-18 16:41:42 +02:00
|
|
|
case 'unlockCompleted':
|
|
|
|
if (msg.data.target !== 'notification.background') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
await this.processMessage(msg.data.commandToRetry.msg, msg.data.commandToRetry.sender);
|
|
|
|
break;
|
2021-10-15 15:32:56 +02:00
|
|
|
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':
|
2021-10-18 16:42:32 +02:00
|
|
|
if (await this.vaultTimeoutService.isLocked()) {
|
2021-10-19 11:20:55 +02:00
|
|
|
const retryMessage: LockedVaultPendingNotificationsItem = {
|
2021-10-18 16:42:32 +02:00
|
|
|
commandToRetry: {
|
|
|
|
msg: msg,
|
|
|
|
sender: sender,
|
|
|
|
},
|
|
|
|
target: 'notification.background',
|
|
|
|
};
|
|
|
|
await BrowserApi.tabSendMessageData(sender.tab, 'addToLockedVaultPendingNotifications', retryMessage);
|
|
|
|
await BrowserApi.tabSendMessageData(sender.tab, 'promptForLogin');
|
|
|
|
return;
|
|
|
|
}
|
2021-10-15 15:32:56 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-15 19:42:05 +02:00
|
|
|
async checkNotificationQueue(tab: chrome.tabs.Tab = null): Promise<void> {
|
2021-10-15 15:09:13 +02:00
|
|
|
if (this.notificationQueue.length === 0) {
|
2021-10-15 15:03:25 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tab != null) {
|
|
|
|
this.doNotificationQueueCheck(tab);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const currentTab = await BrowserApi.getTabFromCurrentWindow();
|
|
|
|
if (currentTab != null) {
|
|
|
|
this.doNotificationQueueCheck(currentTab);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private cleanupNotificationQueue() {
|
2021-10-15 15:09:13 +02:00
|
|
|
for (let i = this.notificationQueue.length - 1; i >= 0; i--) {
|
|
|
|
if (this.notificationQueue[i].expires < new Date()) {
|
|
|
|
this.notificationQueue.splice(i, 1);
|
2021-10-15 15:03:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
setTimeout(() => this.cleanupNotificationQueue(), 2 * 60 * 1000); // check every 2 minutes
|
|
|
|
}
|
|
|
|
|
2021-10-15 19:42:05 +02:00
|
|
|
private doNotificationQueueCheck(tab: chrome.tabs.Tab): void {
|
2021-10-15 15:03:25 +02:00
|
|
|
if (tab == null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const tabDomain = Utils.getDomain(tab.url);
|
|
|
|
if (tabDomain == null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-15 15:09:13 +02:00
|
|
|
for (let i = 0; i < this.notificationQueue.length; i++) {
|
|
|
|
if (this.notificationQueue[i].tabId !== tab.id || this.notificationQueue[i].domain !== tabDomain) {
|
2021-10-15 15:03:25 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2021-10-15 19:47:48 +02:00
|
|
|
if (this.notificationQueue[i].type === NotificationQueueMessageType.addLogin) {
|
2021-10-15 15:03:25 +02:00
|
|
|
BrowserApi.tabSendMessageData(tab, 'openNotificationBar', {
|
|
|
|
type: 'add',
|
|
|
|
typeData: {
|
2021-10-15 15:09:13 +02:00
|
|
|
isVaultLocked: this.notificationQueue[i].wasVaultLocked,
|
2021-10-15 15:03:25 +02:00
|
|
|
},
|
|
|
|
});
|
2021-10-15 19:47:48 +02:00
|
|
|
} else if (this.notificationQueue[i].type === NotificationQueueMessageType.changePassword) {
|
2021-10-15 15:03:25 +02:00
|
|
|
BrowserApi.tabSendMessageData(tab, 'openNotificationBar', {
|
|
|
|
type: 'change',
|
|
|
|
typeData: {
|
2021-10-15 15:09:13 +02:00
|
|
|
isVaultLocked: this.notificationQueue[i].wasVaultLocked,
|
2021-10-15 15:03:25 +02:00
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-15 19:42:05 +02:00
|
|
|
private removeTabFromNotificationQueue(tab: chrome.tabs.Tab) {
|
2021-10-15 15:09:13 +02:00
|
|
|
for (let i = this.notificationQueue.length - 1; i >= 0; i--) {
|
|
|
|
if (this.notificationQueue[i].tabId === tab.id) {
|
|
|
|
this.notificationQueue.splice(i, 1);
|
2021-10-15 15:03:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-19 12:10:31 +02:00
|
|
|
private async addLogin(loginInfo: AddLoginRuntimeMessage, tab: chrome.tabs.Tab) {
|
2021-10-15 15:03:25 +02:00
|
|
|
const loginDomain = Utils.getDomain(loginInfo.url);
|
|
|
|
if (loginDomain == null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
let normalizedUsername = loginInfo.username;
|
|
|
|
if (normalizedUsername != null) {
|
|
|
|
normalizedUsername = normalizedUsername.toLowerCase();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (await this.vaultTimeoutService.isLocked()) {
|
2021-11-02 10:09:44 +01:00
|
|
|
if (!await this.allowPersonalOwnership()) {
|
2021-10-29 18:50:55 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-15 15:03:25 +02:00
|
|
|
this.pushAddLoginToQueue(loginDomain, loginInfo, tab, true);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const ciphers = await this.cipherService.getAllDecryptedForUrl(loginInfo.url);
|
|
|
|
const usernameMatches = ciphers.filter(c =>
|
|
|
|
c.login.username != null && c.login.username.toLowerCase() === normalizedUsername);
|
|
|
|
if (usernameMatches.length === 0) {
|
|
|
|
const disabledAddLogin = await this.storageService.get<boolean>(
|
|
|
|
ConstantsService.disableAddLoginNotificationKey);
|
|
|
|
if (disabledAddLogin) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-11-02 10:09:44 +01:00
|
|
|
if (!await this.allowPersonalOwnership()) {
|
2021-10-15 15:03:25 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.pushAddLoginToQueue(loginDomain, loginInfo, tab);
|
|
|
|
|
|
|
|
} else if (usernameMatches.length === 1 && usernameMatches[0].login.password !== loginInfo.password) {
|
|
|
|
const disabledChangePassword = await this.storageService.get<boolean>(
|
|
|
|
ConstantsService.disableChangedPasswordNotificationKey);
|
|
|
|
if (disabledChangePassword) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.pushChangePasswordToQueue(usernameMatches[0].id, loginDomain, loginInfo.password, tab);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-19 12:10:31 +02:00
|
|
|
private async pushAddLoginToQueue(loginDomain: string, loginInfo: AddLoginRuntimeMessage, tab: chrome.tabs.Tab, isVaultLocked: boolean = false) {
|
2021-10-15 15:03:25 +02:00
|
|
|
// remove any old messages for this tab
|
|
|
|
this.removeTabFromNotificationQueue(tab);
|
|
|
|
const message: AddLoginQueueMessage = {
|
2021-10-15 19:47:48 +02:00
|
|
|
type: NotificationQueueMessageType.addLogin,
|
2021-10-15 15:03:25 +02:00
|
|
|
username: loginInfo.username,
|
|
|
|
password: loginInfo.password,
|
|
|
|
domain: loginDomain,
|
|
|
|
uri: loginInfo.url,
|
|
|
|
tabId: tab.id,
|
|
|
|
expires: new Date((new Date()).getTime() + 5 * 60000), // 5 minutes
|
|
|
|
wasVaultLocked: isVaultLocked,
|
|
|
|
};
|
2021-10-15 15:09:13 +02:00
|
|
|
this.notificationQueue.push(message);
|
2021-10-15 15:03:25 +02:00
|
|
|
await this.checkNotificationQueue(tab);
|
|
|
|
}
|
|
|
|
|
2021-10-19 12:10:31 +02:00
|
|
|
private async changedPassword(changeData: ChangePasswordRuntimeMessage, tab: chrome.tabs.Tab) {
|
2021-10-15 15:03:25 +02:00
|
|
|
const loginDomain = Utils.getDomain(changeData.url);
|
|
|
|
if (loginDomain == null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (await this.vaultTimeoutService.isLocked()) {
|
|
|
|
this.pushChangePasswordToQueue(null, loginDomain, changeData.newPassword, tab, true);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
let id: string = null;
|
|
|
|
const ciphers = await this.cipherService.getAllDecryptedForUrl(changeData.url);
|
|
|
|
if (changeData.currentPassword != null) {
|
|
|
|
const passwordMatches = ciphers.filter(c => c.login.password === changeData.currentPassword);
|
|
|
|
if (passwordMatches.length === 1) {
|
|
|
|
id = passwordMatches[0].id;
|
|
|
|
}
|
|
|
|
} else if (ciphers.length === 1) {
|
|
|
|
id = ciphers[0].id;
|
|
|
|
}
|
|
|
|
if (id != null) {
|
|
|
|
this.pushChangePasswordToQueue(id, loginDomain, changeData.newPassword, tab);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-15 19:42:05 +02:00
|
|
|
private async pushChangePasswordToQueue(cipherId: string, loginDomain: string, newPassword: string, tab: chrome.tabs.Tab, isVaultLocked: boolean = false) {
|
2021-10-15 15:03:25 +02:00
|
|
|
// remove any old messages for this tab
|
|
|
|
this.removeTabFromNotificationQueue(tab);
|
|
|
|
const message: AddChangePasswordQueueMessage = {
|
2021-10-15 19:47:48 +02:00
|
|
|
type: NotificationQueueMessageType.changePassword,
|
2021-10-15 15:03:25 +02:00
|
|
|
cipherId: cipherId,
|
|
|
|
newPassword: newPassword,
|
|
|
|
domain: loginDomain,
|
|
|
|
tabId: tab.id,
|
|
|
|
expires: new Date((new Date()).getTime() + 5 * 60000), // 5 minutes
|
|
|
|
wasVaultLocked: isVaultLocked,
|
|
|
|
};
|
2021-10-15 15:09:13 +02:00
|
|
|
this.notificationQueue.push(message);
|
2021-10-15 15:03:25 +02:00
|
|
|
await this.checkNotificationQueue(tab);
|
|
|
|
}
|
|
|
|
|
2021-10-15 19:42:05 +02:00
|
|
|
private async saveOrUpdateCredentials(tab: chrome.tabs.Tab, folderId?: string) {
|
2021-10-15 15:09:13 +02:00
|
|
|
for (let i = this.notificationQueue.length - 1; i >= 0; i--) {
|
|
|
|
const queueMessage = this.notificationQueue[i];
|
2021-10-15 15:03:25 +02:00
|
|
|
if (queueMessage.tabId !== tab.id ||
|
2021-10-15 19:47:48 +02:00
|
|
|
(queueMessage.type !== NotificationQueueMessageType.addLogin && queueMessage.type !== NotificationQueueMessageType.changePassword)) {
|
2021-10-15 15:03:25 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
const tabDomain = Utils.getDomain(tab.url);
|
|
|
|
if (tabDomain != null && tabDomain !== queueMessage.domain) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2021-10-15 15:09:13 +02:00
|
|
|
this.notificationQueue.splice(i, 1);
|
2021-10-15 15:03:25 +02:00
|
|
|
BrowserApi.tabSendMessageData(tab, 'closeNotificationBar');
|
|
|
|
|
2021-10-15 19:47:48 +02:00
|
|
|
if (queueMessage.type === NotificationQueueMessageType.changePassword) {
|
2021-10-15 15:03:25 +02:00
|
|
|
const message = (queueMessage as AddChangePasswordQueueMessage);
|
|
|
|
const cipher = await this.getDecryptedCipherById(message.cipherId);
|
|
|
|
if (cipher == null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
await this.updateCipher(cipher, message.newPassword);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!queueMessage.wasVaultLocked) {
|
2021-10-15 19:47:48 +02:00
|
|
|
await this.createNewCipher(queueMessage as AddLoginQueueMessage, folderId);
|
2021-10-15 15:03:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// If the vault was locked, check if a cipher needs updating instead of creating a new one
|
2021-10-15 19:47:48 +02:00
|
|
|
if (queueMessage.type === NotificationQueueMessageType.addLogin && queueMessage.wasVaultLocked === true) {
|
2021-10-15 15:03:25 +02:00
|
|
|
const message = (queueMessage as AddLoginQueueMessage);
|
|
|
|
const ciphers = await this.cipherService.getAllDecryptedForUrl(message.uri);
|
|
|
|
const usernameMatches = ciphers.filter(c => c.login.username != null &&
|
|
|
|
c.login.username.toLowerCase() === message.username);
|
|
|
|
|
|
|
|
if (usernameMatches.length >= 1) {
|
|
|
|
await this.updateCipher(usernameMatches[0], message.password);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
await this.createNewCipher(message, folderId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private async createNewCipher(queueMessage: AddLoginQueueMessage, folderId: string) {
|
|
|
|
const loginModel = new LoginView();
|
|
|
|
const loginUri = new LoginUriView();
|
|
|
|
loginUri.uri = queueMessage.uri;
|
|
|
|
loginModel.uris = [loginUri];
|
|
|
|
loginModel.username = queueMessage.username;
|
|
|
|
loginModel.password = queueMessage.password;
|
|
|
|
const model = new CipherView();
|
|
|
|
model.name = Utils.getHostname(queueMessage.uri) || queueMessage.domain;
|
|
|
|
model.name = model.name.replace(/^www\./, '');
|
|
|
|
model.type = CipherType.Login;
|
|
|
|
model.login = loginModel;
|
|
|
|
|
|
|
|
if (!Utils.isNullOrWhitespace(folderId)) {
|
|
|
|
const folders = await this.folderService.getAllDecrypted();
|
|
|
|
if (folders.some(x => x.id === folderId)) {
|
|
|
|
model.folderId = folderId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const cipher = await this.cipherService.encrypt(model);
|
|
|
|
await this.cipherService.saveWithServer(cipher);
|
|
|
|
}
|
|
|
|
|
|
|
|
private async getDecryptedCipherById(cipherId: string) {
|
|
|
|
const cipher = await this.cipherService.get(cipherId);
|
|
|
|
if (cipher != null && cipher.type === CipherType.Login) {
|
|
|
|
return await cipher.decrypt();
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
private async updateCipher(cipher: CipherView, newPassword: string) {
|
|
|
|
if (cipher != null && cipher.type === CipherType.Login) {
|
|
|
|
cipher.login.password = newPassword;
|
|
|
|
const newCipher = await this.cipherService.encrypt(cipher);
|
|
|
|
await this.cipherService.saveWithServer(newCipher);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-15 19:42:05 +02:00
|
|
|
private async saveNever(tab: chrome.tabs.Tab) {
|
2021-10-15 15:09:13 +02:00
|
|
|
for (let i = this.notificationQueue.length - 1; i >= 0; i--) {
|
|
|
|
const queueMessage = this.notificationQueue[i];
|
2021-10-15 19:47:48 +02:00
|
|
|
if (queueMessage.tabId !== tab.id || queueMessage.type !== NotificationQueueMessageType.addLogin) {
|
2021-10-15 15:03:25 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
const tabDomain = Utils.getDomain(tab.url);
|
|
|
|
if (tabDomain != null && tabDomain !== queueMessage.domain) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2021-10-15 15:09:13 +02:00
|
|
|
this.notificationQueue.splice(i, 1);
|
2021-10-15 15:03:25 +02:00
|
|
|
BrowserApi.tabSendMessageData(tab, 'closeNotificationBar');
|
|
|
|
|
|
|
|
const hostname = Utils.getHostname(tab.url);
|
|
|
|
await this.cipherService.saveNeverDomain(hostname);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-15 19:42:05 +02:00
|
|
|
private async getDataForTab(tab: chrome.tabs.Tab, responseCommand: string) {
|
2021-10-15 15:03:25 +02:00
|
|
|
const responseData: any = {};
|
|
|
|
if (responseCommand === 'notificationBarGetFoldersList') {
|
|
|
|
responseData.folders = await this.folderService.getAllDecrypted();
|
|
|
|
}
|
|
|
|
|
|
|
|
await BrowserApi.tabSendMessageData(tab, responseCommand, responseData);
|
|
|
|
}
|
|
|
|
|
|
|
|
private async allowPersonalOwnership(): Promise<boolean> {
|
|
|
|
return !await this.policyService.policyAppliesToUser(PolicyType.PersonalOwnership);
|
|
|
|
}
|
|
|
|
}
|