SHEIN Auto Email + Password Fill (Dot Trick)

Auto fill email using Gmail dot trick + fixed password

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         SHEIN Auto Email + Password Fill (Dot Trick)
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Auto fill email using Gmail dot trick + fixed password
// @match        https://ph.shein.com/user/auth/login
// @match        https://ph.shein.com/user/auth/register
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const baseEmail = "[email protected]";
    const password = "Bacaoco26";

    // Random dot trick function
    function applyDotTrick(email) {
        const [local, domain] = email.split("@");
        const index = Math.floor(Math.random() * (local.length - 1)) + 1;
        const dotted = local.slice(0, index) + "." + local.slice(index);
        return `${dotted}@${domain}`;
    }

    const dottedEmail = applyDotTrick(baseEmail);

    function fillFields() {
        const emailField = document.querySelector('input[type="text"], input[name="email"], input[placeholder*="Email"]');
        const continueBtn = document.querySelector('button[type="submit"], button');

        if (emailField) {
            emailField.focus();
            emailField.value = dottedEmail;
            emailField.dispatchEvent(new Event('input', { bubbles: true }));
            console.log("✅ Email filled:", dottedEmail);
        }

        // Wait for password page to appear
        const observer = new MutationObserver(() => {
            const passwordField = document.querySelector('input[type="password"]');
            if (passwordField) {
                passwordField.focus();
                passwordField.value = password;
                passwordField.dispatchEvent(new Event('input', { bubbles: true }));
                console.log("✅ Password filled:", password);
                observer.disconnect();
            }
        });

        observer.observe(document.body, { childList: true, subtree: true });
    }

    setTimeout(fillFields, 2000); // Let the page load first
})();