(function () { // Check if accountKey is set if (!window.dmcaAccountKey) { console.error('DMCA Widget Error: accountKey is not set'); return; } if (!document.getElementById("dmcaplus")) { var dmcaLink = document.createElement("a"); dmcaLink.href = "#"; dmcaLink.innerText = "DMCA+"; dmcaLink.id = "dmcaplus"; dmcaLink.style.position = "fixed"; dmcaLink.style.fontWeight = "bold"; dmcaLink.style.bottom = "10px"; dmcaLink.style.right = "10px"; dmcaLink.style.background = "#1a1d21"; dmcaLink.style.color = "rgb(10, 179, 156)"; dmcaLink.style.padding = "10px 15px"; dmcaLink.style.borderRadius = "5px"; dmcaLink.style.textDecoration = "none"; dmcaLink.style.fontSize = "14px"; dmcaLink.style.zIndex = "9999"; document.body.appendChild(dmcaLink); } // Modal HTML var modalHtml = `
dmcaplus.com DMCA Management Takedown Request

I have a good faith belief that the use of the material in the manner complained of is not authorized by the copyright owner, its agent, or the law.

`; // Append elements to the page document.body.insertAdjacentHTML("beforeend", modalHtml); document.getElementById("dmcaplus").addEventListener("click", function (event) { event.preventDefault(); document.getElementById("dmcaModal").style.display = "block"; }); document.getElementById("closeDmca").addEventListener("click", function () { document.getElementById("dmcaModal").style.display = "none"; }); document.getElementById("dmcaForm").addEventListener("submit", function (event) { event.preventDefault(); const formData = new FormData(event.target); const notification = {}; // Convert FormData to nested object structure formData.forEach((value, key) => { notification[key] = value; }); // Add the account key to the notification data fetch('https://www.dmcaplus.com/notifications', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Account-Key': window.dmcaAccountKey // Also add it as a header }, body: JSON.stringify({ notification: notification }) }) .then(response => { if (response.ok) { alert("DMCA Complaint Submitted Successfully!"); document.getElementById("dmcaModal").style.display = "none"; event.target.reset(); } else { response.json().then(data => { alert(data.errors ? data.errors.join('\n') : "Error submitting DMCA complaint. Please try again."); }); } }) .catch(error => { console.error('Error:', error); alert("Error submitting DMCA complaint. Please try again."); }); }); })();