mirror of
https://github.com/bitwarden/desktop.git
synced 2024-11-08 09:32:07 +01:00
expand vault uses a popup instead of a new tab
This commit is contained in:
parent
22e1c7d58d
commit
41c3007821
@ -175,9 +175,8 @@
|
|||||||
params = providers[constants.twoFactorProvider.email];
|
params = providers[constants.twoFactorProvider.email];
|
||||||
$scope.twoFactorEmail = params.Email;
|
$scope.twoFactorEmail = params.Email;
|
||||||
|
|
||||||
if (chrome.extension.getViews({ type: 'popup' }).length > 0 &&
|
if (chrome.extension.getViews({ type: 'popup' }).length > 0 && !utilsService.inSidebar($window) &&
|
||||||
!utilsService.inSidebar($window) &&
|
!utilsService.inTab($window) && !utilsService.inPopout($window)) {
|
||||||
!utilsService.inTab($window)) {
|
|
||||||
SweetAlert.swal({
|
SweetAlert.swal({
|
||||||
title: i18nService.twoStepLogin,
|
title: i18nService.twoStepLogin,
|
||||||
text: i18nService.popup2faCloseMessage,
|
text: i18nService.popup2faCloseMessage,
|
||||||
|
@ -33,8 +33,28 @@ angular
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
href = href.replace('uilocation=popup', 'uilocation=tab').replace('uilocation=sidebar', 'uilocation=tab');
|
if (chrome.windows.create) {
|
||||||
chrome.tabs.create({ url: href });
|
href = href.replace('uilocation=popup', 'uilocation=popout').replace('uilocation=tab', 'uilocation=popout')
|
||||||
|
.replace('uilocation=sidebar', 'uilocation=popout');
|
||||||
|
|
||||||
|
chrome.windows.create({
|
||||||
|
url: href,
|
||||||
|
type: 'popup',
|
||||||
|
width: $('body').width() + 60,
|
||||||
|
height: $('body').height()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (utilsService.inPopup($window)) {
|
||||||
|
$window.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
href = href.replace('uilocation=popup', 'uilocation=tab').replace('uilocation=popout', 'uilocation=tab')
|
||||||
|
.replace('uilocation=sidebar', 'uilocation=tab');
|
||||||
|
chrome.tabs.create({
|
||||||
|
url: href
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
||||||
|
@ -236,6 +236,10 @@ function initUtilsService() {
|
|||||||
return theWindow.location.search && theWindow.location.search.indexOf('uilocation=tab') > -1;
|
return theWindow.location.search && theWindow.location.search.indexOf('uilocation=tab') > -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
UtilsService.prototype.inPopout = function (theWindow) {
|
||||||
|
return theWindow.location.search && theWindow.location.search.indexOf('uilocation=popout') > -1;
|
||||||
|
};
|
||||||
|
|
||||||
UtilsService.prototype.inPopup = function (theWindow) {
|
UtilsService.prototype.inPopup = function (theWindow) {
|
||||||
return theWindow.location.search && theWindow.location.search.indexOf('uilocation=popup') > -1;
|
return theWindow.location.search && theWindow.location.search.indexOf('uilocation=popup') > -1;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user