1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 23:03:32 +00:00

move "in UI" methods to popup utils

This commit is contained in:
Kyle Spearrin
2018-01-11 15:30:58 -05:00
parent 9921d6dba3
commit 82e88eb1ba
6 changed files with 45 additions and 26 deletions

View File

@@ -116,23 +116,6 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
return BrowserPlatformUtilsService.getDomain(uriString);
}
inSidebar(theWindow: Window): boolean {
return theWindow.location.search !== '' && theWindow.location.search.indexOf('uilocation=sidebar') > -1;
}
inTab(theWindow: Window): boolean {
return theWindow.location.search !== '' && theWindow.location.search.indexOf('uilocation=tab') > -1;
}
inPopout(theWindow: Window): boolean {
return theWindow.location.search !== '' && theWindow.location.search.indexOf('uilocation=popout') > -1;
}
inPopup(theWindow: Window): boolean {
return theWindow.location.search === '' || theWindow.location.search.indexOf('uilocation=') === -1 ||
theWindow.location.search.indexOf('uilocation=popup') > -1;
}
isViewOpen(): boolean {
const popupOpen = chrome.extension.getViews({ type: 'popup' }).length > 0;
if (popupOpen) {