feat: refactor user registration steps into modular functions and implement step registry
- Replaced individual step imports with a centralized step registry in background.js - Created separate modules for each registration step: open-chatgpt, submit-signup-email, fill-password, fetch-signup-code, fill-profile, oauth-login, fetch-login-code, confirm-oauth, platform-verify - Updated tests to reflect changes in step imports and added new tests for step registry functionality
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
(function attachBackgroundStep1(root, factory) {
|
||||
root.MultiPageBackgroundStep1 = factory();
|
||||
})(typeof self !== 'undefined' ? self : globalThis, function createBackgroundStep1Module() {
|
||||
function createStep1Executor(deps = {}) {
|
||||
const {
|
||||
addLog,
|
||||
completeStepFromBackground,
|
||||
ensureSignupEntryPageReady,
|
||||
} = deps;
|
||||
|
||||
async function executeStep1() {
|
||||
await addLog('步骤 1:正在打开 ChatGPT 官网...');
|
||||
await ensureSignupEntryPageReady(1);
|
||||
await completeStepFromBackground(1, {});
|
||||
}
|
||||
|
||||
return { executeStep1 };
|
||||
}
|
||||
|
||||
return { createStep1Executor };
|
||||
});
|
||||
Reference in New Issue
Block a user