windex

jQuery-like that's safe to use in a Firefox Extension
git clone https://wehaveforgeathome.hates.computer/windex.git
Log | Files | Refs | LICENSE

commit ce405dd47079599301b04c91be92b9b4e841b93e
parent f213fd96efb098cd990687a386fd824003b0b169
Author: Ryan Wolf <rwolf@borderstylo.com>
Date:   Wed,  5 Jan 2011 12:04:32 -0800

defaultContext is on Windex now

Diffstat:
Mwindex.js | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/windex.js b/windex.js @@ -20,21 +20,21 @@ var Windex = exports = function(selector, context) { } // TODO: return documents, windows - if (selector == "body") return Windex(defaultContext()); + if (selector == "body") return Windex(this.defaultContext()); if (selector == "!document") { - var document = defaultContext().ownerDocument; + var document = this.defaultContext().ownerDocument; return Windex(document); } if (selector == "!window") { - return Windex(defaultContext()); - var document = defaultContext().ownerDocument; + return Windex(this.defaultContext()); + var document = this.defaultContext().ownerDocument; var window = document.defaultView; return Windex(window); } if (!context) { Cu.reportError(selector); - return Windex(selector, defaultContext()); + return Windex(selector, this.defaultContext()); } // if passed in a list of nodes, meant the first one @@ -47,7 +47,7 @@ var Windex = exports = function(selector, context) { return new WindexNodes([context], selector, context).find(selector); }; -Windex.prototype.defaultContext = null; +Windex.defaultContext = null; // See: http://api.jquery.com/jQuery.extend/ Windex.extend = function () {