borlabs

No Cookie Box for bots, crawlers and lighthouse.

May 11th, 2021 (edited)
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!--
  2. Borlabs Cookie > Settings > Disable option 'Cookies for Bots/Crawlers'.
  3. Place this code into 'Fallback' under Borlabs Cookie > Cookies > Borlabs Cookie  
  4. -->
  5. <script>
  6. if (/bot|googlebot|crawler|spider|robot|crawling|lighthouse/i.test(navigator.userAgent.toLowerCase()) === true) {
  7.  let css = '#BorlabsCookieBox { display: none !important; }';
  8.  let head = document.head || document.getElementsByTagName('head')[0];
  9.  let style = document.createElement('style');
  10.  head.appendChild(style);
  11.  style.type = 'text/css';
  12.  style.appendChild(document.createTextNode(css));
  13. }
  14. </script>
Add Comment
Please, Sign In to add comment