Why CSS Blur Leaks Secrets in Product Demos (And How We Built Pixel-Baked Redaction + a 24 KB Offline Player in Chrome MV3)
If you have ever recorded an interactive product tour of a B2B SaaS app, you probably ran into this exact annoyance. Staging data looks empty, so you record against a realistic workspace - with real customer emails, revenue tables, and API keys on screen.
Most cloud demo tools offer a "blur" button to hide sensitive fields. That feels safe until you inspect how it actually works. In plenty of DOM-clone and hosted demo tools, "blur" is either:
- A CSS rule (
filter: blur(8px)orbackdrop-filter: blur(12px)) applied over the real text node in the cloned HTML, or - A floating overlay box drawn at playback time over an unredacted screenshot.
Open DevTools, toggle one CSS property - or inspect the page source and JSON payload - and the customer email or billing total is sitting right there in plaintext.
Even when a hosted platform flattens blur server-side, you still had to upload raw, unredacted screenshots of your admin panel to a third-party server first. For teams under SOC 2 or HIPAA audits, sending unredacted customer tables off-network just to blur them in a cloud editor is a non-starter. And on raster images, mild Gaussian blur is weak against fixed-font OCR recovery anyway.
When I built PackDemo (a local-first Chrome MV3 extension for interactive product demos), I wanted redaction to survive someone opening DevTools and View Source. I also wanted exports to be static files you own - not a 1 MB third-party iframe that breaks if you cancel a subscription.
Here is how the architecture works, the edge cases that nearly bit us, and where Chrome MV3 honestly falls short.
Pre-Capture DOM Isolation + Export-Time Pixel Baking
Reliable redaction needs two stages:
- Before capture, so sensitive text never enters local screenshots while you click through a live app.
- Before export, so boxes drawn in the editor permanently destroy the covered pixels in every output format (offline HTML, static ZIP, 1080p MP4/WebM, Markdown, and
.packdemo.json).
Stage A: Live pre-capture masking without mutating real FormData
In the content script (packages/extension/src/content/masking.ts), a MutationObserver coalesced via requestAnimationFrame keeps dynamic SPA screens masked without thrashing the main thread. Users can pick elements by CSS selector or toggle regex rules for emails, currency amounts, and API key prefixes (sk-, pk_live_, sk_live_, etc.).
One subtle trap hit us early when testing live text replacement on real web apps: never mutate text nodes inside live form controls. If you blindly swap text inside <select>, <option>, <input>, <textarea>, or [contenteditable] elements, you can corrupt the actual FormData submitted by the host app during a live recording session.
Our TreeWalker blocks replacement on live form elements:
const NON_VISUAL = 'script, style, noscript, title, template';
const LIVE_FIELDS = 'select, option, optgroup, textarea, input, [contenteditable], iframe';
const OPAQUE_MEDIA = 'canvas, img, video';
export function isReplaceProtected(element: Element): boolean {
return Boolean(element.closest(LIVE_FIELDS) || (element instanceof HTMLElement && element.isContentEditable));
}
For form fields, iframes, <canvas>, <img>, and <video>, we leave the DOM value untouched and render opaque #141624 boxes inside an isolated Shadow DOM overlay (all: initial, z-index: 2147483646) synced to getBoundingClientRect(), paired with blur(8px) opacity(0) on the underlying element. Real FormData stays intact, and raw values never reach chrome.tabs.captureVisibleTab.
Plugging metadata leaks (aria-label, query params, hidden fields)
Hiding pixels is not enough when your recorder also builds step titles like Click "Export Invoices". Normally, capture.ts reads aria-label, innerText, placeholder, or title from the clicked target. If a user masks a button containing a customer's name and clicks it, that text could leak straight into the step title or JSON metadata.
So the mask engine stamps data-packdemo-masked on every blurred or text-replaced element. On click capture:
function describeTarget(target: Element) {
const masked = target.closest('[data-packdemo-masked]') || target.querySelector('[data-packdemo-masked]');
const label = masked ? 'Masked element' : extractTargetLabel(target);
return { title: generateStepTitle(target, label), label, rect: target.getBoundingClientRect() };
}
We enforce the same hygiene across URLs and exported state:
- Captured and displayed URLs are stripped via
sanitizeDisplayUrl()tourl.origin + url.pathname, dropping query strings (tokens, emails),#hashfragments, anduser:pass@credentials. - Exported HTML defaults
showBrowserUrltofalse, omits rawpageTitleandelementLabelcompletely, and drops disabled CTA copy so draft internal links never hide in view-source.
Stage B: Permanent Canvas / OffscreenCanvas pixel baking
In Studio, users can add solid blackout, fake-text replacement, or mosaic rectangles on any step. Before export, prepareProjectForExport() runs bakeStepRedactions() sequentially step-by-step (keeping peak canvas RAM bounded).
Two graphics details matter here:
- Bake at native resolution before resizing. Downscaling to
maxWidth: 1920before erasing a box lets canvas resampling interpolate unmasked edge pixels across the mask boundary. We paint redactions onto a full-resolution OffscreenCanvas (or HTMLCanvasElement fallback) first, then downsample. - Zero source pixels kept under mosaic mode.
drawRedaction()first wipes the full rectangle with an opaque#111318fillRect (preventing rounded-corner bleed), then draws a deterministic synthetic tile grid (#22262e,#2b303a,#333844). Viewers see a clean redacted block while literally zero original pixel bits survive.
The canvas then encodes to WebP (quality: 0.86), overwrites step.imageDataUrl, and clears step.redactions = []. Our own 25.6-second, 4.34 MB 1080p 30fps MP4 launch demo was rendered locally through this same Canvas + MediaRecorder pipeline (packages/extension/src/lib/video.ts) with redactions baked before encoding.
Packing a Zero-Dependency Offline Player into <25 KB
Most hosted demo embeds pull 400 KB to 3+ MB of JS bundles, web fonts, and tracking scripts. We wanted a single HTML file you can drop in Slack, commit to docs, or open offline on an air-gapped laptop.
In packages/player/src/, the standalone player shell - HTML, inline CSS, SVG icons, and vanilla JS runtime - is roughly 24 KB (verified in tests at < 26,000 bytes for a full multi-step build). Zero frameworks, zero external requests.
Key pieces that kept it tiny:
- Normalized coordinates (
0..1) + ResizeObserver: Hotspots, highlight boxes, and zoom targets are stored as ratios. On resize,layout()fits the frame to the container and clamps CSStranslate3d(tx, ty, 0) scale(z)so zooming into a corner never exposes empty frame edges. A--inv: 1 / zCSS variable counter-scales the pulsing beacon so it stays crisp and tappable. - Collision-aware tooltips:
positionTip()scorestop,bottom,left, andright, clamping inside stage bounds and adding a+10000penalty if a placement covers the hotspot. Hotspot-free overview steps dock to the bottom-left on desktop and stack cleanly below the frame under640px. - Keyboard & touch navigation: ArrowRight / Space advance, ArrowLeft goes back, Home restarts, Escape closes fullscreen or the
<dialog>end card, and touch swipes work on mobile. - Self-enforced CSP inside the exported file: Every exported HTML demo locks itself down in
<head>:
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' data:; script-src 'unsafe-inline'; style-src 'unsafe-inline'; base-uri 'none'; form-action 'none'">
<meta name="referrer" content="no-referrer">
Step payloads live inside <script type="application/json" id="demo-data"> escaped via scriptJson() (<, >, &, \u2028, \u2029) to prevent </script> breakout, and custom CSS backgrounds are validated against a strict color/gradient grammar so imported .packdemo.json files cannot inject url(...) trackers.
To inspect the actual output without installing anything, check the three 5-step demos at packdemo.com/examples/ (29.8 KB to 34.0 KB total HTML each). Download one, turn off Wi-Fi, and open it locally.
Minimal MV3 Permissions & Air-Gapped Free Micro-Tools
Asking developers to install a Chrome extension that demands <all_urls> on install is a fair dealbreaker. In manifest.json (v0.2.2, 183 KB zip), PackDemo requests only:
permissions:activeTab,scripting,storage,downloadshost_permissions:https://api.packdemo.com/*(strictly for optional paid license activation/validation and voluntary feedback - never recordings)optional_host_permissions:https://*/*,http://localhost/*,http://127.0.0.1/*
On install, PackDemo has zero standing access to any website. When you start multi-page recording on https://app.example.com, it requests chrome.permissions.request({ origins: ['https://app.example.com/*'] }) for that single origin only, using a 2-minute chrome.permissions.onAdded handoff so the recording still starts cleanly after Chrome's permission prompt closes the popup.
Even our main landing page uses a 584-byte (414 B gzipped) cookie-free event script (t.js) with credentials: 'omit', referrerPolicy: 'no-referrer', and no raw IP storage.
For developers who only need a quick one-off utility - or want to verify zero uploads in DevTools - we built four standalone free tools on packdemo.com with CSP: connect-src 'none' enforced in <head> and no t.js loaded at all:
- Offline Screenshot Redactor - solid blackout or coarse mosaic on PNG/JPEG/WebP, exported as flattened PNG with EXIF stripped.
- Offline Browser Mockup & Step-Callout Studio - macOS browser frames, numbered callouts, blackout boxes, 2x PNG/WebP export.
- Offline Step-by-Step Guide Builder - turn screenshots and click coordinates into a self-contained HTML or Markdown SOP guide locally.
- Demo SaaS 3-Year ROI Calculator - compare 8 hosted demo subscriptions against a one-time license locally.
Honest Boundaries
Two things PackDemo deliberately does not do:
- No native desktop recording. As a Chrome MV3 extension using captureVisibleTab, PackDemo only records browser-based web/SaaS apps. It cannot record VS Code desktop, Xcode, native OS menus, or local terminals. For desktop software or talking-head walkthroughs, OBS or Screen Studio is still the right tool.
- No cloud CRM tracking. Because exported HTML demos run under
default-src 'none'and never phone home, PackDemo cannot tell sales reps which prospect paused on Step 4 or sync sessions to HubSpot. If you need lead-gated buyer telemetry, use a hosted platform.
PackDemo is for teams that want permanently redacted, self-hosted product tours as plain files they own. If you spot an edge case in our pixel baking, MV3 permission handoff, or player CSP, I would love to hear it in the comments.
Comments
No comments yet. Start the discussion.