(step, code)
| 345 | } |
| 346 | |
| 347 | async function submitVerificationCode(step, code) { |
| 348 | const signupTabId = await getTabId('signup-page'); |
| 349 | if (!signupTabId) { |
| 350 | throw new Error('认证页面标签页已关闭,无法填写验证码。'); |
| 351 | } |
| 352 | |
| 353 | await chrome.tabs.update(signupTabId, { active: true }); |
| 354 | const result = await sendToContentScript('signup-page', { |
| 355 | type: 'FILL_CODE', |
| 356 | step, |
| 357 | source: 'background', |
| 358 | payload: { code }, |
| 359 | }); |
| 360 | |
| 361 | if (result && result.error) { |
| 362 | throw new Error(result.error); |
| 363 | } |
| 364 | |
| 365 | return result || {}; |
| 366 | } |
| 367 | |
| 368 | async function resolveVerificationStep(step, state, mail, options = {}) { |
| 369 | const stateKey = getVerificationCodeStateKey(step); |
no test coverage detected