1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

manage ui location for popup app

This commit is contained in:
Kyle Spearrin
2017-10-06 00:05:08 -04:00
parent 31f73895b8
commit d4cf0fe338
9 changed files with 21 additions and 9 deletions

View File

@@ -175,7 +175,9 @@
params = providers[constants.twoFactorProvider.email];
$scope.twoFactorEmail = params.Email;
if (chrome.extension.getViews({ type: 'popup' }).length > 0 && !utilsService.inSidebar($window)) {
if (chrome.extension.getViews({ type: 'popup' }).length > 0 &&
!utilsService.inSidebar($window) &&
!utilsService.inTab($window)) {
SweetAlert.swal({
title: i18nService.twoStepLogin,
text: i18nService.popup2faCloseMessage,
@@ -184,7 +186,7 @@
cancelButtonText: i18nService.no
}, function (confirmed) {
if (confirmed) {
chrome.tabs.create({ url: '/popup/index.html#!/login' });
chrome.tabs.create({ url: '/popup/index.html?uilocation=tab#!/login' });
return;
}
else if (Object.keys(providers).length > 1) {

View File

@@ -79,7 +79,7 @@ angular
if (totpCode && utilsService.isFirefox()) {
utilsService.copyToClipboard(totpCode, document);
}
if (!utilsService.inSidebar($window)) {
if (utilsService.inPopup($window)) {
$window.close();
}
}, function () {

View File

@@ -33,6 +33,7 @@ angular
}
}
href = href.replace('uilocation=popup', 'uilocation=tab').replace('uilocation=sidebar', 'uilocation=tab');
chrome.tabs.create({ url: href });
};

View File

@@ -178,7 +178,7 @@
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)) {
if (utilsService.inPopup($window)) {
$window.close();
}
}

View File

@@ -136,7 +136,7 @@
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)) {
if (utilsService.inPopup($window)) {
$window.close();
}
}