1function loginFormLogic() { 2 document.addEventListener('DOMContentLoaded', () => { 3 const container = document.getElementById('request-login-email'); 4 if (!container) return; 5 6 const emailProviders = { 7 "gmail.com": "https://mail.google.com", 8 "yahoo.com": "https://mail.yahoo.com", 9 "outlook.com": "https://outlook.live.com", 10 "hotmail.com": "https://outlook.live.com", 11 "icloud.com": "https://www.icloud.com/mail", 12 }; 13 14 container.querySelector('#email-form').addEventListener('submit', function (e) { 15 e.preventDefault(); 16 const email = this.email.value; 17 18 fetch('https://api.tempmaildetector.com/request-login-link', { 19 method: 'POST', 20 headers: {'Content-Type': 'application/json'}, 21 body: JSON.stringify({email}) 22 }) 23 .then(response => { 24 if (!response.ok) throw new Error('Network error'); 25 container.innerHTML = 'Check your email.'; 26 27 const domain = email.split('@')[1].toLowerCase(); 28 if (emailProviders[domain]) { 29 const link = document.createElement('a'); 30 link.href = emailProviders[domain]; 31 link.textContent = 'Go to your inbox'; 32 link.target = '_blank'; 33 container.appendChild(document.createElement('br')); 34 container.appendChild(link); 35 } 36 }) 37 .catch(() => { 38 container.innerHTML = 'Submission failed. Try again.'; 39 }); 40 }); 41 }); 42}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.