Skip to content

The design language that makes your AI harness better at design.

JavaScript
1.6 KB
Raw Blame
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Consent hiding: a late banner that closes itself with !important</title>
  <style>
    /* late-closed-banner.html, except the manager closes its dialog by
       rewriting its root's style attribute to display: none !important,
       the same declaration the first hide pass stamped on it. The late wall
       check leaves that closed root closed, and the page is scanned.
       Pinned by crates/browser/tests/consent_hiding.rs. */
    body { font: 16px/1.5 system-ui, sans-serif; margin: 0; min-height: 3000px; background: #f3f4f6; }
  </style>
</head>
<body>
  <div id="usercentrics-root" style="display: block !important"></div>
  <script>
    const root = document.getElementById('usercentrics-root');
    window.addEventListener('scroll', () => {
      if (!root.shadowRoot) {
        root.attachShadow({ mode: 'open' }).innerHTML =
          '<style>.box { position: fixed; top: 80px; left: 50%; width: 640px; margin-left: -320px; padding: 32px; background: #fff; }</style>'
          + '<div class="box" role="dialog" aria-label="Privacy settings"><h2>Privacy settings</h2>'
          + '<p>We use cookies and similar technologies to provide this website, to measure how it is used and to show you personalised content and advertising. You can accept all of these purposes, reject them, or choose which ones you allow in the settings.</p></div>';
      } else if (window.scrollY > 600) {
        root.setAttribute('style', 'display:none!important');
      }
    }, { passive: true });
  </script>
</body>
</html>