Linter updates and fixes (#1604)
This commit is contained in:
parent
dae739bc17
commit
1868b99d17
|
@ -66,7 +66,7 @@ export default class ContextMenusBackground {
|
||||||
}
|
}
|
||||||
|
|
||||||
const ciphers = await this.cipherService.getAllDecrypted();
|
const ciphers = await this.cipherService.getAllDecrypted();
|
||||||
const cipher = ciphers.find((c) => c.id === id);
|
const cipher = ciphers.find(c => c.id === id);
|
||||||
if (cipher == null) {
|
if (cipher == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,12 +78,12 @@ import TabsBackground from './tabs.background';
|
||||||
import WebRequestBackground from './webRequest.background';
|
import WebRequestBackground from './webRequest.background';
|
||||||
import WindowsBackground from './windows.background';
|
import WindowsBackground from './windows.background';
|
||||||
|
|
||||||
|
import { PopupUtilsService } from '../popup/services/popup-utils.service';
|
||||||
import AutofillService from '../services/autofill.service';
|
import AutofillService from '../services/autofill.service';
|
||||||
import BrowserMessagingService from '../services/browserMessaging.service';
|
import BrowserMessagingService from '../services/browserMessaging.service';
|
||||||
import BrowserPlatformUtilsService from '../services/browserPlatformUtils.service';
|
import BrowserPlatformUtilsService from '../services/browserPlatformUtils.service';
|
||||||
import BrowserStorageService from '../services/browserStorage.service';
|
import BrowserStorageService from '../services/browserStorage.service';
|
||||||
import I18nService from '../services/i18n.service';
|
import I18nService from '../services/i18n.service';
|
||||||
import { PopupUtilsService } from '../popup/services/popup-utils.service';
|
|
||||||
|
|
||||||
import { AutofillService as AutofillServiceAbstraction } from '../services/abstractions/autofill.service';
|
import { AutofillService as AutofillServiceAbstraction } from '../services/abstractions/autofill.service';
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ export default class MainBackground {
|
||||||
return Promise.reject(e);
|
return Promise.reject(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return promise.then((result) => result.response === 'unlocked');
|
return promise.then(result => result.response === 'unlocked');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.storageService = new BrowserStorageService();
|
this.storageService = new BrowserStorageService();
|
||||||
|
@ -279,7 +279,7 @@ export default class MainBackground {
|
||||||
await this.webRequestBackground.init();
|
await this.webRequestBackground.init();
|
||||||
await this.windowsBackground.init();
|
await this.windowsBackground.init();
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
await this.environmentService.setUrlsFromStorage();
|
await this.environmentService.setUrlsFromStorage();
|
||||||
await this.setIcon();
|
await this.setIcon();
|
||||||
|
@ -422,11 +422,11 @@ export default class MainBackground {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getStorage = (): Promise<any> => new Promise((resolve) => {
|
const getStorage = (): Promise<any> => new Promise(resolve => {
|
||||||
chrome.storage.local.get(null, (o: any) => resolve(o));
|
chrome.storage.local.get(null, (o: any) => resolve(o));
|
||||||
});
|
});
|
||||||
|
|
||||||
const clearStorage = (): Promise<void> => new Promise((resolve) => {
|
const clearStorage = (): Promise<void> => new Promise(resolve => {
|
||||||
chrome.storage.local.clear(() => resolve());
|
chrome.storage.local.clear(() => resolve());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -527,7 +527,7 @@ export default class MainBackground {
|
||||||
ciphers.sort((a, b) => this.cipherService.sortCiphersByLastUsedThenName(a, b));
|
ciphers.sort((a, b) => this.cipherService.sortCiphersByLastUsedThenName(a, b));
|
||||||
|
|
||||||
if (contextMenuEnabled) {
|
if (contextMenuEnabled) {
|
||||||
ciphers.forEach((cipher) => {
|
ciphers.forEach(cipher => {
|
||||||
this.loadLoginContextMenuOptions(cipher);
|
this.loadLoginContextMenuOptions(cipher);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -560,7 +560,7 @@ export default class MainBackground {
|
||||||
|
|
||||||
const tabs = await BrowserApi.getActiveTabs();
|
const tabs = await BrowserApi.getActiveTabs();
|
||||||
if (tabs != null) {
|
if (tabs != null) {
|
||||||
tabs.forEach((tab) => {
|
tabs.forEach(tab => {
|
||||||
if (tab.id != null) {
|
if (tab.id != null) {
|
||||||
this.browserActionSetBadgeText('', tab.id);
|
this.browserActionSetBadgeText('', tab.id);
|
||||||
this.sidebarActionSetBadgeText('', tab.id);
|
this.sidebarActionSetBadgeText('', tab.id);
|
||||||
|
@ -703,7 +703,7 @@ export default class MainBackground {
|
||||||
// Browser API Helpers
|
// Browser API Helpers
|
||||||
|
|
||||||
private contextMenusRemoveAll() {
|
private contextMenusRemoveAll() {
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
chrome.contextMenus.removeAll(() => {
|
chrome.contextMenus.removeAll(() => {
|
||||||
resolve();
|
resolve();
|
||||||
if (chrome.runtime.lastError) {
|
if (chrome.runtime.lastError) {
|
||||||
|
@ -714,7 +714,7 @@ export default class MainBackground {
|
||||||
}
|
}
|
||||||
|
|
||||||
private contextMenusCreate(options: any) {
|
private contextMenusCreate(options: any) {
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
chrome.contextMenus.create(options, () => {
|
chrome.contextMenus.create(options, () => {
|
||||||
resolve();
|
resolve();
|
||||||
if (chrome.runtime.lastError) {
|
if (chrome.runtime.lastError) {
|
||||||
|
@ -739,7 +739,7 @@ export default class MainBackground {
|
||||||
if (this.platformUtilsService.isFirefox()) {
|
if (this.platformUtilsService.isFirefox()) {
|
||||||
await theAction.setIcon(options);
|
await theAction.setIcon(options);
|
||||||
} else {
|
} else {
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
theAction.setIcon(options, () => resolve());
|
theAction.setIcon(options, () => resolve());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { ConstantsService } from 'jslib/services/constants.service';
|
|
||||||
import { AppIdService } from 'jslib/abstractions/appId.service';
|
import { AppIdService } from 'jslib/abstractions/appId.service';
|
||||||
import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service';
|
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
|
import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||||
import { StorageService } from 'jslib/abstractions/storage.service';
|
import { StorageService } from 'jslib/abstractions/storage.service';
|
||||||
import { UserService } from 'jslib/abstractions/user.service';
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service';
|
import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service';
|
||||||
|
import { ConstantsService } from 'jslib/services/constants.service';
|
||||||
|
|
||||||
import { Utils } from 'jslib/misc/utils';
|
import { Utils } from 'jslib/misc/utils';
|
||||||
import { SymmetricCryptoKey } from 'jslib/models/domain';
|
import { SymmetricCryptoKey } from 'jslib/models/domain';
|
||||||
|
@ -38,7 +38,7 @@ export class NativeMessagingBackground {
|
||||||
|
|
||||||
if (BrowserApi.isChromeApi) {
|
if (BrowserApi.isChromeApi) {
|
||||||
// Reload extension to activate nativeMessaging
|
// Reload extension to activate nativeMessaging
|
||||||
chrome.permissions.onAdded.addListener((permissions) => {
|
chrome.permissions.onAdded.addListener(permissions => {
|
||||||
BrowserApi.reloadExtension(null);
|
BrowserApi.reloadExtension(null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ export class NativeMessagingBackground {
|
||||||
this.sendUnencrypted({
|
this.sendUnencrypted({
|
||||||
command: 'setupEncryption',
|
command: 'setupEncryption',
|
||||||
publicKey: Utils.fromBufferToB64(publicKey),
|
publicKey: Utils.fromBufferToB64(publicKey),
|
||||||
userId: await this.userService.getUserId()
|
userId: await this.userService.getUserId(),
|
||||||
});
|
});
|
||||||
|
|
||||||
return new Promise((resolve, reject) => this.secureSetupResolve = resolve);
|
return new Promise((resolve, reject) => this.secureSetupResolve = resolve);
|
||||||
|
|
|
@ -4,10 +4,7 @@ import { CipherView } from 'jslib/models/view/cipherView';
|
||||||
import { LoginUriView } from 'jslib/models/view/loginUriView';
|
import { LoginUriView } from 'jslib/models/view/loginUriView';
|
||||||
import { LoginView } from 'jslib/models/view/loginView';
|
import { LoginView } from 'jslib/models/view/loginView';
|
||||||
|
|
||||||
import { AutofillService } from '../services/abstractions/autofill.service';
|
|
||||||
import BrowserPlatformUtilsService from '../services/browserPlatformUtils.service';
|
|
||||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||||
import { ConstantsService } from 'jslib/services/constants.service';
|
|
||||||
import { EnvironmentService } from 'jslib/abstractions/environment.service';
|
import { EnvironmentService } from 'jslib/abstractions/environment.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
import { NotificationsService } from 'jslib/abstractions/notifications.service';
|
import { NotificationsService } from 'jslib/abstractions/notifications.service';
|
||||||
|
@ -16,6 +13,9 @@ import { StorageService } from 'jslib/abstractions/storage.service';
|
||||||
import { SystemService } from 'jslib/abstractions/system.service';
|
import { SystemService } from 'jslib/abstractions/system.service';
|
||||||
import { UserService } from 'jslib/abstractions/user.service';
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service';
|
import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service';
|
||||||
|
import { ConstantsService } from 'jslib/services/constants.service';
|
||||||
|
import { AutofillService } from '../services/abstractions/autofill.service';
|
||||||
|
import BrowserPlatformUtilsService from '../services/browserPlatformUtils.service';
|
||||||
|
|
||||||
import { BrowserApi } from '../browser/browserApi';
|
import { BrowserApi } from '../browser/browserApi';
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ export default class RuntimeBackground {
|
||||||
const totpCode = await this.autofillService.doAutoFill({
|
const totpCode = await this.autofillService.doAutoFill({
|
||||||
cipher: this.main.loginToAutoFill,
|
cipher: this.main.loginToAutoFill,
|
||||||
pageDetails: this.pageDetailsToAutoFill,
|
pageDetails: this.pageDetailsToAutoFill,
|
||||||
fillNewPassword: true
|
fillNewPassword: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (totpCode != null) {
|
if (totpCode != null) {
|
||||||
|
@ -306,7 +306,7 @@ export default class RuntimeBackground {
|
||||||
}
|
}
|
||||||
|
|
||||||
const ciphers = await this.cipherService.getAllDecryptedForUrl(loginInfo.url);
|
const ciphers = await this.cipherService.getAllDecryptedForUrl(loginInfo.url);
|
||||||
const usernameMatches = ciphers.filter((c) =>
|
const usernameMatches = ciphers.filter(c =>
|
||||||
c.login.username != null && c.login.username.toLowerCase() === normalizedUsername);
|
c.login.username != null && c.login.username.toLowerCase() === normalizedUsername);
|
||||||
if (usernameMatches.length === 0) {
|
if (usernameMatches.length === 0) {
|
||||||
const disabledAddLogin = await this.storageService.get<boolean>(
|
const disabledAddLogin = await this.storageService.get<boolean>(
|
||||||
|
@ -354,7 +354,7 @@ export default class RuntimeBackground {
|
||||||
let id: string = null;
|
let id: string = null;
|
||||||
const ciphers = await this.cipherService.getAllDecryptedForUrl(changeData.url);
|
const ciphers = await this.cipherService.getAllDecryptedForUrl(changeData.url);
|
||||||
if (changeData.currentPassword != null) {
|
if (changeData.currentPassword != null) {
|
||||||
const passwordMatches = ciphers.filter((c) => c.login.password === changeData.currentPassword);
|
const passwordMatches = ciphers.filter(c => c.login.password === changeData.currentPassword);
|
||||||
if (passwordMatches.length === 1) {
|
if (passwordMatches.length === 1) {
|
||||||
id = passwordMatches[0].id;
|
id = passwordMatches[0].id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ export class BrowserApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
static async tabsQuery(options: any): Promise<any[]> {
|
static async tabsQuery(options: any): Promise<any[]> {
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
chrome.tabs.query(options, (tabs: any[]) => {
|
chrome.tabs.query(options, (tabs: any[]) => {
|
||||||
resolve(tabs);
|
resolve(tabs);
|
||||||
});
|
});
|
||||||
|
@ -65,7 +65,7 @@ export class BrowserApi {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
chrome.tabs.sendMessage(tab.id, obj, options, () => {
|
chrome.tabs.sendMessage(tab.id, obj, options, () => {
|
||||||
if (chrome.runtime.lastError) {
|
if (chrome.runtime.lastError) {
|
||||||
// Some error happened
|
// Some error happened
|
||||||
|
@ -155,7 +155,7 @@ export class BrowserApi {
|
||||||
|
|
||||||
static reloadOpenWindows() {
|
static reloadOpenWindows() {
|
||||||
const views = chrome.extension.getViews() as Window[];
|
const views = chrome.extension.getViews() as Window[];
|
||||||
views.filter((w) => w.location.href != null).forEach((w) => {
|
views.filter(w => w.location.href != null).forEach(w => {
|
||||||
w.location.reload();
|
w.location.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ export class SafariApp {
|
||||||
if (!BrowserApi.isSafariApi) {
|
if (!BrowserApi.isSafariApi) {
|
||||||
return Promise.resolve(null);
|
return Promise.resolve(null);
|
||||||
}
|
}
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const messageId = now.getTime().toString() + '_' + Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
|
const messageId = now.getTime().toString() + '_' + Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
|
||||||
(browser as any).runtime.sendNativeMessage('com.bitwarden.desktop', {
|
(browser as any).runtime.sendNativeMessage('com.bitwarden.desktop', {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
document.addEventListener('DOMContentLoaded', (event) => {
|
document.addEventListener('DOMContentLoaded', event => {
|
||||||
let pageHref: string = null;
|
let pageHref: string = null;
|
||||||
let filledThisHref = false;
|
let filledThisHref = false;
|
||||||
let delayFillTimeout: number;
|
let delayFillTimeout: number;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
document.addEventListener('DOMContentLoaded', (event) => {
|
document.addEventListener('DOMContentLoaded', event => {
|
||||||
if (window.location.hostname.indexOf('vault.bitwarden.com') > -1) {
|
if (window.location.hostname.indexOf('vault.bitwarden.com') > -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
|
||||||
function observeDom() {
|
function observeDom() {
|
||||||
const bodies = document.querySelectorAll('body');
|
const bodies = document.querySelectorAll('body');
|
||||||
if (bodies && bodies.length > 0) {
|
if (bodies && bodies.length > 0) {
|
||||||
observer = new MutationObserver((mutations) => {
|
observer = new MutationObserver(mutations => {
|
||||||
if (mutations == null || mutations.length === 0 || pageHref !== window.location.href) {
|
if (mutations == null || mutations.length === 0 || pageHref !== window.location.href) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
|
||||||
} else {
|
} else {
|
||||||
const buttonText = getButtonText(getSubmitButton(form, changePasswordButtonNames));
|
const buttonText = getButtonText(getSubmitButton(form, changePasswordButtonNames));
|
||||||
const matches = Array.from(changePasswordButtonContainsNames)
|
const matches = Array.from(changePasswordButtonContainsNames)
|
||||||
.filter((n) => buttonText.indexOf(n) > -1);
|
.filter(n => buttonText.indexOf(n) > -1);
|
||||||
if (matches.length > 0) {
|
if (matches.length > 0) {
|
||||||
curPass = passwords[0];
|
curPass = passwords[0];
|
||||||
newPass = passwords[1];
|
newPass = passwords[1];
|
||||||
|
@ -379,7 +379,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
|
||||||
const possibleSubmitButtons = Array.from(wrappingEl.querySelectorAll('a, span, button[type="button"], ' +
|
const possibleSubmitButtons = Array.from(wrappingEl.querySelectorAll('a, span, button[type="button"], ' +
|
||||||
'input[type="button"], button:not([type])')) as HTMLElement[];
|
'input[type="button"], button:not([type])')) as HTMLElement[];
|
||||||
let typelessButton: HTMLElement = null;
|
let typelessButton: HTMLElement = null;
|
||||||
possibleSubmitButtons.forEach((button) => {
|
possibleSubmitButtons.forEach(button => {
|
||||||
if (submitButton != null || button == null || button.tagName == null) {
|
if (submitButton != null || button == null || button.tagName == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as Mousetrap from 'mousetrap';
|
import * as Mousetrap from 'mousetrap';
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', (event) => {
|
document.addEventListener('DOMContentLoaded', event => {
|
||||||
const isSafari = (typeof safari !== 'undefined') && navigator.userAgent.indexOf(' Safari/') !== -1 &&
|
const isSafari = (typeof safari !== 'undefined') && navigator.userAgent.indexOf(' Safari/') !== -1 &&
|
||||||
navigator.userAgent.indexOf('Chrome') === -1;
|
navigator.userAgent.indexOf('Chrome') === -1;
|
||||||
const isVivaldi = !isSafari && navigator.userAgent.indexOf(' Vivaldi/') !== -1;
|
const isVivaldi = !isSafari && navigator.userAgent.indexOf(' Vivaldi/') !== -1;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
window.addEventListener('message', (event) => {
|
window.addEventListener('message', event => {
|
||||||
if (event.source !== window)
|
if (event.source !== window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { NgModule, Injectable } from '@angular/core';
|
import { Injectable, NgModule } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
ActivatedRouteSnapshot,
|
ActivatedRouteSnapshot,
|
||||||
RouteReuseStrategy,
|
RouteReuseStrategy,
|
||||||
|
@ -17,12 +17,12 @@ import { LockComponent } from './accounts/lock.component';
|
||||||
import { LoginComponent } from './accounts/login.component';
|
import { LoginComponent } from './accounts/login.component';
|
||||||
import { RegisterComponent } from './accounts/register.component';
|
import { RegisterComponent } from './accounts/register.component';
|
||||||
import { SetPasswordComponent } from './accounts/set-password.component';
|
import { SetPasswordComponent } from './accounts/set-password.component';
|
||||||
|
import { SsoComponent } from './accounts/sso.component';
|
||||||
import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';
|
import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';
|
||||||
import { TwoFactorComponent } from './accounts/two-factor.component';
|
import { TwoFactorComponent } from './accounts/two-factor.component';
|
||||||
import { SsoComponent } from './accounts/sso.component';
|
|
||||||
|
|
||||||
import { PasswordGeneratorComponent } from './generator/password-generator.component';
|
|
||||||
import { PasswordGeneratorHistoryComponent } from './generator/password-generator-history.component';
|
import { PasswordGeneratorHistoryComponent } from './generator/password-generator-history.component';
|
||||||
|
import { PasswordGeneratorComponent } from './generator/password-generator.component';
|
||||||
|
|
||||||
import { PrivateModeComponent } from './private-mode.component';
|
import { PrivateModeComponent } from './private-mode.component';
|
||||||
import { TabsComponent } from './tabs.component';
|
import { TabsComponent } from './tabs.component';
|
||||||
|
|
|
@ -139,7 +139,7 @@ export class AppComponent implements OnInit {
|
||||||
|
|
||||||
BrowserApi.messageListener('app.component', (window as any).bitwardenPopupMainMessageListener);
|
BrowserApi.messageListener('app.component', (window as any).bitwardenPopupMainMessageListener);
|
||||||
|
|
||||||
this.router.events.subscribe((event) => {
|
this.router.events.subscribe(event => {
|
||||||
if (event instanceof NavigationEnd) {
|
if (event instanceof NavigationEnd) {
|
||||||
const url = event.urlAfterRedirects || event.url || '';
|
const url = event.urlAfterRedirects || event.url || '';
|
||||||
if (url.startsWith('/tabs/') && (window as any).previousPopupUrl != null &&
|
if (url.startsWith('/tabs/') && (window as any).previousPopupUrl != null &&
|
||||||
|
|
|
@ -22,9 +22,9 @@ import { LockComponent } from './accounts/lock.component';
|
||||||
import { LoginComponent } from './accounts/login.component';
|
import { LoginComponent } from './accounts/login.component';
|
||||||
import { RegisterComponent } from './accounts/register.component';
|
import { RegisterComponent } from './accounts/register.component';
|
||||||
import { SetPasswordComponent } from './accounts/set-password.component';
|
import { SetPasswordComponent } from './accounts/set-password.component';
|
||||||
|
import { SsoComponent } from './accounts/sso.component';
|
||||||
import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';
|
import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';
|
||||||
import { TwoFactorComponent } from './accounts/two-factor.component';
|
import { TwoFactorComponent } from './accounts/two-factor.component';
|
||||||
import { SsoComponent } from './accounts/sso.component';
|
|
||||||
|
|
||||||
import { PasswordGeneratorHistoryComponent } from './generator/password-generator-history.component';
|
import { PasswordGeneratorHistoryComponent } from './generator/password-generator-history.component';
|
||||||
import { PasswordGeneratorComponent } from './generator/password-generator.component';
|
import { PasswordGeneratorComponent } from './generator/password-generator.component';
|
||||||
|
@ -223,7 +223,7 @@ registerLocaleData(localeZhTw, 'zh-TW');
|
||||||
TwoFactorComponent,
|
TwoFactorComponent,
|
||||||
SsoComponent,
|
SsoComponent,
|
||||||
ViewComponent,
|
ViewComponent,
|
||||||
SetPasswordComponent
|
SetPasswordComponent,
|
||||||
],
|
],
|
||||||
entryComponents: [],
|
entryComponents: [],
|
||||||
providers: [
|
providers: [
|
||||||
|
|
|
@ -41,14 +41,14 @@ const FirstnameFieldNames: string[] = [
|
||||||
// English
|
// English
|
||||||
'f-name', 'first-name', 'given-name', 'first-n',
|
'f-name', 'first-name', 'given-name', 'first-n',
|
||||||
// German
|
// German
|
||||||
'vorname'
|
'vorname',
|
||||||
];
|
];
|
||||||
|
|
||||||
const LastnameFieldNames: string[] = [
|
const LastnameFieldNames: string[] = [
|
||||||
// English
|
// English
|
||||||
'l-name', 'last-name', 's-name', 'surname', 'family-name', 'family-n', 'last-n',
|
'l-name', 'last-name', 's-name', 'surname', 'family-name', 'family-n', 'last-n',
|
||||||
// German
|
// German
|
||||||
'nachname', 'familienname'
|
'nachname', 'familienname',
|
||||||
];
|
];
|
||||||
|
|
||||||
const ExcludedAutofillTypes: string[] = ['radio', 'checkbox', 'hidden', 'file', 'button', 'image', 'reset', 'search'];
|
const ExcludedAutofillTypes: string[] = ['radio', 'checkbox', 'hidden', 'file', 'button', 'image', 'reset', 'search'];
|
||||||
|
@ -150,7 +150,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const formPasswordFields = passwordFields.filter((pf) => formKey === pf.form);
|
const formPasswordFields = passwordFields.filter(pf => formKey === pf.form);
|
||||||
if (formPasswordFields.length > 0) {
|
if (formPasswordFields.length > 0) {
|
||||||
let uf = this.findUsernameField(pageDetails, formPasswordFields[0], false, false, false);
|
let uf = this.findUsernameField(pageDetails, formPasswordFields[0], false, false, false);
|
||||||
if (uf == null) {
|
if (uf == null) {
|
||||||
|
@ -215,7 +215,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
totpPromise = this.totpService.isAutoCopyEnabled().then((enabled) => {
|
totpPromise = this.totpService.isAutoCopyEnabled().then(enabled => {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
return this.totpService.getCode(options.cipher.login.totp);
|
return this.totpService.getCode(options.cipher.login.totp);
|
||||||
}
|
}
|
||||||
|
@ -369,13 +369,13 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
const passwordFieldsForForm: AutofillField[] = [];
|
const passwordFieldsForForm: AutofillField[] = [];
|
||||||
passwordFields.forEach((passField) => {
|
passwordFields.forEach(passField => {
|
||||||
if (formKey === passField.form) {
|
if (formKey === passField.form) {
|
||||||
passwordFieldsForForm.push(passField);
|
passwordFieldsForForm.push(passField);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
passwordFields.forEach((passField) => {
|
passwordFields.forEach(passField => {
|
||||||
pf = passField;
|
pf = passField;
|
||||||
passwords.push(pf);
|
passwords.push(pf);
|
||||||
|
|
||||||
|
@ -425,7 +425,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
usernames.forEach((u) => {
|
usernames.forEach(u => {
|
||||||
if (filledFields.hasOwnProperty(u.opid)) {
|
if (filledFields.hasOwnProperty(u.opid)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -434,7 +434,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||||
this.fillByOpid(fillScript, u, login.username);
|
this.fillByOpid(fillScript, u, login.username);
|
||||||
});
|
});
|
||||||
|
|
||||||
passwords.forEach((p) => {
|
passwords.forEach(p => {
|
||||||
if (filledFields.hasOwnProperty(p.opid)) {
|
if (filledFields.hasOwnProperty(p.opid)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -666,7 +666,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
let doesContain = false;
|
let doesContain = false;
|
||||||
CardAttributesExtended.forEach((attr) => {
|
CardAttributesExtended.forEach(attr => {
|
||||||
if (doesContain || !field.hasOwnProperty(attr) || !field[attr]) {
|
if (doesContain || !field.hasOwnProperty(attr) || !field[attr]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -924,7 +924,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||||
private loadPasswordFields(pageDetails: AutofillPageDetails, canBeHidden: boolean, canBeReadOnly: boolean,
|
private loadPasswordFields(pageDetails: AutofillPageDetails, canBeHidden: boolean, canBeReadOnly: boolean,
|
||||||
mustBeEmpty: boolean, fillNewPassword: boolean) {
|
mustBeEmpty: boolean, fillNewPassword: boolean) {
|
||||||
const arr: AutofillField[] = [];
|
const arr: AutofillField[] = [];
|
||||||
pageDetails.fields.forEach((f) => {
|
pageDetails.fields.forEach(f => {
|
||||||
const isPassword = f.type === 'password';
|
const isPassword = f.type === 'password';
|
||||||
const valueIsLikePassword = (value: string) => {
|
const valueIsLikePassword = (value: string) => {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
|
@ -938,7 +938,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
const ignoreList = ['onetimepassword', 'captcha', 'findanything'];
|
const ignoreList = ['onetimepassword', 'captcha', 'findanything'];
|
||||||
if (ignoreList.some((i) => cleanedValue.indexOf(i) > -1)) {
|
if (ignoreList.some(i => cleanedValue.indexOf(i) > -1)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
|
||||||
type: type,
|
type: type,
|
||||||
dialogId: dialogId,
|
dialogId: dialogId,
|
||||||
});
|
});
|
||||||
return new Promise<boolean>((resolve) => {
|
return new Promise<boolean>(resolve => {
|
||||||
this.showDialogResolves.set(dialogId, { resolve: resolve, date: new Date() });
|
this.showDialogResolves.set(dialogId, { resolve: resolve, date: new Date() });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
|
||||||
deleteIds.push(key);
|
deleteIds.push(key);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
deleteIds.forEach((id) => {
|
deleteIds.forEach(id => {
|
||||||
this.showDialogResolves.delete(id);
|
this.showDialogResolves.delete(id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ export default class BrowserStorageService implements StorageService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async get<T>(key: string): Promise<T> {
|
async get<T>(key: string): Promise<T> {
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
this.chromeStorageApi.get(key, (obj: any) => {
|
this.chromeStorageApi.get(key, (obj: any) => {
|
||||||
if (obj != null && obj[key] != null) {
|
if (obj != null && obj[key] != null) {
|
||||||
resolve(obj[key] as T);
|
resolve(obj[key] as T);
|
||||||
|
@ -22,7 +22,7 @@ export default class BrowserStorageService implements StorageService {
|
||||||
async save(key: string, obj: any): Promise<any> {
|
async save(key: string, obj: any): Promise<any> {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
// Fix safari not liking null in set
|
// Fix safari not liking null in set
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
this.chromeStorageApi.remove(key, () => {
|
this.chromeStorageApi.remove(key, () => {
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
|
@ -30,7 +30,7 @@ export default class BrowserStorageService implements StorageService {
|
||||||
}
|
}
|
||||||
|
|
||||||
const keyedObj = { [key]: obj };
|
const keyedObj = { [key]: obj };
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
this.chromeStorageApi.set(keyedObj, () => {
|
this.chromeStorageApi.set(keyedObj, () => {
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
|
@ -38,7 +38,7 @@ export default class BrowserStorageService implements StorageService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async remove(key: string): Promise<any> {
|
async remove(key: string): Promise<any> {
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
this.chromeStorageApi.remove(key, () => {
|
this.chromeStorageApi.remove(key, () => {
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
|
|
17
tslint.json
17
tslint.json
|
@ -50,9 +50,26 @@
|
||||||
"check-type"
|
"check-type"
|
||||||
],
|
],
|
||||||
"max-classes-per-file": false,
|
"max-classes-per-file": false,
|
||||||
|
"ordered-imports": true,
|
||||||
|
"arrow-parens": [
|
||||||
|
true,
|
||||||
|
"ban-single-arg-parens"
|
||||||
|
],
|
||||||
"semicolon": [
|
"semicolon": [
|
||||||
true,
|
true,
|
||||||
"always"
|
"always"
|
||||||
|
],
|
||||||
|
"trailing-comma": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"multiline": {
|
||||||
|
"objects": "always",
|
||||||
|
"arrays": "always",
|
||||||
|
"functions": "ignore",
|
||||||
|
"typeLiterals": "ignore"
|
||||||
|
},
|
||||||
|
"singleline": "never"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue