diff --git a/background.js b/background.js
index e52b7d4..f7bd807 100644
--- a/background.js
+++ b/background.js
@@ -158,7 +158,6 @@ const DEFAULT_VERIFICATION_RESEND_COUNT = 4;
const LEGACY_AUTO_STEP_DELAY_KEYS = ['autoStepRandomDelayMinSeconds', 'autoStepRandomDelayMaxSeconds'];
const LEGACY_VERIFICATION_RESEND_COUNT_KEYS = ['signupVerificationResendCount', 'loginVerificationResendCount'];
const DEFAULT_LOCAL_CPA_STEP9_MODE = 'submit';
-const DEFAULT_CPA_CALLBACK_MODE = 'step9';
const MAIL_2925_MODE_PROVIDE = 'provide';
const MAIL_2925_MODE_RECEIVE = 'receive';
const DEFAULT_MAIL_2925_MODE = MAIL_2925_MODE_PROVIDE;
@@ -212,7 +211,6 @@ const PERSISTED_SETTING_DEFAULTS = {
vpsUrl: '',
vpsPassword: '',
localCpaStep9Mode: DEFAULT_LOCAL_CPA_STEP9_MODE,
- cpaCallbackMode: DEFAULT_CPA_CALLBACK_MODE,
sub2apiUrl: DEFAULT_SUB2API_URL,
sub2apiEmail: '',
sub2apiPassword: '',
@@ -688,17 +686,6 @@ function normalizeLocalCpaStep9Mode(value = '') {
: DEFAULT_LOCAL_CPA_STEP9_MODE;
}
-function normalizeCpaCallbackMode(value = '') {
- const normalized = String(value || '').trim().toLowerCase();
- if (normalized === 'step7' || normalized === 'step6') {
- return 'step7';
- }
- if (normalized === 'step9' || normalized === 'step8') {
- return 'step9';
- }
- return DEFAULT_CPA_CALLBACK_MODE;
-}
-
function normalizeCloudflareDomain(rawValue = '') {
let value = String(rawValue || '').trim().toLowerCase();
if (!value) return '';
@@ -833,8 +820,6 @@ function normalizePersistentSettingValue(key, value) {
return String(value || '');
case 'localCpaStep9Mode':
return normalizeLocalCpaStep9Mode(value);
- case 'cpaCallbackMode':
- return normalizeCpaCallbackMode(value);
case 'sub2apiUrl':
return String(value || '').trim();
case 'sub2apiEmail':
@@ -3585,14 +3570,6 @@ function shouldBypassStep9ForLocalCpa(state) {
&& isLocalCpaUrl(state?.vpsUrl);
}
-function shouldSkipLoginVerificationForCpaCallback(state) {
- if (typeof navigationUtils !== 'undefined' && navigationUtils?.shouldSkipLoginVerificationForCpaCallback) {
- return navigationUtils.shouldSkipLoginVerificationForCpaCallback(state);
- }
- return getPanelMode(state) === 'cpa'
- && normalizeCpaCallbackMode(state?.cpaCallbackMode) === 'step7';
-}
-
function matchesSourceUrlFamily(source, candidateUrl, referenceUrl) {
if (typeof navigationUtils !== 'undefined' && navigationUtils?.matchesSourceUrlFamily) {
return navigationUtils.matchesSourceUrlFamily(source, candidateUrl, referenceUrl);
@@ -3819,7 +3796,6 @@ function isRetryableContentScriptTransportError(error) {
const navigationUtils = self.MultiPageBackgroundNavigationUtils?.createNavigationUtils({
DEFAULT_SUB2API_URL,
- normalizeCpaCallbackMode,
normalizeLocalCpaStep9Mode,
});
@@ -5501,10 +5477,6 @@ async function runAutoSequenceFromStep(startStep, context = {}) {
try {
await executeStepAndWait(step, AUTO_STEP_DELAYS[step]);
const latestState = await getState();
- if (step === FINAL_OAUTH_CHAIN_START_STEP && shouldSkipLoginVerificationForCpaCallback(latestState)) {
- step = 9;
- continue;
- }
step += 1;
} catch (err) {
if (isStopError(err)) {
@@ -5816,8 +5788,6 @@ const step7Executor = self.MultiPageBackgroundStep7?.createStep7Executor({
refreshOAuthUrlBeforeStep6,
reuseOrCreateTab,
sendToContentScriptResilient,
- shouldSkipLoginVerificationForCpaCallback,
- skipLoginVerificationStepsForCpaCallback,
startOAuthFlowTimeoutWindow,
STEP6_MAX_ATTEMPTS,
throwIfStopped,
@@ -5843,7 +5813,6 @@ const step8Executor = self.MultiPageBackgroundStep8?.createStep8Executor({
reuseOrCreateTab,
setState,
setStepStatus,
- shouldSkipLoginVerificationForCpaCallback,
shouldUseCustomRegistrationEmail,
sleepWithStop,
STANDARD_MAIL_VERIFICATION_RESEND_INTERVAL_MS,
@@ -6466,21 +6435,6 @@ async function ensureStep8VerificationPageReady(options = {}) {
throw new Error(`当前未进入登录验证码页面,请先重新完成步骤 7。当前状态:${stateLabel}.${urlPart}`.trim());
}
-async function skipLoginVerificationStepsForCpaCallback() {
- await setState({
- lastLoginCode: null,
- loginVerificationRequestedAt: null,
- oauthFlowDeadlineAt: null,
- });
- await setStepStatus(7, 'skipped');
- await addLog('步骤 7:当前已选择“第七步回调”,直接跳过步骤 7、8。', 'warn');
- const latestState = await getState();
- if (!isStepDoneStatus(latestState.stepStatuses?.[8])) {
- await setStepStatus(8, 'skipped');
- await addLog('步骤 8:当前已选择“第七步回调”,本轮无需获取登录验证码。', 'warn');
- }
-}
-
async function executeStep6() {
return step6Executor.executeStep6();
}
diff --git a/background/navigation-utils.js b/background/navigation-utils.js
index 067e08c..2c7b793 100644
--- a/background/navigation-utils.js
+++ b/background/navigation-utils.js
@@ -4,7 +4,6 @@
function createNavigationUtils(deps = {}) {
const {
DEFAULT_SUB2API_URL,
- normalizeCpaCallbackMode,
normalizeLocalCpaStep9Mode,
} = deps;
@@ -90,11 +89,6 @@
&& isLocalCpaUrl(state?.vpsUrl);
}
- function shouldSkipLoginVerificationForCpaCallback(state) {
- return getPanelMode(state) === 'cpa'
- && normalizeCpaCallbackMode(state?.cpaCallbackMode) === 'step7';
- }
-
function matchesSourceUrlFamily(source, candidateUrl, referenceUrl) {
const candidate = parseUrlSafely(candidateUrl);
if (!candidate) return false;
@@ -169,7 +163,6 @@
normalizeSub2ApiUrl,
parseUrlSafely,
shouldBypassStep9ForLocalCpa,
- shouldSkipLoginVerificationForCpaCallback,
};
}
diff --git a/background/steps/fetch-login-code.js b/background/steps/fetch-login-code.js
index cd5832d..e0dd7ec 100644
--- a/background/steps/fetch-login-code.js
+++ b/background/steps/fetch-login-code.js
@@ -22,7 +22,6 @@
reuseOrCreateTab,
setState,
setStepStatus,
- shouldSkipLoginVerificationForCpaCallback,
shouldUseCustomRegistrationEmail,
sleepWithStop,
STANDARD_MAIL_VERIFICATION_RESEND_INTERVAL_MS,
@@ -127,17 +126,6 @@
}
async function executeStep8(state) {
- if (shouldSkipLoginVerificationForCpaCallback(state)) {
- await setState({
- lastLoginCode: null,
- loginVerificationRequestedAt: null,
- oauthFlowDeadlineAt: null,
- });
- await setStepStatus(8, 'skipped');
- await addLog('步骤 8:当前已选择“第七步回调”,本轮无需获取登录验证码。', 'warn');
- return;
- }
-
let currentState = state;
let mailPollingAttempt = 1;
let lastMailPollingError = null;
diff --git a/background/steps/oauth-login.js b/background/steps/oauth-login.js
index 69044c0..ce729ad 100644
--- a/background/steps/oauth-login.js
+++ b/background/steps/oauth-login.js
@@ -14,18 +14,12 @@
refreshOAuthUrlBeforeStep6,
reuseOrCreateTab,
sendToContentScriptResilient,
- shouldSkipLoginVerificationForCpaCallback,
- skipLoginVerificationStepsForCpaCallback,
startOAuthFlowTimeoutWindow,
STEP6_MAX_ATTEMPTS,
throwIfStopped,
} = deps;
async function executeStep7(state) {
- if (shouldSkipLoginVerificationForCpaCallback(state)) {
- await skipLoginVerificationStepsForCpaCallback();
- return;
- }
if (!state.email) {
throw new Error('缺少邮箱地址,请先完成步骤 3。');
}
diff --git a/sidepanel/sidepanel.html b/sidepanel/sidepanel.html
index 4a8d167..47705e4 100644
--- a/sidepanel/sidepanel.html
+++ b/sidepanel/sidepanel.html
@@ -123,13 +123,6 @@
-
-
CPA回调
-
-
-
-
-
SUB2API
button.classList.contains('is-active'));
- return normalizeCpaCallbackMode(activeButton?.dataset.cpaCallbackMode);
-}
-
-function setCpaCallbackMode(mode) {
- const resolvedMode = normalizeCpaCallbackMode(mode);
- cpaCallbackModeButtons.forEach((button) => {
- const active = button.dataset.cpaCallbackMode === resolvedMode;
- button.classList.toggle('is-active', active);
- button.setAttribute('aria-pressed', String(active));
- });
-}
-
function getSelectedMail2925Mode() {
const activeButton = mail2925ModeButtons.find((button) => button.classList.contains('is-active'));
return normalizeMail2925Mode(activeButton?.dataset.mail2925Mode);
@@ -1700,7 +1671,6 @@ function applySettingsState(state) {
inputVpsUrl.value = state?.vpsUrl || '';
inputVpsPassword.value = state?.vpsPassword || '';
setLocalCpaStep9Mode(state?.localCpaStep9Mode);
- setCpaCallbackMode(state?.cpaCallbackMode);
selectPanelMode.value = state?.panelMode || 'cpa';
inputSub2ApiUrl.value = state?.sub2apiUrl || '';
inputSub2ApiEmail.value = state?.sub2apiEmail || '';
@@ -2496,7 +2466,6 @@ function updatePanelModeUI() {
rowVpsUrl.style.display = useSub2Api ? 'none' : '';
rowVpsPassword.style.display = useSub2Api ? 'none' : '';
rowLocalCpaStep9Mode.style.display = useSub2Api ? 'none' : '';
- rowCpaCallbackMode.style.display = useSub2Api ? 'none' : '';
rowSub2ApiUrl.style.display = useSub2Api ? '' : 'none';
rowSub2ApiEmail.style.display = useSub2Api ? '' : 'none';
rowSub2ApiPassword.style.display = useSub2Api ? '' : 'none';
@@ -3243,18 +3212,6 @@ localCpaStep9ModeButtons.forEach((button) => {
});
});
-cpaCallbackModeButtons.forEach((button) => {
- button.addEventListener('click', () => {
- const nextMode = button.dataset.cpaCallbackMode;
- if (getSelectedCpaCallbackMode() === normalizeCpaCallbackMode(nextMode)) {
- return;
- }
- setCpaCallbackMode(nextMode);
- markSettingsDirty(true);
- saveSettings({ silent: true }).catch(() => { });
- });
-});
-
hotmailServiceModeButtons.forEach((button) => {
button.addEventListener('click', () => {
if (button.disabled) {
@@ -4013,9 +3970,6 @@ chrome.runtime.onMessage.addListener((message, _sender, sendResponse) => {
if (message.payload.localCpaStep9Mode !== undefined) {
setLocalCpaStep9Mode(message.payload.localCpaStep9Mode);
}
- if (message.payload.cpaCallbackMode !== undefined) {
- setCpaCallbackMode(message.payload.cpaCallbackMode);
- }
if (message.payload.oauthUrl !== undefined) {
displayOauthUrl.textContent = message.payload.oauthUrl || '等待中...';
displayOauthUrl.classList.toggle('has-value', Boolean(message.payload.oauthUrl));
@@ -4207,7 +4161,6 @@ initHotmailListExpandedState();
updateSaveButtonState();
updateConfigMenuControls();
setLocalCpaStep9Mode(DEFAULT_LOCAL_CPA_STEP9_MODE);
-setCpaCallbackMode(DEFAULT_CPA_CALLBACK_MODE);
setMail2925Mode(DEFAULT_MAIL_2925_MODE);
initializeReleaseInfo().catch((err) => {
console.error('Failed to initialize release info:', err);
diff --git a/tests/auto-run-step4-restart.test.js b/tests/auto-run-step4-restart.test.js
index dd57c7b..6cd4c94 100644
--- a/tests/auto-run-step4-restart.test.js
+++ b/tests/auto-run-step4-restart.test.js
@@ -143,9 +143,6 @@ async function getTabId() {
return 1;
}
-function shouldSkipLoginVerificationForCpaCallback() {
- return false;
-}
async function invalidateDownstreamAfterStepRestart(step, options = {}) {
events.invalidations.push({ step, options });
diff --git a/tests/auto-run-step6-restart.test.js b/tests/auto-run-step6-restart.test.js
index 2d426c4..0cde267 100644
--- a/tests/auto-run-step6-restart.test.js
+++ b/tests/auto-run-step6-restart.test.js
@@ -114,9 +114,6 @@ async function executeStepAndWait(step) {
async function getTabId() {
return 1;
}
-function shouldSkipLoginVerificationForCpaCallback() {
- return false;
-}
async function invalidateDownstreamAfterStepRestart(step, options = {}) {
events.invalidations.push({ step, options });
}
diff --git a/tests/background-account-history-settings.test.js b/tests/background-account-history-settings.test.js
index 6fcdbb0..a732000 100644
--- a/tests/background-account-history-settings.test.js
+++ b/tests/background-account-history-settings.test.js
@@ -71,10 +71,6 @@ const PERSISTED_SETTING_DEFAULTS = {
};
function normalizePanelMode(value) { return value === 'sub2api' ? 'sub2api' : 'cpa'; }
function normalizeLocalCpaStep9Mode(value) { return value === 'bypass' ? 'bypass' : 'submit'; }
-function normalizeCpaCallbackMode(value) {
- if (value === 'step7' || value === 'step6') return 'step7';
- return value === 'step9' || value === 'step8' ? 'step9' : 'step9';
-}
function normalizeAutoRunFallbackThreadIntervalMinutes(value) { return Number(value) || 0; }
function normalizeAutoRunDelayMinutes(value) { return Number(value) || 30; }
function normalizeAutoStepDelaySeconds(value) { return value == null || value === '' ? null : Number(value); }
diff --git a/tests/background-step6-retry-limit.test.js b/tests/background-step6-retry-limit.test.js
index aa0fd46..eed29ca 100644
--- a/tests/background-step6-retry-limit.test.js
+++ b/tests/background-step6-retry-limit.test.js
@@ -61,8 +61,6 @@ test('step 7 retries up to configured limit and then fails', async () => {
message: '当前仍停留在邮箱页。',
};
},
- shouldSkipLoginVerificationForCpaCallback: () => false,
- skipLoginVerificationStepsForCpaCallback: async () => {},
STEP6_MAX_ATTEMPTS: 3,
throwIfStopped: () => {},
});
@@ -105,8 +103,6 @@ test('step 7 starts a new oauth timeout window for each refreshed oauth url', as
step6Outcome: 'success',
usedTimeoutMs: options.timeoutMs,
}),
- shouldSkipLoginVerificationForCpaCallback: () => false,
- skipLoginVerificationStepsForCpaCallback: async () => {},
startOAuthFlowTimeoutWindow: async (payload) => {
events.startedWindows.push(payload);
},
diff --git a/tests/background-step7-recovery.test.js b/tests/background-step7-recovery.test.js
index 1efb3e3..4a1c3a9 100644
--- a/tests/background-step7-recovery.test.js
+++ b/tests/background-step7-recovery.test.js
@@ -55,7 +55,6 @@ test('step 8 submits login verification directly without replaying step 7', asyn
reuseOrCreateTab: async () => {},
setState: async () => {},
setStepStatus: async () => {},
- shouldSkipLoginVerificationForCpaCallback: () => false,
shouldUseCustomRegistrationEmail: () => false,
sleepWithStop: async (ms) => {
calls.sleep.push(ms);
@@ -123,7 +122,6 @@ test('step 8 disables resend interval for 2925 mailbox polling', async () => {
reuseOrCreateTab: async () => {},
setState: async () => {},
setStepStatus: async () => {},
- shouldSkipLoginVerificationForCpaCallback: () => false,
shouldUseCustomRegistrationEmail: () => false,
sleepWithStop: async () => {},
STANDARD_MAIL_VERIFICATION_RESEND_INTERVAL_MS: 25000,
diff --git a/项目完整链路说明.md b/项目完整链路说明.md
index 37a3dc7..143a58d 100644
--- a/项目完整链路说明.md
+++ b/项目完整链路说明.md
@@ -300,6 +300,7 @@
4. 确保真正进入验证码页
5. 如果未进入验证码页,则按可恢复逻辑最多重试 3 次
6. 自动运行一旦进入步骤 7 之后的链路,若后续步骤报错且认证页未进入 `https://auth.openai.com/add-phone`,则统一回到步骤 7 重新开始授权流程
+7. CPA 回调阶段固定为步骤 9,不再支持“第七步回调”跳过步骤 7/8
### Step 8