MCPcopy
hub / github.com/hoothin/UserScripts / getElementMix

Function getElementMix

Picviewer CE+/dist.user.js:13524–13540  ·  view source on GitHub ↗
(selector, contextNode, doc)

Source from the content-addressed store, hash-verified

13522 }
13523
13524 function getElementMix(selector, contextNode, doc) {
13525 var ret;
13526 if (!selector || !contextNode) return ret;
13527 doc = doc || document;
13528
13529 var type = typeof selector;
13530 if (type == 'string') {
13531 if (isXPath(selector)) {
13532 ret = getElementByXpath(selector, contextNode, doc);
13533 } else {
13534 ret = contextNode.parentNode.querySelector(selector);
13535 }
13536 } else if (type == 'function') {
13537 ret = selector(contextNode, doc);
13538 }
13539 return ret;
13540 }
13541
13542 function launchFullScreen(element) {
13543 if (element.requestFullscreen) {

Callers 2

findPicFunction · 0.70
checkFloatBarFunction · 0.70

Calls 2

isXPathFunction · 0.70
getElementByXpathFunction · 0.70

Tested by

no test coverage detected