mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-29 17:38:04 +01:00
sidebar is only available in newer ff versions
This commit is contained in:
parent
5fe2d0f461
commit
714b166035
@ -24,8 +24,8 @@ function initLockService(self) {
|
||||
self.lastLockCheck = now;
|
||||
|
||||
var popupOpen = chrome.extension.getViews({ type: 'popup' }).length > 0;
|
||||
var sidebarViewName = self.utilsService.sidebarViewName();
|
||||
var sidebarOpen = sidebarViewName && chrome.extension.getViews({ type: sidebarViewName }).length > 0;
|
||||
var sidebarView = sidebarViewName(self.utilsService);
|
||||
var sidebarOpen = sidebarView && chrome.extension.getViews({ type: sidebarView }).length > 0;
|
||||
|
||||
if (popupOpen || sidebarOpen) {
|
||||
// Do not lock
|
||||
@ -133,4 +133,15 @@ function initLockService(self) {
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function sidebarViewName(utilsService) {
|
||||
if (chrome.sidebarAction && utilsService.isFirefox()) {
|
||||
return 'sidebar';
|
||||
}
|
||||
else if (utilsService.isOpera() && (typeof opr !== 'undefined') && opr.sidebarAction) {
|
||||
return 'sidebar_panel';
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
@ -232,17 +232,6 @@ function initUtilsService() {
|
||||
return theWindow.location.search && theWindow.location.search.indexOf('sidebar=true') > -1;
|
||||
};
|
||||
|
||||
UtilsService.prototype.sidebarViewName = function () {
|
||||
if (this.isFirefox()) {
|
||||
return 'sidebar';
|
||||
}
|
||||
else if (this.isOpera()) {
|
||||
return 'sidebar_panel';
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
function validIpAddress(ipString) {
|
||||
var ipRegex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
||||
return ipRegex.test(ipString);
|
||||
|
Loading…
Reference in New Issue
Block a user