🚫

Access Restricted

We're sorry, but Smokerolla is not available in your region (${country}).

We only ship within the United States and Puerto Rico.

If you believe this is an error, please contact us at support@smokerolla.com

`; // Stop all scripts window.stop(); } // ============================================ // MALICIOUS BOT DETECTION (Cart/Checkout) // ============================================ let humanActivity = { mouseMove: false, keyPress: false, scroll: false, touchStart: false, interactionTime: 0, startTime: Date.now() }; // Track human-like behavior document.addEventListener('mousemove', function() { humanActivity.mouseMove = true; humanActivity.interactionTime = Date.now() - humanActivity.startTime; }, { once: true, passive: true }); document.addEventListener('keydown', function() { humanActivity.keyPress = true; }, { once: true, passive: true }); document.addEventListener('scroll', function() { humanActivity.scroll = true; }, { once: true, passive: true }); document.addEventListener('touchstart', function() { humanActivity.touchStart = true; }, { once: true, passive: true }); // Honeypot field injection for forms function addHoneypot(form) { if (form.querySelector('.hp-field')) return; const honeypot = document.createElement('input'); honeypot.type = 'text'; honeypot.name = 'website_url_hp'; honeypot.className = 'hp-field'; honeypot.autocomplete = 'off'; honeypot.tabIndex = -1; honeypot.style.cssText = 'position:absolute;left:-9999px;top:-9999px;height:0;width:0;opacity:0;pointer-events:none;'; form.appendChild(honeypot); } // Check for bot behavior before allowing cart actions function isSuspiciousBot() { const timeSinceLoad = Date.now() - humanActivity.startTime; // Suspicious patterns: // 1. No mouse/touch activity at all // 2. Action taken in less than 2 seconds // 3. Suspicious user agent patterns const noHumanInteraction = !humanActivity.mouseMove && !humanActivity.touchStart && !humanActivity.scroll; const tooFast = timeSinceLoad < 2000; const suspiciousUA = [ 'headless', 'phantom', 'selenium', 'puppeteer', 'playwright', 'webdriver', 'httpclient', 'python-requests', 'curl/', 'wget/', 'go-http-client', 'java/', 'apache-httpclient', 'libwww-perl', ].some(pattern => userAgent.includes(pattern)); // Check for automation indicators const hasWebdriver = navigator.webdriver === true; const hasAutomation = window.document.documentElement.getAttribute('webdriver') !== null; return (noHumanInteraction && tooFast) || suspiciousUA || hasWebdriver || hasAutomation; } // Intercept Add to Cart function protectCartActions() { // Monitor fetch requests to cart const originalFetch = window.fetch; window.fetch = function(url, options) { const urlString = typeof url === 'string' ? url : url.url || ''; // Check if this is a cart action if (urlString.includes('/cart/add') || urlString.includes('/cart/update')) { if (isSuspiciousBot()) { console.warn('[Smokerolla] Suspicious bot activity blocked'); return Promise.reject(new Error('Request blocked')); } } return originalFetch.apply(this, arguments); }; // Monitor XHR requests const originalXHROpen = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function(method, url) { this._url = url; return originalXHROpen.apply(this, arguments); }; const originalXHRSend = XMLHttpRequest.prototype.send; XMLHttpRequest.prototype.send = function() { if (this._url && (this._url.includes('/cart/add') || this._url.includes('/cart/update'))) { if (isSuspiciousBot()) { console.warn('[Smokerolla] Suspicious bot activity blocked (XHR)'); return; } } return originalXHRSend.apply(this, arguments); }; // Protect forms document.addEventListener('submit', function(e) { const form = e.target; // Check honeypot const honeypot = form.querySelector('.hp-field'); if (honeypot && honeypot.value) { console.warn('[Smokerolla] Honeypot triggered - bot detected'); e.preventDefault(); return false; } // Check for cart/checkout forms if (form.action && (form.action.includes('/cart') || form.action.includes('/checkout'))) { if (isSuspiciousBot()) { console.warn('[Smokerolla] Suspicious bot blocked from checkout'); e.preventDefault(); return false; } } }, true); } // ============================================ // INITIALIZE // ============================================ // Run geo-check checkGeoBlock(); // Setup cart protection if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function() { protectCartActions(); // Add honeypots to all forms document.querySelectorAll('form').forEach(addHoneypot); }); } else { protectCartActions(); document.querySelectorAll('form').forEach(addHoneypot); } // Watch for dynamically added forms const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { mutation.addedNodes.forEach(function(node) { if (node.nodeName === 'FORM') { addHoneypot(node); } if (node.querySelectorAll) { node.querySelectorAll('form').forEach(addHoneypot); } }); }); }); observer.observe(document.body || document.documentElement, { childList: true, subtree: true }); })();
NEW LAUNCH: Lanza Dry Herb Vaporizer|RGB LED Technology + Ceramic Heating - Only $49.99!|Shop Now|Use code LANZALAUNCH for 15% off