MCPcopy Index your code
hub / github.com/XIU2/UserScript / getOne

Function getOne

Autopage.user.js:2376–2384  ·  view source on GitHub ↗
(selector, contextNode = undefined, doc = document)

Source from the content-addressed store, hash-verified

2374 return result;
2375 }
2376 function getOne(selector, contextNode = undefined, doc = document) {
2377 if (!selector) return;
2378 contextNode = contextNode || doc;
2379 if (selector.slice(0,1) === '/' || selector.slice(0,2) === './' || selector.slice(0,2) === '(/' || selector.slice(0,3) === 'id(') {
2380 return getXpath(selector, contextNode, doc);
2381 } else {
2382 return getCSS(selector, contextNode);
2383 }
2384 }
2385 function getAll(selector, contextNode = undefined, doc = document) {
2386 if (!selector) return [];
2387 contextNode = contextNode || doc;

Callers 13

setDBSiteFunction · 0.85
mangabz_insertEFunction · 0.85
dm5_insertEFunction · 0.85
xmanhua_insertEFunction · 0.85
pageLoadingFunction · 0.85
processElemsFunction · 0.85
getNextE_Function · 0.85
getNextEFunction · 0.85
getNextEPFunction · 0.85
getNextEPNFunction · 0.85
getNextFFunction · 0.85
replaceElemsFunction · 0.85

Calls 2

getCSSFunction · 0.85
getXpathFunction · 0.70

Tested by

no test coverage detected