mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 11:13:46 +00:00
manage ui location for popup app
This commit is contained in:
@@ -24,10 +24,11 @@ function initLockService(self) {
|
||||
self.lastLockCheck = now;
|
||||
|
||||
var popupOpen = chrome.extension.getViews({ type: 'popup' }).length > 0;
|
||||
var tabOpen = chrome.extension.getViews({ type: 'tab' }).length > 0;
|
||||
var sidebarView = sidebarViewName(self.utilsService);
|
||||
var sidebarOpen = sidebarView && chrome.extension.getViews({ type: sidebarView }).length > 0;
|
||||
|
||||
if (popupOpen || sidebarOpen) {
|
||||
if (popupOpen || tabOpen || sidebarOpen) {
|
||||
// Do not lock
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -229,7 +229,15 @@ function initUtilsService() {
|
||||
};
|
||||
|
||||
UtilsService.prototype.inSidebar = function (theWindow) {
|
||||
return theWindow.location.search && theWindow.location.search.indexOf('sidebar=true') > -1;
|
||||
return theWindow.location.search && theWindow.location.search.indexOf('uilocation=sidebar') > -1;
|
||||
};
|
||||
|
||||
UtilsService.prototype.inTab = function (theWindow) {
|
||||
return theWindow.location.search && theWindow.location.search.indexOf('uilocation=tab') > -1;
|
||||
};
|
||||
|
||||
UtilsService.prototype.inPopup = function (theWindow) {
|
||||
return theWindow.location.search && theWindow.location.search.indexOf('uilocation=popup') > -1;
|
||||
};
|
||||
|
||||
function validIpAddress(ipString) {
|
||||
|
||||
Reference in New Issue
Block a user