Skip to content

Instantly share code, notes, and snippets.

@drio
Created November 12, 2021 16:52
Show Gist options
  • Save drio/5bd9409b7c48a688ff26fa5a266fff86 to your computer and use it in GitHub Desktop.
Save drio/5bd9409b7c48a688ff26fa5a266fff86 to your computer and use it in GitHub Desktop.
slate chunk js
(function(){const o="hubspotutk";const t='[data-export="sys:field:hubspot_cookie"] > div > input';function n(o){const t=`; ${document.cookie}`;const n=t.split(`; ${o}=`);return n.length===2?n.pop().split(";").shift():"not_found"}const e=n(o);const c=document.querySelectorAll(t);console.log("Cookie value:",e);console.log("Hidden elem found:",c.length===1);if(c){c.value=e}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment