@cli4ai/chrome 1.0.6 → 1.0.7

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.
Files changed (3) hide show
  1. package/cli4ai.json +57 -8
  2. package/package.json +1 -1
  3. package/run.ts +5 -1
package/cli4ai.json CHANGED
@@ -1,22 +1,71 @@
1
1
  {
2
2
  "name": "chrome",
3
- "version": "1.0.4",
3
+ "version": "1.0.7",
4
4
  "description": "Chrome browser automation (foundation for browser tools)",
5
5
  "author": "cliforai",
6
6
  "license": "MIT",
7
7
  "entry": "run.ts",
8
8
  "runtime": "bun",
9
- "keywords": ["chrome", "browser", "puppeteer", "automation"],
9
+ "keywords": [
10
+ "chrome",
11
+ "browser",
12
+ "puppeteer",
13
+ "automation"
14
+ ],
10
15
  "commands": {
11
- "connect": { "description": "Connect to Chrome", "args": [{ "name": "port", "description": "Default: 9222", "required": false }] },
12
- "navigate": { "description": "Open URL", "args": [{ "name": "url", "required": true }] },
13
- "eval": { "description": "Run JavaScript", "args": [{ "name": "script", "required": true }] },
14
- "screenshot": { "description": "Capture viewport", "args": [{ "name": "output", "required": false }] },
15
- "cookies": { "description": "Get cookies", "args": [{ "name": "domain", "required": false }] }
16
+ "connect": {
17
+ "description": "Connect to Chrome",
18
+ "args": [
19
+ {
20
+ "name": "port",
21
+ "description": "Default: 9222",
22
+ "required": false
23
+ }
24
+ ]
25
+ },
26
+ "navigate": {
27
+ "description": "Open URL",
28
+ "args": [
29
+ {
30
+ "name": "url",
31
+ "required": true
32
+ }
33
+ ]
34
+ },
35
+ "eval": {
36
+ "description": "Run JavaScript",
37
+ "args": [
38
+ {
39
+ "name": "script",
40
+ "required": true
41
+ }
42
+ ]
43
+ },
44
+ "screenshot": {
45
+ "description": "Capture viewport",
46
+ "args": [
47
+ {
48
+ "name": "output",
49
+ "required": false
50
+ }
51
+ ]
52
+ },
53
+ "cookies": {
54
+ "description": "Get cookies",
55
+ "args": [
56
+ {
57
+ "name": "domain",
58
+ "required": false
59
+ }
60
+ ]
61
+ }
16
62
  },
17
63
  "dependencies": {
18
64
  "puppeteer": "^24.0.0",
19
65
  "commander": "^14.0.0"
20
66
  },
21
- "mcp": { "enabled": true, "transport": "stdio" }
67
+ "mcp": {
68
+ "enabled": true,
69
+ "transport": "stdio"
70
+ }
22
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cli4ai/chrome",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Chrome browser automation (foundation for browser tools)",
5
5
  "author": "cliforai",
6
6
  "license": "MIT",
package/run.ts CHANGED
@@ -50,8 +50,12 @@ program
50
50
 
51
51
  program
52
52
  .command('eval <script>')
53
- .description('Run JavaScript')
53
+ .description('Run JavaScript (WARNING: executes arbitrary code in browser context)')
54
54
  .action(withErrorHandling(async (script: string) => {
55
+ // SECURITY WARNING: This command executes arbitrary JavaScript in the browser.
56
+ // Only use with trusted input. Malicious scripts can access cookies, localStorage,
57
+ // and perform actions as the logged-in user.
58
+ log('⚠️ WARNING: Executing arbitrary JavaScript in browser context');
55
59
  const { page, browser } = await getPage();
56
60
  const result = await page.evaluate((code: string) => eval(code), script);
57
61
  if (result !== undefined) output(result);