chrome-jig 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -93,7 +93,7 @@ All evaluation uses CDP `Runtime.evaluate` in the page's **main world** — the
|
|
|
93
93
|
- `cjig inject` fetches the script URL **server-side** (in the Node.js process), then evaluates the content via CDP. Bypasses both CSP and CORS.
|
|
94
94
|
- `cjig eval-file` reads a local file and evaluates its contents via CDP. Bypasses CSP.
|
|
95
95
|
|
|
96
|
-
Each CLI invocation is a **fresh process**.
|
|
96
|
+
Each CLI invocation is a **fresh process**. The remembered default tab does persist between invocations through session state: `cjig tab <selector>` sets the default tab for later CLI commands, while `--tab` stays a one-shot override. Use `cjig repl` for a fully persistent interactive session.
|
|
97
97
|
|
|
98
98
|
## CLI Commands
|
|
99
99
|
|
|
@@ -113,8 +113,8 @@ cjig connection-info --json # JSON output for scripts
|
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
115
|
cjig tabs # List open tabs (index + title + URL)
|
|
116
|
-
cjig tab "GitHub" # Select by title or URL fragment
|
|
117
|
-
cjig tab 2 # Select by index
|
|
116
|
+
cjig tab "GitHub" # Select + remember by title or URL fragment
|
|
117
|
+
cjig tab 2 # Select + remember by index
|
|
118
118
|
cjig open https://example.com # Open new tab
|
|
119
119
|
cjig open --timeout 60000 https://heavy-page.com # Custom timeout
|
|
120
120
|
cjig open --wait-until domcontentloaded https://example.com
|
package/SKILL.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chrome-jig
|
|
3
|
+
description: CSP-proof browser debugging and JavaScript evaluation in Chrome via CDP. Use when you need to launch/attach Chrome, list tabs, inject scripts, evaluate JS/CLJS, or bridge Chrome to Playwright.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Chrome Jig — Claude Skill
|
|
2
7
|
|
|
3
8
|
## What Chrome Jig Is
|
|
@@ -70,7 +75,7 @@ Prefer `cjig` CLI commands over Chrome DevTools MCP tools whenever possible:
|
|
|
70
75
|
| Command | Description |
|
|
71
76
|
|---|---|
|
|
72
77
|
| `cjig tabs` | List open tabs (index + title + URL) |
|
|
73
|
-
| `cjig tab <pattern\|index>` |
|
|
78
|
+
| `cjig tab <pattern\|index>` | Select and remember a default tab by title/URL pattern or index |
|
|
74
79
|
| `cjig open <url>` | Open a new tab |
|
|
75
80
|
| `cjig open --timeout <ms> <url>` | Open with custom navigation timeout |
|
|
76
81
|
| `cjig open --wait-until <strategy> <url>` | Wait strategy: `domcontentloaded\|load\|networkidle` |
|
|
@@ -207,7 +212,7 @@ With `--json`, errors are structured JSON on stderr: `{"error":"...","category":
|
|
|
207
212
|
## Limitations
|
|
208
213
|
|
|
209
214
|
- **Main world only**: All evaluation runs in the page's main world. No isolated world or extension service worker eval.
|
|
210
|
-
- **Fresh process per invocation**:
|
|
215
|
+
- **Fresh process per invocation**: The CLI still starts fresh each time, but `cjig tab <selector>` now remembers the default tab for later CLI commands. Use `--tab` for a one-shot override, or `cjig repl` for a fully persistent session.
|
|
211
216
|
- **Not a browser automation framework**: For scripted multi-page workflows, use Playwright directly.
|
|
212
217
|
- The REPL and nREPL share a single connection. Tab switches in the REPL (`.tab`) affect nREPL evaluations too.
|
|
213
218
|
|
|
@@ -217,5 +222,5 @@ With `--json`, errors are structured JSON on stderr: `{"error":"...","category":
|
|
|
217
222
|
- Do not suggest manual URL injection when a script is registered by name in the project config
|
|
218
223
|
- Do not forget to check `cjig status` before attempting to connect
|
|
219
224
|
- Do not skip reading `.cjig.json` — it tells you what harnesses exist and how to use them
|
|
220
|
-
- Do not
|
|
225
|
+
- Do not assume `--tab` changes the remembered default tab — use `cjig tab <selector>` when you want later CLI commands to follow the same tab
|
|
221
226
|
- Do not use cjig for scripted automation — use Playwright and connect it to cjig's Chrome via `connection-info`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-skill.d.ts","sourceRoot":"","sources":["../../src/commands/install-skill.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"install-skill.d.ts","sourceRoot":"","sources":["../../src/commands/install-skill.ts"],"names":[],"mappings":"AAAA;;GAEG;AAoDH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,YAAY,IAAI,aAAa,CAsD5C;AAED,wBAAgB,cAAc,IAAI,aAAa,CAuB9C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Install/uninstall as Claude skill
|
|
3
3
|
*/
|
|
4
|
-
import { existsSync, mkdirSync, symlinkSync, unlinkSync, readlinkSync } from 'node:fs';
|
|
4
|
+
import { existsSync, mkdirSync, symlinkSync, unlinkSync, readlinkSync, readFileSync } from 'node:fs';
|
|
5
5
|
import { dirname, join } from 'node:path';
|
|
6
6
|
import { homedir } from 'node:os';
|
|
7
7
|
const SKILL_NAME = 'chrome-jig';
|
|
@@ -15,10 +15,39 @@ function getPackageRoot() {
|
|
|
15
15
|
// Go up from dist/commands to package root
|
|
16
16
|
return join(dirname(import.meta.url.replace('file://', '')), '..', '..');
|
|
17
17
|
}
|
|
18
|
+
function validateSkillFrontmatter(packageRoot) {
|
|
19
|
+
const skillFile = join(packageRoot, 'SKILL.md');
|
|
20
|
+
if (!existsSync(skillFile)) {
|
|
21
|
+
return {
|
|
22
|
+
success: false,
|
|
23
|
+
message: `Missing SKILL.md at ${skillFile}`,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const content = readFileSync(skillFile, 'utf8');
|
|
27
|
+
const frontmatterMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n/);
|
|
28
|
+
if (!frontmatterMatch) {
|
|
29
|
+
return {
|
|
30
|
+
success: false,
|
|
31
|
+
message: 'SKILL.md is missing YAML front-matter (name and description)',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const frontmatter = frontmatterMatch[1];
|
|
35
|
+
if (!/^name:\s*.+$/m.test(frontmatter) || !/^description:\s*.+$/m.test(frontmatter)) {
|
|
36
|
+
return {
|
|
37
|
+
success: false,
|
|
38
|
+
message: 'SKILL.md front-matter must include both "name" and "description" fields',
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
18
43
|
export function installSkill() {
|
|
19
44
|
const skillsDir = getSkillsDir();
|
|
20
45
|
const skillPath = getSkillPath();
|
|
21
46
|
const packageRoot = getPackageRoot();
|
|
47
|
+
const frontmatterError = validateSkillFrontmatter(packageRoot);
|
|
48
|
+
if (frontmatterError) {
|
|
49
|
+
return frontmatterError;
|
|
50
|
+
}
|
|
22
51
|
// Create skills directory if needed
|
|
23
52
|
if (!existsSync(skillsDir)) {
|
|
24
53
|
mkdirSync(skillsDir, { recursive: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-skill.js","sourceRoot":"","sources":["../../src/commands/install-skill.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"install-skill.js","sourceRoot":"","sources":["../../src/commands/install-skill.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,UAAU,GAAG,YAAY,CAAC;AAEhC,SAAS,YAAY;IACnB,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,CAA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,MAAM,CAAC,GAAG,CAAC,EAAE;SACzF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IAEjC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,qBAAqB;SAC/B,CAAC;IACJ,CAAC;IAED,IAAI,CAAC;QACH,UAAU,CAAC,SAAS,CAAC,CAAC;QACtB,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,mBAAmB;YAC5B,IAAI,EAAE,SAAS;SAChB,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,6BAA6B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;SACzF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-jig",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Chrome debugging REPL with CDP, script injection, and Claude skill support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
"bin": {
|
|
9
9
|
"cjig": "./bin/cjig.js"
|
|
10
10
|
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"dev": "tsx src/cli.ts",
|
|
14
|
+
"typecheck": "tsc --noEmit",
|
|
15
|
+
"test": "vitest run",
|
|
16
|
+
"test:watch": "vitest",
|
|
17
|
+
"lint": "eslint src --ext .ts",
|
|
18
|
+
"serve:examples": "pnpm exec serve examples -p 3333 -C"
|
|
19
|
+
},
|
|
11
20
|
"keywords": [
|
|
12
21
|
"chrome",
|
|
13
22
|
"devtools",
|
|
@@ -22,14 +31,15 @@
|
|
|
22
31
|
"bencode": "^4.0.0",
|
|
23
32
|
"chokidar": "^5.0.0",
|
|
24
33
|
"playwright-core": "^1.58.2",
|
|
25
|
-
"squint-cljs": "^0.10.
|
|
34
|
+
"squint-cljs": "^0.10.186"
|
|
26
35
|
},
|
|
27
36
|
"devDependencies": {
|
|
28
|
-
"@types/node": "^25.
|
|
37
|
+
"@types/node": "^25.5.0",
|
|
29
38
|
"tsx": "^4.21.0",
|
|
30
39
|
"typescript": "^5.9.3",
|
|
31
|
-
"vitest": "^4.0
|
|
40
|
+
"vitest": "^4.1.0"
|
|
32
41
|
},
|
|
42
|
+
"packageManager": "pnpm@10.28.2",
|
|
33
43
|
"engines": {
|
|
34
44
|
"node": ">=18.0.0"
|
|
35
45
|
},
|
|
@@ -39,14 +49,5 @@
|
|
|
39
49
|
"editor",
|
|
40
50
|
"SKILL.md",
|
|
41
51
|
"README.md"
|
|
42
|
-
]
|
|
43
|
-
|
|
44
|
-
"build": "tsc",
|
|
45
|
-
"dev": "tsx src/cli.ts",
|
|
46
|
-
"typecheck": "tsc --noEmit",
|
|
47
|
-
"test": "vitest run",
|
|
48
|
-
"test:watch": "vitest",
|
|
49
|
-
"lint": "eslint src --ext .ts",
|
|
50
|
-
"serve:examples": "pnpm exec serve examples -p 3333 -C"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
52
|
+
]
|
|
53
|
+
}
|