mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-27 05:21:23 +02:00
Make waitForPageLoad interruptable.
--HG-- branch : key-processing
This commit is contained in:
@@ -913,11 +913,7 @@ var Events = Module("events", {
|
|||||||
dactyl.echo("Waiting for page to load...", commandline.DISALLOW_MULTILINE);
|
dactyl.echo("Waiting for page to load...", commandline.DISALLOW_MULTILINE);
|
||||||
|
|
||||||
const maxWaitTime = (time || 25);
|
const maxWaitTime = (time || 25);
|
||||||
let start = Date.now();
|
util.waitFor(function () !events.feedingKeys || buffer.loaded, this, maxWaitTime * 1000, true);
|
||||||
let end = start + (maxWaitTime * 1000);
|
|
||||||
|
|
||||||
util.waitFor(function () !events.feedingKeys || buffer.loaded, this, maxWaitTime);
|
|
||||||
commandline.clear();
|
|
||||||
|
|
||||||
if (!buffer.loaded)
|
if (!buffer.loaded)
|
||||||
dactyl.echoerr("Page did not load completely in " + maxWaitTime + " seconds. Macro stopped.");
|
dactyl.echoerr("Page did not load completely in " + maxWaitTime + " seconds. Macro stopped.");
|
||||||
|
|||||||
Reference in New Issue
Block a user