feat: 更新 Plus Return 确认逻辑,增加等待时间至 40 秒并添加测试用例

This commit is contained in:
QLHazyCoder
2026-04-26 17:19:29 +08:00
parent f577487670
commit e9c3a61e55
3 changed files with 56 additions and 4 deletions
+3 -3
View File
@@ -3,6 +3,7 @@
})(typeof self !== 'undefined' ? self : globalThis, function createBackgroundPlusReturnConfirmModule() {
const PAYPAL_SOURCE = 'paypal-flow';
const PLUS_CHECKOUT_SOURCE = 'plus-checkout';
const PLUS_RETURN_SETTLE_WAIT_MS = 40000;
function createPlusReturnConfirmExecutor(deps = {}) {
const {
@@ -12,7 +13,6 @@
isTabAlive,
setState,
sleepWithStop,
waitForTabCompleteUntilStopped,
waitForTabUrlMatchUntilStopped,
} = deps;
@@ -41,8 +41,8 @@
const tabId = await resolveReturnTabId(state);
await addLog('步骤 9:正在等待 PayPal 授权后回跳到 ChatGPT / OpenAI 页面...', 'info');
const tab = await waitForTabUrlMatchUntilStopped(tabId, isReturnUrl);
await waitForTabCompleteUntilStopped(tabId);
await sleepWithStop(1000);
await addLog('步骤 9:已检测到订阅回跳页面,固定等待 40 秒让页面完成加载。', 'info');
await sleepWithStop(PLUS_RETURN_SETTLE_WAIT_MS);
await setState({
plusCheckoutTabId: tabId,