mirror of
https://github.com/remorses/playwriter.git
synced 2026-09-14 16:37:40 +08:00
6224a0f374
The ghost cursor painted its arrow with
`background-image: url("data:image/svg+xml;base64,…")`. Pages with a
strict `img-src` CSP refuse to load that URL, so on Hacker News every
navigation logged a CSP violation and the cursor rendered as an empty
box.
Changes:
- `setInnerSvg()` parses the markup with `DOMParser`, validates the root
is a real SVG element, imports it into the document, and appends it to
the cursor. No image URL is involved, so no `img-src` rule applies.
- The generated cursor module now exports raw SVG markup
(`pointer-macos-tahoe-svg.ts`) instead of a base64 data URL
(`pointer-macos-tahoe-data-url.ts`). `encode-screenstudio-cursor.ts`
writes the markup with `JSON.stringify`.
- `applyRuntimeVisualOptions()` clears previous children and resets
`background-image` on every style switch, so toggling between
`screenstudio`, `minimal`, and `dot` never stacks two arrows.
The always-on cursor test now asserts the injected element contains a
literal `<svg>` and no `data:image/svg` reference.
Session: ses_fe45ea8e3ffepbcZz6OQQ9sFSH