MCPcopy Index your code
hub / github.com/hoothin/UserScripts / xpathNode

Function xpathNode

Pagetual/pagetual.user.js:4537–4540  ·  view source on GitHub ↗
(s, d, n)

Source from the content-addressed store, hash-verified

4535 contextNode = contextNode || doc;
4536 try {
4537 let xpathNode = (s, d, n) => {
4538 let result = d.evaluate(s, n, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null);
4539 return result.singleNodeValue && result.singleNodeValue.nodeType === 1 && result.singleNodeValue;
4540 };
4541 let selSplit = xpath.split(" =>> ");
4542 if (selSplit.length === 2) {
4543 let ele = xpathNode(selSplit[0], doc, contextNode);

Callers 1

getElementByXpathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected