From 31046c1116fb52d2b0e25f0166aa24978f1f77fa Mon Sep 17 00:00:00 2001 From: QLHazyCoder <2825305047@qq.com> Date: Sat, 16 May 2026 05:06:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20contact-verification=20?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E9=AA=8C=E8=AF=81=E7=A0=81=E9=A1=B5=E8=AF=86?= =?UTF-8?q?=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/signup-page.js | 7 ++++++- tests/step6-login-state.test.js | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/content/signup-page.js b/content/signup-page.js index 4eb0d34..c0b5ae0 100644 --- a/content/signup-page.js +++ b/content/signup-page.js @@ -3083,7 +3083,12 @@ function isAddEmailPageReady() { function isPhoneVerificationPageReady() { const path = `${location.pathname || ''} ${location.href || ''}`; - if (/\/phone-verification(?:[/?#]|$)/i.test(path)) { + const isPhoneVerificationRoute = /\/phone-verification(?:[/?#]|$)/i.test(path); + const isContactVerificationRoute = /\/contact-verification(?:[/?#]|$)/i.test(path); + if (isContactVerificationRoute && getContactVerificationServerErrorText()) { + return false; + } + if (isPhoneVerificationRoute || isContactVerificationRoute) { return true; } diff --git a/tests/step6-login-state.test.js b/tests/step6-login-state.test.js index da4d27d..2ed170d 100644 --- a/tests/step6-login-state.test.js +++ b/tests/step6-login-state.test.js @@ -54,6 +54,7 @@ const bundle = [ extractFunction('getPageTextSnapshot'), extractFunction('getLoginVerificationDisplayedEmail'), extractFunction('getPhoneVerificationDisplayedPhone'), + extractFunction('getContactVerificationServerErrorText'), extractFunction('isPhoneVerificationPageReady'), extractFunction('inspectLoginAuthState'), extractFunction('normalizeStep6Snapshot'), @@ -61,12 +62,14 @@ const bundle = [ function createApi(overrides = {}) { return new Function(` +const CONTACT_VERIFICATION_SERVER_ERROR_PATTERN = /this\\s+page\\s+isn['\\u2019]?t\\s+working|currently\\s+unable\\s+to\\s+handle\\s+this\\s+request|http\\s+error\\s+500|500\\s+internal\\s+server\\s+error/i; const location = { href: ${JSON.stringify(overrides.href || 'https://auth.openai.com/log-in')}, pathname: ${JSON.stringify(overrides.pathname || '/log-in')}, }; const document = { + title: ${JSON.stringify(overrides.title || '')}, body: { innerText: ${JSON.stringify(overrides.pageText || '')}, textContent: ${JSON.stringify(overrides.pageText || '')}, @@ -208,6 +211,35 @@ return { assert.strictEqual(snapshot.state, 'phone_verification_page'); } +{ + const api = createApi({ + pathname: '/contact-verification', + href: 'https://auth.openai.com/contact-verification', + verificationTarget: { id: 'otp' }, + pageText: 'Check your phone. We just sent a code to +66 81 234 5678.', + }); + + assert.strictEqual(api.isPhoneVerificationPageReady(), true); + + const snapshot = api.inspectLoginAuthState(); + assert.strictEqual(snapshot.state, 'phone_verification_page'); +} + +{ + const api = createApi({ + pathname: '/contact-verification', + href: 'https://auth.openai.com/contact-verification', + title: "This page isn't working", + verificationTarget: { id: 'otp' }, + pageText: 'auth.openai.com is currently unable to handle this request. HTTP ERROR 500', + }); + + assert.strictEqual(api.isPhoneVerificationPageReady(), false); + + const snapshot = api.inspectLoginAuthState(); + assert.notStrictEqual(snapshot.state, 'phone_verification_page'); +} + { const api = createApi({ pathname: '/email-verification',