diff --git a/jslib b/jslib index 9950fb42a1..5b7b2a03dd 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 9950fb42a15bad434a4b404419ff4a87af67a27b +Subproject commit 5b7b2a03ddbecbc93adc54a5c69e8141c00c192f diff --git a/src/app/polyfills.ts b/src/app/polyfills.ts index 28df461ccc..0691f05659 100644 --- a/src/app/polyfills.ts +++ b/src/app/polyfills.ts @@ -1,11 +1,6 @@ import "core-js/stable"; require("zone.js/dist/zone"); -// IE11 fix, ref: https://github.com/angular/angular/issues/24769 -if (!Element.prototype.matches && (Element.prototype as any).msMatchesSelector) { - Element.prototype.matches = (Element.prototype as any).msMatchesSelector; -} - if (process.env.NODE_ENV === "production") { // Production } else { diff --git a/src/app/send/access.component.ts b/src/app/send/access.component.ts index 1bf4b9e588..2665f28bf9 100644 --- a/src/app/send/access.component.ts +++ b/src/app/send/access.component.ts @@ -6,6 +6,7 @@ import { CryptoService } from "jslib-common/abstractions/crypto.service"; import { CryptoFunctionService } from "jslib-common/abstractions/cryptoFunction.service"; import { I18nService } from "jslib-common/abstractions/i18n.service"; import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service"; +import { SEND_KDF_ITERATIONS } from "jslib-common/enums/kdfType"; import { SendType } from "jslib-common/enums/sendType"; import { Utils } from "jslib-common/misc/utils"; import { SendAccess } from "jslib-common/models/domain/sendAccess"; @@ -140,7 +141,7 @@ export class AccessComponent implements OnInit { this.password, keyArray, "sha256", - 100000 + SEND_KDF_ITERATIONS ); this.accessRequest.password = Utils.fromBufferToB64(passwordHash); } diff --git a/src/app/settings/change-kdf.component.html b/src/app/settings/change-kdf.component.html index ebd616f1f5..82cd56b1c9 100644 --- a/src/app/settings/change-kdf.component.html +++ b/src/app/settings/change-kdf.component.html @@ -61,7 +61,7 @@
-

{{ "kdfIterationsDesc" | i18n: (100000 | number) }}

+

{{ "kdfIterationsDesc" | i18n: (recommendedKdfIterations | number) }}

{{ "warning" | i18n }}: {{ "kdfIterationsWarning" | i18n: (50000 | number) }}
diff --git a/src/app/settings/change-kdf.component.ts b/src/app/settings/change-kdf.component.ts index beef67bbb8..dcc268ac7c 100644 --- a/src/app/settings/change-kdf.component.ts +++ b/src/app/settings/change-kdf.component.ts @@ -7,7 +7,7 @@ import { LogService } from "jslib-common/abstractions/log.service"; import { MessagingService } from "jslib-common/abstractions/messaging.service"; import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service"; import { StateService } from "jslib-common/abstractions/state.service"; -import { KdfType } from "jslib-common/enums/kdfType"; +import { DEFAULT_KDF_ITERATIONS, KdfType } from "jslib-common/enums/kdfType"; import { KdfRequest } from "jslib-common/models/request/kdfRequest"; @Component({ @@ -20,6 +20,7 @@ export class ChangeKdfComponent implements OnInit { kdf = KdfType.PBKDF2_SHA256; kdfOptions: any[] = []; formPromise: Promise; + recommendedKdfIterations = DEFAULT_KDF_ITERATIONS; constructor( private apiService: ApiService, diff --git a/src/services/webPlatformUtils.service.ts b/src/services/webPlatformUtils.service.ts index 9132479b47..0c9b56fae1 100644 --- a/src/services/webPlatformUtils.service.ts +++ b/src/services/webPlatformUtils.service.ts @@ -85,10 +85,6 @@ export class WebPlatformUtilsService implements PlatformUtilsService { return this.getDevice() === DeviceType.SafariBrowser; } - isIE(): boolean { - return this.getDevice() === DeviceType.IEBrowser; - } - isMacAppStore(): boolean { return false; } @@ -139,26 +135,23 @@ export class WebPlatformUtilsService implements PlatformUtilsService { blobOptions.type = type; } } - if (blobOptions != null && !this.isIE()) { + if (blobOptions != null) { blob = new Blob([blobData], blobOptions); } else { blob = new Blob([blobData]); } - if (navigator.msSaveOrOpenBlob) { - navigator.msSaveBlob(blob, fileName); - } else { - const a = win.document.createElement("a"); - if (doDownload) { - a.download = fileName; - } else if (!this.isSafari()) { - a.target = "_blank"; - } - a.href = URL.createObjectURL(blob); - a.style.position = "fixed"; - win.document.body.appendChild(a); - a.click(); - win.document.body.removeChild(a); + + const a = win.document.createElement("a"); + if (doDownload) { + a.download = fileName; + } else if (!this.isSafari()) { + a.target = "_blank"; } + a.href = URL.createObjectURL(blob); + a.style.position = "fixed"; + win.document.body.appendChild(a); + a.click(); + win.document.body.removeChild(a); } getApplicationVersion(): Promise {