Skip to content

Commit cddb6f1

Browse files
AlexStrNikclaude
andcommitted
fix: DataCloneError with React Symbols and add argument passing
- Fixed DataCloneError by using JSON.stringify/parse for props sanitization - Added argument passing to claude-devtools-host (passes args to claude command) - Bumped version to 0.0.9 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 23bbc4c commit cddb6f1

File tree

4 files changed

+10
-19
lines changed

4 files changed

+10
-19
lines changed

chrome-devtools-extension/injected.js

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,12 @@
107107
const detector = new FrameworkDetector();
108108

109109
function sanitizeProps(props) {
110-
if (!props || typeof props !== "object") return props;
111-
112-
const sanitized = {};
113-
for (const [key, value] of Object.entries(props)) {
114-
if (typeof value === "function") {
115-
sanitized[key] = "[Function]";
116-
} else if (typeof value === "object" && value !== null) {
117-
if (value.constructor === Object || Array.isArray(value)) {
118-
sanitized[key] = sanitizeProps(value);
119-
} else {
120-
sanitized[key] = "[Object]";
121-
}
122-
} else {
123-
sanitized[key] = value;
124-
}
110+
if (!props) return null;
111+
try {
112+
return JSON.parse(JSON.stringify(props));
113+
} catch (error) {
114+
return null;
125115
}
126-
return sanitized;
127116
}
128117

129118
window.addEventListener("message", function (event) {

chrome-devtools-extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "Claude DevTools",
4-
"version": "0.0.8",
4+
"version": "0.0.9",
55
"description": "Pick elements and send them to Claude with React/Angular/Vue component detection",
66
"permissions": ["activeTab", "storage", "tabs", "debugger", "scripting"],
77
"host_permissions": ["<all_urls>"],

claude-devtools-host/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alexstrnik/claude-devtools",
3-
"version": "0.0.8",
3+
"version": "0.0.9",
44
"description": "Host server for Claude DevTools Chrome extension",
55
"main": "server.js",
66
"bin": {

claude-devtools-host/server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) {
1212
process.exit(0);
1313
}
1414

15+
const claudeArgs = process.argv.slice(2);
16+
1517
// Only import clipboard-image on macOS
1618
let writeClipboardImages = null;
1719
if (os.platform() === "darwin") {
@@ -35,7 +37,7 @@ function startClaudeProcess() {
3537
return claudePty;
3638
}
3739

38-
claudePty = pty.spawn("claude", [], {
40+
claudePty = pty.spawn("claude", claudeArgs, {
3941
name: "xterm-256color",
4042
cols: process.stdout.columns || 80,
4143
rows: process.stdout.rows || 30,

0 commit comments

Comments
 (0)