From 69abbdaf8d76a593f3c55e57b33ed2a07b608ced Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 28 Aug 2017 22:27:29 -0400 Subject: [PATCH] fixes for edge --- src/background.js | 4 ++-- src/popup/app/global/mainController.js | 4 ++-- src/popup/less/popup.less | 3 ++- src/services/cryptoService.js | 2 +- src/services/i18nService.js | 27 +++++++++++++++++++++++++- 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/background.js b/src/background.js index ae0bfea0ac..ae68600f08 100644 --- a/src/background.js +++ b/src/background.js @@ -1,8 +1,8 @@ var isBackground = true; var bg_loginsToAdd = []; -var bg_i18nService = new i18nService(); -var bg_constantsService = new ConstantsService(bg_i18nService); var bg_utilsService = new UtilsService(); +var bg_i18nService = new i18nService(bg_utilsService); +var bg_constantsService = new ConstantsService(bg_i18nService); var bg_cryptoService = new CryptoService(bg_constantsService); var bg_tokenService = new TokenService(); var bg_appIdService = new AppIdService(); diff --git a/src/popup/app/global/mainController.js b/src/popup/app/global/mainController.js index 8ca8c71dae..73f5a70928 100644 --- a/src/popup/app/global/mainController.js +++ b/src/popup/app/global/mainController.js @@ -6,8 +6,8 @@ angular var self = this; self.currentYear = new Date().getFullYear(); self.animation = ''; - self.shBody = $window.screen.availHeight < 600; - self.lgBody = !utilsService.isFirefox() && !self.shBody; + self.shBody = $window.screen.availHeight < 650; + self.lgBody = !utilsService.isFirefox() && !utilsService.isEdge() && !self.shBody; $scope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) { if (toParams.animation) { diff --git a/src/popup/less/popup.less b/src/popup/less/popup.less index 370a20e0ec..a62da846f9 100644 --- a/src/popup/less/popup.less +++ b/src/popup/less/popup.less @@ -41,7 +41,8 @@ body.sh { bottom: 0; left: 0; right: 0; - overflow: auto; + overflow-y: auto; + overflow-x: hidden; background-color: @background-color; &.content-tabs { diff --git a/src/services/cryptoService.js b/src/services/cryptoService.js index fb8549586d..4513f688e7 100644 --- a/src/services/cryptoService.js +++ b/src/services/cryptoService.js @@ -660,7 +660,7 @@ function initCryptoService(constantsService) { } var ctArr = fromB64ToArray(encPieces[0]); - return _subtle.decrypt({ name: padding.name }, privateKey, ctArr.buffer); + return _subtle.decrypt(padding, privateKey, ctArr.buffer); }, function () { throw 'Cannot import privateKey.'; }).then(function (decBytes) { diff --git a/src/services/i18nService.js b/src/services/i18nService.js index 29b7832e77..ed58cc7708 100644 --- a/src/services/i18nService.js +++ b/src/services/i18nService.js @@ -1,4 +1,29 @@ -function i18nService() { +function i18nService(utilsService) { + this.utilsService = utilsService; + this.messages = {}; + + var self = this; + + if (self.utilsService.isEdge()) { + var rawFile = new XMLHttpRequest(); + rawFile.open('GET', '../_locales/en/messages.json', false); + rawFile.onreadystatechange = function () { + if (rawFile.readyState === 4) { + if (rawFile.status === 200 || rawFile.status == 0) { + var locales = JSON.parse(rawFile.responseText); + for (var property in locales) { + if (locales.hasOwnProperty(property)) { + self.messages[property] = chrome.i18n.getMessage(property); + } + } + } + } + } + rawFile.send(null); + + return self.messages; + } + return new Proxy({}, { get: function (target, name) { return chrome.i18n.getMessage(name);