({ allowDisabled = false } = {})
| 174 | } |
| 175 | |
| 176 | function findResendVerificationCodeTrigger({ allowDisabled = false } = {}) { |
| 177 | const candidates = document.querySelectorAll( |
| 178 | 'button, a, [role="button"], [role="link"], input[type="button"], input[type="submit"]' |
| 179 | ); |
| 180 | |
| 181 | for (const el of candidates) { |
| 182 | if (!isVisibleElement(el)) continue; |
| 183 | if (!allowDisabled && !isActionEnabled(el)) continue; |
| 184 | |
| 185 | const text = getActionText(el); |
| 186 | if (text && RESEND_VERIFICATION_CODE_PATTERN.test(text)) { |
| 187 | return el; |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | return null; |
| 192 | } |
| 193 | |
| 194 | function isEmailVerificationPage() { |
| 195 | return /\/email-verification(?:[/?#]|$)/i.test(location.pathname || ''); |
no test coverage detected