feat: add hotmail mail api account pool flow
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
(function activationUtilsModule(root, factory) {
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = factory();
|
||||
return;
|
||||
}
|
||||
|
||||
root.MultiPageActivationUtils = factory();
|
||||
})(typeof self !== 'undefined' ? self : globalThis, function createActivationUtils() {
|
||||
function normalizeTagName(tagName) {
|
||||
return String(tagName || '').trim().toLowerCase();
|
||||
}
|
||||
|
||||
function normalizeType(type) {
|
||||
return String(type || '').trim().toLowerCase();
|
||||
}
|
||||
|
||||
function normalizePathname(pathname) {
|
||||
return String(pathname || '').trim().toLowerCase();
|
||||
}
|
||||
|
||||
function getActivationStrategy(target = {}) {
|
||||
const tagName = normalizeTagName(target.tagName);
|
||||
const type = normalizeType(target.type);
|
||||
const pathname = normalizePathname(target.pathname);
|
||||
const hasForm = Boolean(target.hasForm);
|
||||
const isEmailVerificationRoute = /\/email-verification(?:[/?#]|$)/i.test(pathname);
|
||||
const isSubmitButton = hasForm
|
||||
&& (
|
||||
(tagName === 'button' && (!type || type === 'submit'))
|
||||
|| (tagName === 'input' && type === 'submit')
|
||||
);
|
||||
|
||||
if (isSubmitButton && isEmailVerificationRoute) {
|
||||
return { method: 'requestSubmit' };
|
||||
}
|
||||
|
||||
return { method: 'click' };
|
||||
}
|
||||
|
||||
function isRecoverableStep9AuthFailure(statusText) {
|
||||
return /认证失败:\s*/i.test(String(statusText || '').trim());
|
||||
}
|
||||
|
||||
return {
|
||||
getActivationStrategy,
|
||||
isRecoverableStep9AuthFailure,
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user