PageSourceSearch

https://www.bonusfinder.com/wp-content/cache/min/1/wp-content/them…/js/share_offer.js?ver=1790070200

js bonusfinder.com collected 2026-09-25 18:46:38 UTC 2,734 bytes, 13 lines download raw bytes

1class ShareOffer{static TOAST_DURATION_MS=3000;constructor(){this.toast=null;this.toastTimeout=null;this.createToast();this.bindShareButtons()}
2createToast(){this.toast=document.createElement('div');this.toast.className='share-offer-toast';this.toast.setAttribute('role','status');this.toast.setAttribute('aria-live','polite');document.body.appendChild(this.toast)}
3showToast(message){if(this.toastTimeout){clearTimeout(this.toastTimeout)}
4this.toast.textContent=message;this.toast.classList.add('share-offer-toast--visible');this.toastTimeout=setTimeout(()=>{this.toast.classList.remove('share-offer-toast--visible')},ShareOffer.TOAST_DURATION_MS)}
5bindShareButtons(){document.addEventListener('click',(e)=>{const btn=e.target.closest('.share-offer-btn');if(!btn){return}
6e.preventDefault();e.stopPropagation();const shareUrl=btn.dataset.shareUrl||'';const shareTitle=btn.dataset.shareTitle||'';const shareText=btn.dataset.shareText||'';if(navigator.share){navigator.share({title:shareTitle,text:shareText,url:shareUrl,}).then(()=>{this.pushTrackingEvent(btn,'native')}).catch((err)=>{if(err.name!=='AbortError'){this.fallbackCopyToClipboard(btn,shareUrl)}})}else{this.fallbackCopyToClipboard(btn,shareUrl)}})}
7fallbackCopyToClipboard(btn,url){this.copyToClipboard(url).then(()=>{this.showToast(btn.dataset.toastCopied||'Link copied!');this.pushTrackingEvent(btn,'copy_link')})}
8copyToClipboard(text){if(navigator.clipboard&&window.isSecureContext){return navigator.clipboard.writeText(text).catch(()=>{return this.fallbackCopy(text)})}
9return this.fallbackCopy(text)}
10fallbackCopy(text){const textArea=document.createElement('textarea');textArea.value=text;textArea.style.cssText='position:fixed;top:0;left:0;width:1px;height:1px;padding:0;border:none;outline:none;box-shadow:none;background:transparent';document.body.appendChild(textArea);textArea.focus();textArea.select();try{document.execCommand('copy')}catch(err){}
11document.body.removeChild(textArea);return Promise.resolve()}
12pushTrackingEvent(btn,method){const operatorItem=btn.closest('.operator-item');const operatorList=btn.closest('.operator-list');const data={event:'share_offer',exit_operator:operatorItem?operatorItem.getAttribute('data-operator')||'':'',exit_product:operatorItem?operatorItem.getAttribute('data-product')||'':'',list_type:operatorList?operatorList.getAttribute('data-listtype')||'':'',list_id:operatorList?operatorList.getAttribute('data-listid')||'':'',single_cta:0,position:operatorItem?operatorItem.getAttribute('data-position')||'':'',method:method,};window.dataLayer=window.dataLayer||[];window.dataLayer.push(data)}}
13if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',()=>new ShareOffer())}else{new ShareOffer()}

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.