#416 closed
Scriptish

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?

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket