mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-08-10 23:40:30 -04:00
tweaks post-troubleshooting ARI-5241
This commit is contained in:
parent
abc39c0ef2
commit
692707a9e0
1 changed files with 8 additions and 6 deletions
|
@ -61,17 +61,19 @@ class UmbraBehavior {
|
||||||
for (var j = 0; j < documentsLength; j++) {
|
for (var j = 0; j < documentsLength; j++) {
|
||||||
if (closeSelector) {
|
if (closeSelector) {
|
||||||
var closeTargets = documents[j].querySelectorAll(closeSelector);
|
var closeTargets = documents[j].querySelectorAll(closeSelector);
|
||||||
if (closeTargets != []) {
|
if ((closeTargets.length > 0) &&
|
||||||
this.doTarget(closeTargets[0], 'click');
|
(this.alreadyDone.indexOf(closeTargets[0]) === -1) &&
|
||||||
didSomething = true;
|
(this.isVisible(closeTargets[0]))) {
|
||||||
|
console.log('closing');
|
||||||
|
doTarget(closeTargets[0], 'click');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var doTargets = documents[j].querySelectorAll(selector);
|
var doTargets = documents[j].querySelectorAll(selector);
|
||||||
if (doTargets == []) {
|
var doTargetsLength = doTargets.length;
|
||||||
|
if (!(doTargetsLength > 0)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var doTargetsLength = doTargets.length;
|
|
||||||
for ( var i = 0; i < doTargetsLength; i++) {
|
for ( var i = 0; i < doTargetsLength; i++) {
|
||||||
if (this.alreadyDone.indexOf(doTargets[i]) > -1) {
|
if (this.alreadyDone.indexOf(doTargets[i]) > -1) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -121,7 +123,7 @@ class UmbraBehavior {
|
||||||
this.idleSince = Date.now();
|
this.idleSince = Date.now();
|
||||||
} else {
|
} else {
|
||||||
var idleTimeMs = Date.now() - this.idleSince;
|
var idleTimeMs = Date.now() - this.idleSince;
|
||||||
if ((idleTimeMs / 1000) > (this.IDLE_TIMEOUT_SEC - 1) && this.index < (this.actions.length - 1)) {
|
if ((idleTimeMs / 1000) > (this.IDLE_TIMEOUT_SEC - 1) && (this.index < (this.actions.length - 1))) {
|
||||||
console.log("ready for next action");
|
console.log("ready for next action");
|
||||||
this.index += 1;
|
this.index += 1;
|
||||||
this.idleSince = null;
|
this.idleSince = null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue