1document.addEventListener('DOMContentLoaded', function() { 2 document.body.addEventListener('click', function(e) { 3 // Traverse up to find the closest anchor element. 4 var target = e.target; 5 while (target && target.tagName !== 'A') { 6 target = target.parentElement; 7 } 8 if (target && target.tagName === 'A') { 9 var href = target.getAttribute('href'); 10 // Check if the URL is an OnlyFans link. 11 if (href && (href.indexOf('https://onlyfans.com/') !== -1 || href.indexOf('http://onlyfans.com/') !== -1)) { 12 // Prevent default navigation and stop propagation. 13 e.preventDefault(); 14 e.stopImmediatePropagation(); 15 console.log("DamnWoo: OnlyFans link clicked. Opening in new tab: " + href); 16 17 // Open the link in a new tab. 18 window.open(href, '_blank'); 19 20 // Capture the anchor text. 21 var anchorText = target.innerText || target.textContent; 22 23 // Record click via AJAX. 24 var pageUrl = window.location.href; 25 var xhr = new XMLHttpRequest(); 26 xhr.open('POST', dw_ofga_ajax.ajax_url, true); 27 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 28 xhr.onreadystatechange = function() { 29 if (xhr.readyState === 4) { 30 if (xhr.status === 200) { 31 console.log("DamnWoo: Click recorded successfully."); 32 // Trigger the conversion event. 33 dw_ofga_gtag_report_conversion(); 34 } else { 35 console.error("DamnWoo: AJAX request failed with status: " + xhr.status); 36 } 37 } 38 }; 39 // Append the anchor text to the POST data. 40 xhr.send('action=dw_ofga_record_click&page_url=' + encodeURIComponent(pageUrl) + '&anchor_text=' + encodeURIComponent(anchorText)); 41 return false; 42 } 43 } 44 }, true); // Use capturing phase to intercept the click early. 45});
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.