[Greasemonkey] Platypus

Pramod Biligiri pramodbiligiri at gmail.com
Wed May 11 02:55:44 EDT 2005


On 5/10/05, Scott R. Turner <srt at aero.org> wrote:
> 
> Well, here's what I've been up to lately:
> 
> http://platypus.mozdev.org/index.html


Really cool extension! Though I guess this is just a starting point ;)

I notice that you calculate a reference to a node by checking on the id 
attribute. If not found, you proceed to recursively build an (absolute) 
XPath from the root of the document. Wouldn't this approach fail in many 
pages with dynamically generated data? ..Where you can't depend that an 
element will be an n-th child of m-th child of....till root.

Any ideas for that? I was thinking maybe allow user to specify arbitrary 
conditions upon any of the DOM properties of the node in the generated 
script, like a filter taking that node as input, of course with sane 
defaults.
<Shameless plug>
(I've posted this on the list earlier). Something like this snippet from 
http;//blogs.applibase.net/pramod/code/pageFilter.user.js:

{condition:"document.location.href", value:"new
String('http://www.google.com//////')"},
{condition:"node.nodeName", value:"new String('A')"},
{condition:"node.getAttribute('href')", value:"new String('/advanced_search')"},
{action:"Action.hideNode(node);"}

</Shameless plug>

Anyway...cool work! Can't wait for this to evolve.

Pramod
-- 
http://blogs.applibase.net/pramod
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/greasemonkey/attachments/20050511/76f9a3c6/attachment.htm


More information about the Greasemonkey mailing list