1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-29 17:38:04 +01:00

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()) {
utilsService.copyToClipboard(totpCode, document);
}
if (!utilsService.inSidebar($window)) {
$window.close();
}
}, function () {
$analytics.eventTrack('Autofilled Error');
toastr.error(i18nService.autofillError);

View File

@ -2,7 +2,7 @@
.module('bit.vault')
.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',
state = stateService.getState(stateKey) || {};
@ -178,6 +178,9 @@
if (login.uri.startsWith('http://') || login.uri.startsWith('https://')) {
$analytics.eventTrack('Launched Website From Listing');
chrome.tabs.create({ url: login.uri });
if (!utilsService.inSidebar($window)) {
$window.close();
}
}
});
};

View File

@ -2,7 +2,7 @@
.module('bit.vault')
.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',
state = stateService.getState(stateKey) || {};
@ -136,6 +136,9 @@
if (login.uri.startsWith('http://') || login.uri.startsWith('https://')) {
$analytics.eventTrack('Launched Website From Listing');
chrome.tabs.create({ url: login.uri });
if (!utilsService.inSidebar($window)) {
$window.close();
}
}
});
};