feat(autocapture): capture paste interactions - #4635
Conversation
Prompt To Fix All With AI### Issue 1
packages/browser/src/autocapture.ts:515
**DOM allowlist rejects paste events**
When `capture_copied_text` is enabled alongside any `dom_event_allowlist`, `shouldCaptureDomEvent` rejects paste because the public allowlist supports only `click`, `change`, and `submit`, causing paste interactions to be silently omitted.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(autocapture): capture paste interac..." | Re-trigger Greptile |
| // we also don't want to restrict clipboard checks to clicks, | ||
| // so we pass that knowledge in here, rather than add the logic inside the check | ||
| isCopyAutocapture ? ['copy', 'cut'] : undefined, | ||
| isClipboardAutocapture ? ['copy', 'cut', 'paste'] : undefined, |
There was a problem hiding this comment.
DOM allowlist rejects paste events
When capture_copied_text is enabled alongside any dom_event_allowlist, shouldCaptureDomEvent rejects paste because the public allowlist supports only click, change, and submit, causing paste interactions to be silently omitted.
Knowledge Base Used: Browser event capture and autocapture
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/browser/src/autocapture.ts
Line: 515
Comment:
**DOM allowlist rejects paste events**
When `capture_copied_text` is enabled alongside any `dom_event_allowlist`, `shouldCaptureDomEvent` rejects paste because the public allowlist supports only `click`, `change`, and `submit`, causing paste interactions to be silently omitted.
**Knowledge Base Used:** [Browser event capture and autocapture](https://app.greptile.com/posthog-org-19734/-/custom-context/knowledge-base/posthog/posthog-js/-/docs/browser-event-capture.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
posthog-js Compliance ReportDate: 2026-08-25 11:20:12 UTC ✅ All Tests Passed!26/26 tests passed Capture Tests✅ 26/26 tests passed View Details
|
|
Size Change: +2.91 kB (+0.01%) Total Size: 20.1 MB 📦 View Changed
ℹ️ View Unchanged
|
Problem
Users can autocapture copy and cut interactions, but paste interactions are missing from the event stream.
Paste contents can contain secrets, so paste capture must not read clipboard data.
Changes
$copy_type: pasteand do not read clipboard contents.$selected_contentand$clipboard_text_lengthfor compatibility.dom_event_allowlistcontinues to control normal autocapture without disabling clipboard events.Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Codex desktop authored this human-directed change. It used the Simplified Technical English, writing-tests, and writing-pr-descriptions skills.
Input change events already describe content changes, so paste events record only the interaction.
Review feedback added compatibility with
dom_event_allowlist. Only paste omits clipboard text and length.