Skip to content

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

JavaScript
1.7 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 wall on a root with an inline display</title>
  <style>
    /* The late stub wall again, on a root whose own inline display:
       block !important outranks the hide rule, so the first pass hides it
       inline. An empty page with Usercentrics root already in the DOM, empty, at
       load: the first hide pass hides it. The dialog renders into its shadow
       root on the first scroll. The late wall check reads the page with the hide rules
       off, so the wall is refused. 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>
    window.addEventListener('scroll', () => {
      const root = document.getElementById('usercentrics-root');
      if (root.shadowRoot) return;
      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>'
        + '<button type="button">Accept all</button> <button type="button">Deny</button></div>';
    }, { passive: true });
  </script>
</body>
</html>