1
0
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:
Kris Maglione
2011-02-27 16:58:21 -05:00
parent 191ece33e0
commit 74fbc5833f
10 changed files with 159 additions and 99 deletions

View File

@@ -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.
*