1
0
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:
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

@@ -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;
}

View File

@@ -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) {