Skip to content

Commit 75c5ac1

Browse files
docs: add clipboard-patch manifest entry to platform guide
Platforms using navigator.clipboard.writeText (AI Studio, AWS, Stripe) need a third manifest.json entry with world: MAIN. Add step 2c with example and explanation of when to include it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent db1c3a6 commit 75c5ac1

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Thank you for your interest in contributing! This guide will help you get starte
2222

2323
DemoSafe's Chrome Extension detects and masks API keys on supported platforms. The API key ecosystem is vast — we can't cover every platform alone and welcome community contributions.
2424

25-
**Two files to edit, then build.** Here's the full walkthrough using a fictional "Acme API" as an example:
25+
**Two files to edit (three if clipboard interception is needed), then build.** Here's the full walkthrough using a fictional "Acme API" as an example:
2626

2727
### Step 1: Add pattern to `capture-patterns.ts`
2828

@@ -86,6 +86,21 @@ Edit [`packages/chrome-extension/manifest.json`](packages/chrome-extension/manif
8686
}
8787
```
8888

89+
**c) Clipboard-patch entry** (only if the platform copies keys via `navigator.clipboard.writeText` instead of DOM text):
90+
```json
91+
{
92+
"matches": [
93+
"https://aistudio.google.com/*",
94+
...
95+
"https://dashboard.acme.com/*"
96+
],
97+
"js": ["dist/content-scripts/clipboard-patch.js"],
98+
"run_at": "document_start",
99+
"world": "MAIN"
100+
}
101+
```
102+
This injects into the page context (not the isolated extension world) to intercept programmatic clipboard writes. Skip this if the platform shows keys as visible DOM text.
103+
89104
### Step 3: Build
90105

91106
```bash

0 commit comments

Comments
 (0)