mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-04 10:25:48 +01:00
move the global evaluateXPath() function to vimperator.buffer
This commit is contained in:
@@ -138,6 +138,28 @@ function Buffer() //{{{
|
||||
return window.content.document.title;
|
||||
});
|
||||
|
||||
// returns an XPathResult object
|
||||
this.evaluateXPath = function(expression, doc, ordered)
|
||||
{
|
||||
if (!doc)
|
||||
doc = window.content.document;
|
||||
|
||||
var result = doc.evaluate(expression, doc,
|
||||
function lookupNamespaceURI(prefix) {
|
||||
switch (prefix) {
|
||||
case 'xhtml':
|
||||
return 'http://www.w3.org/1999/xhtml';
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
},
|
||||
ordered ? XPathResult.ORDERED_NODE_SNAPSHOT_TYPE : XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
||||
null
|
||||
);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// TODO: move to v.buffers.list()
|
||||
this.list = function(fullmode)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user