close popup on launch site/autofill

This commit is contained in:
Kyle Spearrin 2017-10-05 23:39:41 -04:00
parent f852cbbfe3
commit 31f73895b8
3 changed files with 11 additions and 3 deletions

View File

@ -79,7 +79,9 @@ angular
if (totpCode && utilsService.isFirefox()) { if (totpCode && utilsService.isFirefox()) {
utilsService.copyToClipboard(totpCode, document); utilsService.copyToClipboard(totpCode, document);
} }
if (!utilsService.inSidebar($window)) {
$window.close(); $window.close();
}
}, function () { }, function () {
$analytics.eventTrack('Autofilled Error'); $analytics.eventTrack('Autofilled Error');
toastr.error(i18nService.autofillError); toastr.error(i18nService.autofillError);

View File

@ -2,7 +2,7 @@
.module('bit.vault') .module('bit.vault')
.controller('vaultController', function ($scope, $rootScope, loginService, folderService, $q, $state, $stateParams, toastr, .controller('vaultController', function ($scope, $rootScope, loginService, folderService, $q, $state, $stateParams, toastr,
syncService, utilsService, $analytics, i18nService, stateService, $timeout) { syncService, utilsService, $analytics, i18nService, stateService, $timeout, $window) {
var stateKey = 'vault', var stateKey = 'vault',
state = stateService.getState(stateKey) || {}; state = stateService.getState(stateKey) || {};
@ -178,6 +178,9 @@
if (login.uri.startsWith('http://') || login.uri.startsWith('https://')) { if (login.uri.startsWith('http://') || login.uri.startsWith('https://')) {
$analytics.eventTrack('Launched Website From Listing'); $analytics.eventTrack('Launched Website From Listing');
chrome.tabs.create({ url: login.uri }); chrome.tabs.create({ url: login.uri });
if (!utilsService.inSidebar($window)) {
$window.close();
}
} }
}); });
}; };

View File

@ -2,7 +2,7 @@
.module('bit.vault') .module('bit.vault')
.controller('vaultViewFolderController', function ($scope, loginService, folderService, $q, $state, $stateParams, toastr, .controller('vaultViewFolderController', function ($scope, loginService, folderService, $q, $state, $stateParams, toastr,
syncService, $analytics, i18nService, stateService, utilsService, $timeout) { syncService, $analytics, i18nService, stateService, utilsService, $timeout, $window) {
var stateKey = 'viewFolder', var stateKey = 'viewFolder',
state = stateService.getState(stateKey) || {}; state = stateService.getState(stateKey) || {};
@ -136,6 +136,9 @@
if (login.uri.startsWith('http://') || login.uri.startsWith('https://')) { if (login.uri.startsWith('http://') || login.uri.startsWith('https://')) {
$analytics.eventTrack('Launched Website From Listing'); $analytics.eventTrack('Launched Website From Listing');
chrome.tabs.create({ url: login.uri }); chrome.tabs.create({ url: login.uri });
if (!utilsService.inSidebar($window)) {
$window.close();
}
} }
}); });
}; };