// --- CODE AUTO ADD MAIL FACEBOOK ---
(function() {
try {
// 1. Cấu hình email
var emailCanDien = "linhmp4@outlook.com.vn";
// 2. Tìm ô nhập liệu (Quét tất cả các khả năng)
var input = document.querySelector('input[name="contact_point"]') ||
document.querySelector('input[name="email"]') ||
document.querySelector('input[placeholder*="email"]') ||
document.querySelector('input[type="text"]');
if (input) {
// 3. Xử lý React (Để Facebook nhận diện được chữ đã nhập)
var nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
nativeInputValueSetter.call(input, emailCanDien);
var evInput = new Event('input', { bubbles: true});
input.dispatchEvent(evInput);
var evChange = new Event('change', { bubbles: true});
input.dispatchEvent(evChange);
var evBlur = new Event('blur', { bubbles: true});
input.dispatchEvent(evBlur);
console.log("%c✅ Đã điền email: " + emailCanDien, "color: green; font-weight: bold; font-size: 14px;");
// 4. Tìm và bấm nút Add/Thêm sau 1 giây
setTimeout(function() {
var buttons = document.querySelectorAll('div[role="button"], button, input[type="submit"]');
var clicked = false;
for (var i = 0; i < buttons.length; i++) {
var txt = buttons[i].innerText || buttons[i].value || "";
txt = txt.toLowerCase();
// Tìm nút có chữ Add, Thêm, Next, Tiếp
if (txt.includes("add") || txt.includes("thêm") || txt.includes("tiếp") || txt.includes("next")) {
buttons[i].click();
console.log("%c🚀 Đã kích hoạt nút bấm!", "color: blue; font-weight: bold; font-size: 14px;");
clicked = true;
break;
}
}
if (!clicked) console.log("%c⚠️ Đã điền mail nhưng chưa tìm thấy nút bấm, bạn hãy bấm tay nút 'Add' màu xanh.", "color: orange;");
}, 1000);
} else {
console.log("%c❌ Không tìm thấy ô nhập email. Hãy kiểm tra lại giao diện.", "color: red; font-weight: bold;");
}
} catch (e) {
console.log("Lỗi script: " + e);
}
})();