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

Function executeStep3

background/steps/fill-password.js:18–54  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

16 } = deps;
17
18 async function executeStep3(state) {
19 const resolvedEmail = state.email;
20 if (!resolvedEmail) {
21 throw new Error('缺少邮箱地址,请先完成步骤 2。');
22 }
23
24 const signupTabId = await getTabId('signup-page');
25 if (!signupTabId || !(await isTabAlive('signup-page'))) {
26 throw new Error('认证页面标签页已关闭,请先重新完成步骤 2。');
27 }
28
29 const password = state.customPassword || generatePassword();
30 await setPasswordState(password);
31
32 const accounts = state.accounts || [];
33 accounts.push({ email: resolvedEmail, password, createdAt: new Date().toISOString() });
34 await setState({ accounts });
35
36 await chrome.tabs.update(signupTabId, { active: true });
37 await ensureContentScriptReadyOnTab('signup-page', signupTabId, {
38 inject: SIGNUP_PAGE_INJECT_FILES,
39 injectSource: 'signup-page',
40 timeoutMs: 45000,
41 retryDelayMs: 900,
42 logMessage: '步骤 3:密码页内容脚本未就绪,正在等待页面恢复...',
43 });
44
45 await addLog(
46 `步骤 3:正在填写密码,邮箱为 ${resolvedEmail},密码为${state.customPassword ? '自定义' : '自动生成'}(${password.length} 位)`
47 );
48 await sendToContentScript('signup-page', {
49 type: 'EXECUTE_STEP',
50 step: 3,
51 source: 'background',
52 payload: { email: resolvedEmail, password },
53 });
54 }
55
56 return { executeStep3 };
57 }

Callers

nothing calls this directly

Calls 8

generatePasswordFunction · 0.85
setPasswordStateFunction · 0.85
setStateFunction · 0.85
getTabIdFunction · 0.50
isTabAliveFunction · 0.50
addLogFunction · 0.50
sendToContentScriptFunction · 0.50

Tested by

no test coverage detected