1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 09:37:12 +02:00

more sensible var naming

This commit is contained in:
gorhill 2015-10-19 09:22:23 -04:00
parent a830fad589
commit e7daeb3edc

View File

@ -576,7 +576,7 @@ vAPI.tabs = {};
/******************************************************************************/ /******************************************************************************/
vAPI.tabs.mostRecentWindowId = (function() { vAPI.tabs.chromeWindowType = (function() {
if ( vAPI.thunderbird ) { if ( vAPI.thunderbird ) {
return 'mail:3pane'; return 'mail:3pane';
} }
@ -682,7 +682,7 @@ vAPI.tabs.getAll = function(window) {
/******************************************************************************/ /******************************************************************************/
vAPI.tabs.getWindows = function() { vAPI.tabs.getWindows = function() {
var winumerator = Services.wm.getEnumerator(this.mostRecentWindowId); var winumerator = Services.wm.getEnumerator(this.chromeWindowType);
var windows = []; var windows = [];
while ( winumerator.hasMoreElements() ) { while ( winumerator.hasMoreElements() ) {
@ -754,7 +754,7 @@ vAPI.tabs.open = function(details) {
} }
} }
var win = Services.wm.getMostRecentWindow(this.mostRecentWindowId); var win = Services.wm.getMostRecentWindow(this.chromeWindowType);
var tabBrowser = getTabBrowser(win); var tabBrowser = getTabBrowser(win);
if ( vAPI.fennec ) { if ( vAPI.fennec ) {
@ -1023,7 +1023,7 @@ var tabWatcher = (function() {
}; };
var currentBrowser = function() { var currentBrowser = function() {
var win = Services.wm.getMostRecentWindow(vAPI.tabs.mostRecentWindowId); var win = Services.wm.getMostRecentWindow(vAPI.tabs.chromeWindowType);
// https://github.com/gorhill/uBlock/issues/399 // https://github.com/gorhill/uBlock/issues/399
// getTabBrowser() can return null at browser launch time. // getTabBrowser() can return null at browser launch time.
var tabBrowser = getTabBrowser(win); var tabBrowser = getTabBrowser(win);
@ -1291,7 +1291,7 @@ vAPI.setIcon = function(tabId, iconStatus, badge) {
// If badge is undefined, then setIcon was called from the TabSelect event // If badge is undefined, then setIcon was called from the TabSelect event
var win = badge === undefined var win = badge === undefined
? iconStatus ? iconStatus
: Services.wm.getMostRecentWindow(vAPI.tabs.mostRecentWindowId); : Services.wm.getMostRecentWindow(vAPI.tabs.chromeWindowType);
var curTabId = tabWatcher.tabIdFromTarget(getTabBrowser(win).selectedTab); var curTabId = tabWatcher.tabIdFromTarget(getTabBrowser(win).selectedTab);
var tb = vAPI.toolbarButton; var tb = vAPI.toolbarButton;