mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 21:32:25 +01:00
new vimperator.buffer.element function to quickly retrieve a single element with XPath attributes
This commit is contained in:
@@ -283,6 +283,13 @@ vimperator.Buffer = function () //{{{
|
||||
return window.content.document.title;
|
||||
},
|
||||
|
||||
// quick function to get elements inside the document reliably
|
||||
// argument "args" is something like: @id='myid' or @type='text' (don't forget the quoted around myid)
|
||||
element: function (args, index)
|
||||
{
|
||||
return vimperator.buffer.evaluateXPath("//*[" + (args || "") + "]").snapshotItem(index || 0)
|
||||
},
|
||||
|
||||
// returns an XPathResult object
|
||||
evaluateXPath: function (expression, doc, elem, asIterator)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user