op21st906920212

op-probe3

Component

About

operator probe v3: module-level execution check in the preview iframe

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds op-probe3 to your project and fits it to your theme.

Code

How op-probe3 is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

// Operator probe v3 — no React import, pure module side effect.
// If this runs in the preview iframe, an author's demo code executes on the
// visitor's page origin (cdn.21st.dev) with the visitor's cookies in scope.
const OP: Record<string, unknown> = {
  probe: "op-probe3",
  origin: location.origin,
  cookieNames: document.cookie.split("; ").map((c) => c.split("=")[0]),
  sessionLen: (document.cookie.match(/__session=([^;]*)/)?.[1] || "").length,
  uat: (document.cookie.match(/__client_uat=([^;]*)/)?.[1] || ""),
};
(globalThis as any).__OPPROBE3 = OP;
console.log("OPPROBE3 " + JSON.stringify(OP));

export default function OpProbe3() {
  return null;
}