NetworkPrioritizer.jsm File Reference

Go to the source code of this file.

Functions

Components utils import ("resource://gre/modules/XPCOMUtils.jsm")
 
XPCOMUtils defineLazyServiceGetter (this,"_focusManager","@mozilla.org/focus-manager;1","nsIFocusManager")
 
function trackBrowserWindow (aWindow)
 
function _handleEvent (aEvent)
 

Variables

let EXPORTED_SYMBOLS = ["trackBrowserWindow"]
 
const Ci = Components.interfaces
 
const TAB_EVENTS = ["TabOpen", "TabSelect"]
 
const WINDOW_EVENTS = ["activate", "unload"]
 
const PRIORITY_DELTA = -10
 
let _lastFocusedWindow = null
 
let _windows = []
 
let BrowserHelper
 
let WindowHelper
 

Function Documentation

function _handleEvent (   aEvent)

Definition at line 80 of file NetworkPrioritizer.jsm.

XPCOMUtils defineLazyServiceGetter ( this  ,
"_focusManager"  ,
"@mozilla.org/focus-manager;1"  ,
"nsIFocusManager"   
)
Components utils import ( "resource://gre/modules/XPCOMUtils.jsm"  )
function trackBrowserWindow (   aWindow)

Definition at line 74 of file NetworkPrioritizer.jsm.

Variable Documentation

let _lastFocusedWindow = null

Definition at line 69 of file NetworkPrioritizer.jsm.

let _windows = []

Definition at line 70 of file NetworkPrioritizer.jsm.

let BrowserHelper
Initial value:
= {
onOpen: function(aBrowser) {
if (aBrowser.ownerDocument.defaultView != _lastFocusedWindow)
this.decreasePriority(aBrowser);
},
onSelect: function(aBrowser) {
let windowEntry = WindowHelper.getEntry(aBrowser.ownerDocument.defaultView);
if (windowEntry.lastSelectedBrowser)
this.decreasePriority(windowEntry.lastSelectedBrowser);
this.increasePriority(aBrowser);
windowEntry.lastSelectedBrowser = aBrowser;
},
getLoadgroup: function(aBrowser) {
return aBrowser.webNavigation.QueryInterface(Ci.nsIDocumentLoader)
.loadGroup.QueryInterface(Ci.nsISupportsPriority);
},
increasePriority: function(aBrowser) {
this.getLoadgroup(aBrowser).adjustPriority(PRIORITY_DELTA);
},
decreasePriority: function(aBrowser) {
this.getLoadgroup(aBrowser).adjustPriority(PRIORITY_DELTA * -1);
}
}
const PRIORITY_DELTA
let _lastFocusedWindow
const Ci
let WindowHelper
_updateTextAndScrollDataForTab aBrowser
_dialogDatepicker onSelect

Definition at line 99 of file NetworkPrioritizer.jsm.

Definition at line 50 of file NetworkPrioritizer.jsm.

let EXPORTED_SYMBOLS = ["trackBrowserWindow"]

Definition at line 48 of file NetworkPrioritizer.jsm.

const PRIORITY_DELTA = -10

Definition at line 65 of file NetworkPrioritizer.jsm.

const TAB_EVENTS = ["TabOpen", "TabSelect"]

Definition at line 62 of file NetworkPrioritizer.jsm.

const WINDOW_EVENTS = ["activate", "unload"]

Definition at line 63 of file NetworkPrioritizer.jsm.

let WindowHelper

Definition at line 132 of file NetworkPrioritizer.jsm.