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

Function findFile

Picviewer CE+/dist.user.js:25619–25628  ·  view source on GitHub ↗
(n, url)

Source from the content-addressed store, hash-verified

25617 }
25618
25619 function findFile(n, url) {
25620 pretreatment(n, true);
25621 var path = (n.dataset && n.dataset.src) || n.src || n.href || (n.children && n.children[0] && n.children[0].src);
25622 if (/^video$/i.test(n.nodeName)) {
25623 path = "video:" + path;
25624 } else if (/^audio$/i.test(n.nodeName)) {
25625 path = "audio:" + path;
25626 } else if (path.baseVal) path = path.baseVal;
25627 return path ? path.trim() : false;
25628 }
25629
25630 function findCaption(n) {
25631 return n.getAttribute('content') || n.getAttribute('title') || n.textContent;

Callers 1

parsePageFunction · 0.70

Calls 1

pretreatmentFunction · 0.70

Tested by

no test coverage detected