MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / waitForSignupEntryState

Function waitForSignupEntryState

content/signup-page.js:368–401  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

366}
367
368async function waitForSignupEntryState(options = {}) {
369 const {
370 timeout = 15000,
371 autoOpenEntry = false,
372 } = options;
373 const start = Date.now();
374 let lastTriggerClickAt = 0;
375
376 while (Date.now() - start < timeout) {
377 throwIfStopped();
378 const snapshot = inspectSignupEntryState();
379
380 if (snapshot.state === 'password_page' || snapshot.state === 'email_entry') {
381 return snapshot;
382 }
383
384 if (snapshot.state === 'entry_home') {
385 if (!autoOpenEntry) {
386 return snapshot;
387 }
388
389 if (Date.now() - lastTriggerClickAt >= 1500) {
390 lastTriggerClickAt = Date.now();
391 log('步骤 2:正在点击官网注册入口...');
392 await humanPause(350, 900);
393 simulateClick(snapshot.signupTrigger);
394 }
395 }
396
397 await sleep(250);
398 }
399
400 return inspectSignupEntryState();
401}
402
403async function ensureSignupEntryReady(timeout = 15000) {
404 const snapshot = await waitForSignupEntryState({ timeout, autoOpenEntry: false });

Callers 2

ensureSignupEntryReadyFunction · 0.85

Calls 6

inspectSignupEntryStateFunction · 0.85
logFunction · 0.85
humanPauseFunction · 0.85
simulateClickFunction · 0.85
sleepFunction · 0.85
throwIfStoppedFunction · 0.70

Tested by

no test coverage detected