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

Method runWait

Pagetual/pagetual.user.js:5242–5260  ·  view source on GitHub ↗
(cb)

Source from the content-addressed store, hash-verified

5240 }
5241
5242 runWait(cb) {
5243 let checkEval = null, waitTime = 0;
5244 if (this.curSiteRule.waitElement) {
5245 checkEval = async doc => {
5246 return await this.waitElement(doc);
5247 };
5248 } else if(this.curSiteRule.wait) {
5249 if (isNaN(this.curSiteRule.wait)) {
5250 try {
5251 checkEval = (typeof this.curSiteRule.wait === 'function') ? this.curSiteRule.wait : new AsyncFunction("doc", '"use strict";' + this.curSiteRule.wait);
5252 } catch(e) {
5253 debug(e);
5254 }
5255 } else {
5256 waitTime = this.curSiteRule.wait;
5257 }
5258 }
5259 cb(checkEval, waitTime);
5260 }
5261
5262 findNoNext() {
5263 if (!this.curSiteRule || !this.curSiteRule.smart || this.curSiteRule.nextLink === 0 || this.possibleRule) return;

Callers 3

requestFromIframeFunction · 0.80
checkPageFunction · 0.80
forceIframeFunction · 0.80

Calls 2

waitElementMethod · 0.95
debugFunction · 0.85

Tested by

no test coverage detected