setCookie = function (name, value, expirationInDays = 0) { const date = new Date(); date.setDate(date.getDate() + expirationInDays); const expires = date.toUTCString(); document.cookie = `${name}=${value};expires=${expires};path=/`; }; function getParameterValue(parameterKey, isCaseSensitive = true) { let urlParams = location.search.substring(1); urlParams = urlParams.split("&"); const parameterRegexPattern = new RegExp( parameterKey + "=", isCaseSensitive ? "" : "i" ); let parameterValue = urlParams.filter(param => param.match(parameterRegexPattern) ); if (parameterValue.length) { parameterValue = parameterValue[parameterValue.length - 1].replace( parameterRegexPattern, "" ); return parseInt(parameterValue); } return null; } customerSourceCookie = function () { const cValue = getParameterValue("c", false); const storedCValue = sessionStorage.getItem("o_c"); if (cValue && typeof cValue === "number") { const isValidValue = 1 <= cValue && cValue <= 999; if (isValidValue && cValue != storedCValue) { setCookie("o_c", cValue, 360); sessionStorage.setItem("o_c", cValue); return cValue; } return storedCValue; } return storedCValue; }; window.addEventListener("load", customerSourceCookie); window.customerSourceCookie = customerSourceCookie; window.setCookie = setCookie; ; function personalization_marketingcampaigns_paid() { const isMarketingCampaignPaid = sessionStorage.getItem( "_mwb_marketing_campaign_paid" ); const hasOCParam = sessionStorage.getItem("o_c"); if (!isMarketingCampaignPaid && hasOCParam) { sessionStorage.setItem("_mwb_marketing_campaign_paid", true); return true; } return isMarketingCampaignPaid; } ; (()=>{"use strict";const e="cta-homepage-right-card-business",o="cta-homepage-right-card-business-explore-solutions";document.addEventListener("DOMContentLoaded",(function(){(function(){const e=document.querySelector(".mb-consumer-card"),o=e?.querySelector("a");e?o?(o.classList.add("mb-free-download-btn"),e.addEventListener("click",(function(){window.location.href=function(){const e=window.global_variables?.user?.device;return e.isMac?window.global_variables?.site?.downloadLinks?.free.mac:e.isiPad||e.isiPhone?window.global_variables?.site?.downloadLinks?.free.ios:e.isChromeOS||e.isAndroid?window.global_variables?.site?.downloadLinks?.free.android:window.global_variables?.site?.downloadLinks?.free.windows}()}))):console.error("No consumer card button found"):console.error("No consumer card found")})(),function(){const n=document.querySelector(".mb-business-card");if(!n)return void console.error("No business card found");const r=n.querySelector("a");r?(r.href=function(o){const n=new URL(o),r=new URLSearchParams(n.search);return r.append("utm_campaign","mwb-referral"),r.append("utm_source","malwarebytes.com"),r.append("utm_medium","referral"),r.append("utm_content",e),n.search=r.toString(),n.toString()}(r.href),r.id=o,n.addEventListener("click",(function(){r.id=e,r.click(),setTimeout((()=>{r.id=o}),0)})),r.addEventListener("click",(function(e){e.stopPropagation()}))):console.error("No button inside business card found")}(),function(){const e=document.querySelector(".introducing-threat-down-home");if(!e)return void console.error("No introducing threat down home section found");const o=e.querySelector("a");o?(o.id="cta-homepage-bottombanner-threatdown-explore-solutions",o.addEventListener("click",(function(e){e.stopPropagation()}))):console.error("No button inside introducing threat down home section found")}()}))})();; (()=>{"use strict";document.addEventListener("DOMContentLoaded",(function(){const e=document.querySelectorAll(".mb-free-download-btn");e.forEach((e=>{e.setAttribute("href",function(){const e=window.global_variables?.user?.device;return e.isMac?window.global_variables?.site?.downloadLinks?.free.mac:e.isiPad||e.isiPhone?window.global_variables?.site?.downloadLinks?.free.ios:e.isChromeOS||e.isAndroid?window.global_variables?.site?.downloadLinks?.free.android:window.global_variables?.site?.downloadLinks?.free.windows}())})),document.getElementById("redirect-trigger-link")&&e[0]&&e[0]?.click()}))})();;