mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-17 01:31:25 +01:00
Merge branch 'master' into feature/sso
This commit is contained in:
commit
4b3cd22bce
2
jslib
2
jslib
@ -1 +1 @@
|
|||||||
Subproject commit ed6978baff5b129341bd46cc90a6155c1bcc5124
|
Subproject commit 9957125d3a9d416d7a60b9904f0b7882f3fb58d0
|
1998
package-lock.json
generated
1998
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
38
package.json
38
package.json
@ -24,8 +24,8 @@
|
|||||||
"test:watch": "karma start"
|
"test:watch": "karma start"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/compiler-cli": "^7.2.11",
|
"@angular/compiler-cli": "^9.1.12",
|
||||||
"@ngtools/webpack": "^7.2.2",
|
"@ngtools/webpack": "^9.1.12",
|
||||||
"@types/chrome": "^0.0.73",
|
"@types/chrome": "^0.0.73",
|
||||||
"@types/jasmine": "^3.3.12",
|
"@types/jasmine": "^3.3.12",
|
||||||
"@types/lunr": "^2.3.3",
|
"@types/lunr": "^2.3.3",
|
||||||
@ -68,28 +68,27 @@
|
|||||||
"node-sass": "^4.13.1",
|
"node-sass": "^4.13.1",
|
||||||
"sass-loader": "^7.1.0",
|
"sass-loader": "^7.1.0",
|
||||||
"style-loader": "^0.23.0",
|
"style-loader": "^0.23.0",
|
||||||
"ts-loader": "^5.3.3",
|
"ts-loader": "^8.0.2",
|
||||||
"tslint": "^5.12.1",
|
"tslint": "^6.1.3",
|
||||||
"tslint-loader": "^3.5.4",
|
"tslint-loader": "^3.5.4",
|
||||||
"typescript": "3.2.4",
|
"typescript": "3.8.3",
|
||||||
"webpack": "^4.29.0",
|
"webpack": "^4.29.0",
|
||||||
"webpack-cli": "^3.2.1"
|
"webpack-cli": "^3.2.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "7.2.1",
|
"@angular/animations": "9.1.12",
|
||||||
"@angular/cdk": "7.2.1",
|
"@angular/cdk": "9.2.4",
|
||||||
"@angular/common": "7.2.1",
|
"@angular/common": "9.1.12",
|
||||||
"@angular/compiler": "7.2.1",
|
"@angular/compiler": "9.1.12",
|
||||||
"@angular/core": "7.2.1",
|
"@angular/core": "9.1.12",
|
||||||
"@angular/forms": "7.2.1",
|
"@angular/forms": "9.1.12",
|
||||||
"@angular/platform-browser": "7.2.1",
|
"@angular/platform-browser": "9.1.12",
|
||||||
"@angular/platform-browser-dynamic": "7.2.1",
|
"@angular/platform-browser-dynamic": "9.1.12",
|
||||||
"@angular/router": "7.2.1",
|
"@angular/router": "9.1.12",
|
||||||
"@angular/upgrade": "7.2.1",
|
|
||||||
"@microsoft/signalr": "3.1.0",
|
"@microsoft/signalr": "3.1.0",
|
||||||
"@microsoft/signalr-protocol-msgpack": "3.1.0",
|
"@microsoft/signalr-protocol-msgpack": "3.1.0",
|
||||||
"angular2-toaster": "6.1.0",
|
"angular2-toaster": "8.0.0",
|
||||||
"angulartics2": "6.3.0",
|
"angulartics2": "9.1.0",
|
||||||
"big-integer": "1.6.36",
|
"big-integer": "1.6.36",
|
||||||
"core-js": "2.6.2",
|
"core-js": "2.6.2",
|
||||||
"duo_web_sdk": "git+https://github.com/duosecurity/duo_web_sdk.git",
|
"duo_web_sdk": "git+https://github.com/duosecurity/duo_web_sdk.git",
|
||||||
@ -100,11 +99,12 @@
|
|||||||
"node-forge": "0.7.6",
|
"node-forge": "0.7.6",
|
||||||
"nord": "^0.2.1",
|
"nord": "^0.2.1",
|
||||||
"papaparse": "4.6.0",
|
"papaparse": "4.6.0",
|
||||||
"rxjs": "6.3.3",
|
"rxjs": "6.6.2",
|
||||||
"sweetalert2": "9.8.2",
|
"sweetalert2": "9.8.2",
|
||||||
"tldjs": "2.3.1",
|
"tldjs": "2.3.1",
|
||||||
|
"tslib": "^2.0.1",
|
||||||
"web-animations-js": "2.3.1",
|
"web-animations-js": "2.3.1",
|
||||||
"zone.js": "0.8.28",
|
"zone.js": "0.10.3",
|
||||||
"zxcvbn": "4.4.2"
|
"zxcvbn": "4.4.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ export default class RuntimeBackground {
|
|||||||
break;
|
break;
|
||||||
case 'autofiller':
|
case 'autofiller':
|
||||||
case 'autofill_cmd':
|
case 'autofill_cmd':
|
||||||
const totpCode = await this.autofillService.doAutoFillForLastUsedLogin([{
|
const totpCode = await this.autofillService.doAutoFillActiveTab([{
|
||||||
frameId: sender.frameId,
|
frameId: sender.frameId,
|
||||||
tab: msg.tab,
|
tab: msg.tab,
|
||||||
details: msg.details,
|
details: msg.details,
|
||||||
|
@ -183,7 +183,7 @@ export class BrowserApi {
|
|||||||
navigator.msSaveBlob(blob, fileName);
|
navigator.msSaveBlob(blob, fileName);
|
||||||
} else {
|
} else {
|
||||||
const a = win.document.createElement('a');
|
const a = win.document.createElement('a');
|
||||||
a.href = win.URL.createObjectURL(blob);
|
a.href = URL.createObjectURL(blob);
|
||||||
a.download = fileName;
|
a.download = fileName;
|
||||||
win.document.body.appendChild(a);
|
win.document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
|
@ -20,7 +20,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
|
|||||||
|
|
||||||
let autofillCommand = ['mod+shift+l'];
|
let autofillCommand = ['mod+shift+l'];
|
||||||
if (isSafari) {
|
if (isSafari) {
|
||||||
autofillCommand = ['mod+\\', 'mod+8'];
|
autofillCommand = ['mod+\\', 'mod+8', 'mod+shift+p'];
|
||||||
} else if (isEdge) {
|
} else if (isEdge) {
|
||||||
autofillCommand = ['mod+\\', 'mod+9'];
|
autofillCommand = ['mod+\\', 'mod+9'];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule, Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
ActivatedRouteSnapshot,
|
ActivatedRouteSnapshot,
|
||||||
RouteReuseStrategy,
|
RouteReuseStrategy,
|
||||||
@ -256,6 +256,7 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
export class NoRouteReuseStrategy implements RouteReuseStrategy {
|
export class NoRouteReuseStrategy implements RouteReuseStrategy {
|
||||||
shouldDetach(route: ActivatedRouteSnapshot) {
|
shouldDetach(route: ActivatedRouteSnapshot) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -150,7 +150,7 @@ registerLocaleData(localeZhTw, 'zh-TW');
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
AppRoutingModule,
|
AppRoutingModule,
|
||||||
ServicesModule,
|
ServicesModule,
|
||||||
Angulartics2Module.forRoot([Angulartics2GoogleAnalytics], {
|
Angulartics2Module.forRoot({
|
||||||
pageTracking: {
|
pageTracking: {
|
||||||
clearQueryParams: true,
|
clearQueryParams: true,
|
||||||
},
|
},
|
||||||
|
@ -21,7 +21,7 @@ import { AuthService as AuthServiceAbstraction } from 'jslib/abstractions/auth.s
|
|||||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||||
import { CollectionService } from 'jslib/abstractions/collection.service';
|
import { CollectionService } from 'jslib/abstractions/collection.service';
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service'
|
import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service';
|
||||||
import { EnvironmentService } from 'jslib/abstractions/environment.service';
|
import { EnvironmentService } from 'jslib/abstractions/environment.service';
|
||||||
import { EventService } from 'jslib/abstractions/event.service';
|
import { EventService } from 'jslib/abstractions/event.service';
|
||||||
import { ExportService } from 'jslib/abstractions/export.service';
|
import { ExportService } from 'jslib/abstractions/export.service';
|
||||||
@ -135,6 +135,11 @@ export function initFactory(i18nService: I18nService, storageService: StorageSer
|
|||||||
{ provide: TokenService, useFactory: getBgService<TokenService>('tokenService'), deps: [] },
|
{ provide: TokenService, useFactory: getBgService<TokenService>('tokenService'), deps: [] },
|
||||||
{ provide: I18nService, useFactory: getBgService<I18nService>('i18nService'), deps: [] },
|
{ provide: I18nService, useFactory: getBgService<I18nService>('i18nService'), deps: [] },
|
||||||
{ provide: CryptoService, useFactory: getBgService<CryptoService>('cryptoService'), deps: [] },
|
{ provide: CryptoService, useFactory: getBgService<CryptoService>('cryptoService'), deps: [] },
|
||||||
|
{
|
||||||
|
provide: CryptoFunctionService,
|
||||||
|
useFactory: getBgService<CryptoFunctionService>('cryptoFunctionService'),
|
||||||
|
deps: [],
|
||||||
|
},
|
||||||
{ provide: EventService, useFactory: getBgService<EventService>('eventService'), deps: [] },
|
{ provide: EventService, useFactory: getBgService<EventService>('eventService'), deps: [] },
|
||||||
{ provide: PolicyService, useFactory: getBgService<PolicyService>('policyService'), deps: [] },
|
{ provide: PolicyService, useFactory: getBgService<PolicyService>('policyService'), deps: [] },
|
||||||
{
|
{
|
||||||
|
@ -44,8 +44,8 @@ const RateUrls = {
|
|||||||
templateUrl: 'settings.component.html',
|
templateUrl: 'settings.component.html',
|
||||||
})
|
})
|
||||||
export class SettingsComponent implements OnInit {
|
export class SettingsComponent implements OnInit {
|
||||||
@ViewChild('vaultTimeoutSelect', { read: ElementRef }) vaultTimeoutSelectRef: ElementRef;
|
@ViewChild('vaultTimeoutSelect', { read: ElementRef, static: true }) vaultTimeoutSelectRef: ElementRef;
|
||||||
@ViewChild('vaultTimeoutActionSelect', { read: ElementRef }) vaultTimeoutActionSelectRef: ElementRef;
|
@ViewChild('vaultTimeoutActionSelect', { read: ElementRef, static: true }) vaultTimeoutActionSelectRef: ElementRef;
|
||||||
vaultTimeouts: any[];
|
vaultTimeouts: any[];
|
||||||
vaultTimeout: number = null;
|
vaultTimeout: number = null;
|
||||||
vaultTimeoutActions: any[];
|
vaultTimeoutActions: any[];
|
||||||
|
@ -48,8 +48,8 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On
|
|||||||
folderId: string = null;
|
folderId: string = null;
|
||||||
collectionId: string = null;
|
collectionId: string = null;
|
||||||
type: CipherType = null;
|
type: CipherType = null;
|
||||||
nestedFolders: Array<TreeNode<FolderView>>;
|
nestedFolders: TreeNode<FolderView>[];
|
||||||
nestedCollections: Array<TreeNode<CollectionView>>;
|
nestedCollections: TreeNode<CollectionView>[];
|
||||||
searchTypeSearch = false;
|
searchTypeSearch = false;
|
||||||
|
|
||||||
private selectedTimeout: number;
|
private selectedTimeout: number;
|
||||||
|
@ -96,7 +96,12 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
|
|||||||
let messagesUrl = bundleUrl.appendingPathComponent("app/_locales/\(language)/messages.json")
|
let messagesUrl = bundleUrl.appendingPathComponent("app/_locales/\(language)/messages.json")
|
||||||
do {
|
do {
|
||||||
let json = try String(contentsOf: messagesUrl, encoding: .utf8)
|
let json = try String(contentsOf: messagesUrl, encoding: .utf8)
|
||||||
webView.evaluateJavaScript("window.bitwardenLocaleStrings = \(json);", completionHandler: nil)
|
webView.evaluateJavaScript("window.bitwardenLocaleStrings = \(json);", completionHandler: {(result, error) in
|
||||||
|
guard let err = error else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
NSLog("evaluateJavaScript error : %@", err.localizedDescription);
|
||||||
|
})
|
||||||
} catch {
|
} catch {
|
||||||
NSLog("ERROR on getLocaleStrings, \(error)")
|
NSLog("ERROR on getLocaleStrings, \(error)")
|
||||||
}
|
}
|
||||||
@ -236,7 +241,12 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
let json = (jsonSerialize(obj: message) ?? "null")
|
let json = (jsonSerialize(obj: message) ?? "null")
|
||||||
webView.evaluateJavaScript("window.bitwardenSafariAppMessageReceiver(\(json));", completionHandler: nil)
|
webView.evaluateJavaScript("window.bitwardenSafariAppMessageReceiver(\(json));", completionHandler: {(result, error) in
|
||||||
|
guard let err = error else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
NSLog("evaluateJavaScript error : %@", err.localizedDescription);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,5 +3,5 @@ import AutofillPageDetails from '../../models/autofillPageDetails';
|
|||||||
export abstract class AutofillService {
|
export abstract class AutofillService {
|
||||||
getFormsWithPasswordFields: (pageDetails: AutofillPageDetails) => any[];
|
getFormsWithPasswordFields: (pageDetails: AutofillPageDetails) => any[];
|
||||||
doAutoFill: (options: any) => Promise<string>;
|
doAutoFill: (options: any) => Promise<string>;
|
||||||
doAutoFillForLastUsedLogin: (pageDetails: any, fromCommand: boolean) => Promise<string>;
|
doAutoFillActiveTab: (pageDetails: any, fromCommand: boolean) => Promise<string>;
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@ import {
|
|||||||
FieldType,
|
FieldType,
|
||||||
} from 'jslib/enums';
|
} from 'jslib/enums';
|
||||||
|
|
||||||
|
import { CipherView } from 'jslib/models/view';
|
||||||
|
|
||||||
import AutofillField from '../models/autofillField';
|
import AutofillField from '../models/autofillField';
|
||||||
import AutofillPageDetails from '../models/autofillPageDetails';
|
import AutofillPageDetails from '../models/autofillPageDetails';
|
||||||
import AutofillScript from '../models/autofillScript';
|
import AutofillScript from '../models/autofillScript';
|
||||||
@ -117,6 +119,7 @@ var IsoProvinces: { [id: string]: string; } = {
|
|||||||
/* tslint:enable */
|
/* tslint:enable */
|
||||||
|
|
||||||
export default class AutofillService implements AutofillServiceInterface {
|
export default class AutofillService implements AutofillServiceInterface {
|
||||||
|
|
||||||
constructor(private cipherService: CipherService, private userService: UserService,
|
constructor(private cipherService: CipherService, private userService: UserService,
|
||||||
private totpService: TotpService, private eventService: EventService) { }
|
private totpService: TotpService, private eventService: EventService) { }
|
||||||
|
|
||||||
@ -217,23 +220,24 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async doAutoFillForLastUsedLogin(pageDetails: any, fromCommand: boolean) {
|
async doAutoFillActiveTab(pageDetails: any, fromCommand: boolean) {
|
||||||
const tab = await this.getActiveTab();
|
const tab = await this.getActiveTab();
|
||||||
if (!tab || !tab.url) {
|
if (!tab || !tab.url) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const lastUsedCipher = await this.cipherService.getLastUsedForUrl(tab.url);
|
let cipher: CipherView;
|
||||||
if (!lastUsedCipher) {
|
if (fromCommand) {
|
||||||
return;
|
cipher = await this.cipherService.getNextCipherForUrl(tab.url);
|
||||||
|
} else {
|
||||||
|
cipher = await this.cipherService.getLastUsedForUrl(tab.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
return await this.doAutoFill({
|
return await this.doAutoFill({
|
||||||
cipher: lastUsedCipher,
|
cipher: cipher,
|
||||||
// tslint:disable-next-line
|
|
||||||
pageDetails: pageDetails,
|
pageDetails: pageDetails,
|
||||||
skipTotp: !fromCommand,
|
skipTotp: !fromCommand,
|
||||||
skipLastUsed: true,
|
skipLastUsed: !fromCommand,
|
||||||
skipUsernameOnlyFill: !fromCommand,
|
skipUsernameOnlyFill: !fromCommand,
|
||||||
onlyEmptyFields: !fromCommand,
|
onlyEmptyFields: !fromCommand,
|
||||||
onlyVisibleFields: !fromCommand,
|
onlyVisibleFields: !fromCommand,
|
||||||
|
@ -210,7 +210,7 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
|
|||||||
if (this.isChrome() && text === '') {
|
if (this.isChrome() && text === '') {
|
||||||
text = '\u0000';
|
text = '\u0000';
|
||||||
}
|
}
|
||||||
|
|
||||||
const textarea = doc.createElement('textarea');
|
const textarea = doc.createElement('textarea');
|
||||||
textarea.textContent = text == null || text === '' ? ' ' : text;
|
textarea.textContent = text == null || text === '' ? ' ' : text;
|
||||||
// Prevent scrolling to bottom of page in MS Edge.
|
// Prevent scrolling to bottom of page in MS Edge.
|
||||||
|
Loading…
Reference in New Issue
Block a user