mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-02-23 16:19:49 -05:00
isVisible
This commit is contained in:
parent
bd5d4a8c97
commit
de55b54d14
@ -22,6 +22,13 @@ var umbraBehavior = {
|
||||
IDLE_TIMEOUT_SEC : 10,
|
||||
idleSince : null,
|
||||
|
||||
// https://github.com/jquery/jquery/blob/master/src/css/hiddenVisibleSelectors.js
|
||||
// n.b. returns true for elements with visibility:hidden, which occupy
|
||||
// screen real estate but are not visible, or clickable with the ui
|
||||
isVisible : function(elem) {
|
||||
return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
|
||||
},
|
||||
|
||||
intervalFunc : function() {
|
||||
var didSomething = false;
|
||||
var somethingLeftBelow = false;
|
||||
@ -43,6 +50,9 @@ var umbraBehavior = {
|
||||
var doTargets = documents[j].querySelectorAll(cssSelector);
|
||||
|
||||
for ( var i = 0; i < doTargets.length; i++) {
|
||||
if (!this.isVisible(doTargets[i])) {
|
||||
continue;
|
||||
}
|
||||
if (doTargets[i].umbraDone && !doUntilTimeout) {
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user