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

Function isVisible

Pagetual/pagetual.user.js:10669–10683  ·  view source on GitHub ↗
(el, win)

Source from the content-addressed store, hash-verified

10667 }
10668
10669 function isVisible(el, win) {
10670 if(!el || !el.offsetParent)return false;
10671 var loopable = true,
10672 visible = el.nodeName && win.getComputedStyle(el).display != 'none' && win.getComputedStyle(el).visibility != 'hidden';
10673 while(loopable && visible) {
10674 el = el.parentNode;
10675
10676 if(el && el.nodeType === 1 && !compareNodeName(el, ["body"])) {
10677 visible = win.getComputedStyle(el).display != 'none' && win.getComputedStyle(el).visibility != 'hidden';
10678 }else {
10679 loopable = false;
10680 }
10681 }
10682 return visible;
10683 }
10684
10685 function getElementTop(ele) {
10686 if (!ele) return 0;

Callers 4

querySelectorListMethod · 0.85
getNextLinkMethod · 0.85
isInViewPortFunction · 0.85
checkPageFunction · 0.85

Calls 1

compareNodeNameFunction · 0.85

Tested by

no test coverage detected