[Webkit-unassigned] [Bug 19867] Inspector should support $(id) in the command line
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jul 4 03:03:59 PDT 2008
https://bugs.webkit.org/show_bug.cgi?id=19867
------- Comment #1 from casey.hattori at gmail.com 2008-07-04 03:03 PDT -------
Putting the code below into Console._evalInInspectedWindow kind of works. I'll
investigate a better way though.
expression = "(function () { \
var $ = $ || function(id) { return document.getElementById(id); };
\
var $$ = $$ || function(cl) { return
document.getElementsByClassName(cl); }; \
var $x = $x || function(xpath, context) { \
var nodes = []; \
try { \
var doc = context || document; \
var results = doc.evaluate(xpath, doc, null,
XPathResult.ANY_TYPE, null); \
var node; \
while (node = results.iterateNext()) nodes.push(node); \
} catch (e) {} \
return nodes; \
}; \
var keys = keys || function(o) { var a = []; for (k in o)
a.push(k); return a; }; \
var values = values || function(o) { var a = []; for (k in o)
a.push(o[k]); return a; }; \
return (" + expression + ")})();";
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list