mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-22 09:25:45 +01:00
Move some event-based code into observers in the modules it affects.
This commit is contained in:
@@ -1645,6 +1645,17 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
|
||||
wrapCallback: wrapCallback,
|
||||
|
||||
/**
|
||||
* Returns the top-level chrome window for the given window.
|
||||
*
|
||||
* @param {Window} win The child window.
|
||||
* @returns {Window} The top-level parent window.
|
||||
*/
|
||||
topWindow: function topWindow(win)
|
||||
win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem).rootTreeItem
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow),
|
||||
|
||||
/**
|
||||
* Traps errors in the called function, possibly reporting them.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user