1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

better domain parsing with tldjs backup

This commit is contained in:
Kyle Spearrin
2017-03-28 22:11:47 -04:00
parent 02dc3609b4
commit 45d6c6f341
6 changed files with 62 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
angular
.module('bit.current')
.controller('currentController', function ($scope, loginService, tldjs, toastr, $q, $window, $state, $timeout,
.controller('currentController', function ($scope, loginService, utilsService, toastr, $q, $window, $state, $timeout,
autofillService, $analytics, i18nService) {
$scope.i18n = i18nService;
@@ -30,7 +30,7 @@ angular
return;
}
domain = tldjs.getDomain(url);
domain = utilsService.getDomain(url);
if (!domain) {
$scope.loaded = true;
$scope.$apply();

View File

@@ -22,9 +22,6 @@
.factory('syncService', function () {
return chrome.extension.getBackgroundPage().syncService;
})
.factory('tldjs', function () {
return chrome.extension.getBackgroundPage().tldjs;
})
.factory('autofillService', function () {
return chrome.extension.getBackgroundPage().autofillService;
})

View File

@@ -1,8 +1,8 @@
angular
.module('bit.vault')
.controller('vaultViewLoginController', function ($scope, $state, $stateParams, loginService, tldjs, toastr, $q,
$analytics, i18nService) {
.controller('vaultViewLoginController', function ($scope, $state, $stateParams, loginService, toastr, $q,
$analytics, i18nService, utilsService) {
$scope.i18n = i18nService;
var from = $stateParams.from;
@@ -26,7 +26,7 @@ angular
if (model.uri) {
$scope.login.showLaunch = model.uri.startsWith('http://') || model.uri.startsWith('https://');
var domain = tldjs.getDomain(model.uri);
var domain = utilsService.getDomain(model.uri);
if (domain) {
$scope.login.website = domain;
}