PageSourceSearch

https://electric-hoists.net/wp-content/cache/autoptimize/js/autopt…_single_f8b77676f63dcda62739a0c0d2c1c281.js

js electric-hoists.net collected 2026-10-06 08:47:38 UTC 2,244 bytes, 10 lines download raw bytes

1document.addEventListener('DOMContentLoaded',function(){function isLocalStorageAvailable(){try{const testKey='__test__';localStorage.setItem(testKey,'1');localStorage.removeItem(testKey);return true;}catch(e){return false;}}
2function setCookie(name,value,days){const expires=new Date();expires.setDate(expires.getDate()+days);document.cookie=name+'='+encodeURIComponent(value)+'; expires='+expires.toUTCString()+'; path=/; SameSite=Lax';}
3function getCookie(name){const match=document.cookie.match(new RegExp('(^| )'+name+'=([^;]+)'));return match?decodeURIComponent(match[2]):null;}
4const hasLocalStorage=isLocalStorageAvailable();const consentBox=document.getElementById('cookieConsent');let consent=null;const now=Date.now();const sevenDays=365*24*60*60*1000;if(hasLocalStorage){try{const stored=JSON.parse(localStorage.getItem('cookieConsentData'));if(stored&&stored.value&&stored.expires){if(now<stored.expires){consent=stored.value;}else{localStorage.removeItem('cookieConsentData');}}}catch(e){localStorage.removeItem('cookieConsentData');}}else{consent=getCookie('cookieConsent');}
5if(!consent&&consentBox){consentBox.style.display='block';}
6function saveConsent(value){let methodUsed='unknown';if(hasLocalStorage){const expires=now+sevenDays;localStorage.setItem('cookieConsentData',JSON.stringify({value:value,expires:expires}));methodUsed='localStorage';}else{setCookie('cookieConsent',value,7);methodUsed='cookie';}
7const currentUrl=window.location.href;fetch(cookie_ajax_obj.ajax_url,{method:'POST',credentials:'same-origin',headers:{'Content-Type':'application/x-www-form-urlencoded',},body:new URLSearchParams({action:'save_cookie_consent',consent:value,currentUrl:currentUrl,storage_method:methodUsed}),});}
8const acceptBtn=document.getElementById('acceptCookies');const denyBtn=document.getElementById('denyCookies');const closeBtn=document.querySelector('.cookie-close');if(acceptBtn){acceptBtn.addEventListener('click',function(){saveConsent('accepted');consentBox.style.display='none';});}
9if(denyBtn){denyBtn.addEventListener('click',function(){saveConsent('strict');consentBox.style.display='none';});}
10if(closeBtn){closeBtn.addEventListener('click',function(){saveConsent('closed');consentBox.style.display='none';});}});

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.