Implement GM_xpath and GM_xpathAll
Reported by Scriptish | September 18th, 2011 @ 09:54 PM
I found myself copy pasting xpath functions in many of my user
scripts, hence this pull:
Implement new GM utility functions: GM_xpath and GM_xpathAll.
Both functions accept one or multiple xpath expressions.
GM_xpath will return the first matching node, while GM_xpathAll
will return all matching nodes.
For more fine grained control (specifying a context node, namespace resolvers) there is still the regular document.evaluate.
I considered other names as well, but figured that using a GM_ prefix has the least likely risk to break existing scripts.
@erikvold, @supahgreg, what do you think?