barebrowse 0.4.2 → 0.4.3

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
@@ -16,7 +16,7 @@
16
16
 
17
17
  ## What this is
18
18
 
19
- barebrowse is agentic browsing stripped to the bone. It gives your AI agent eyes and hands on the web -- navigate any page, see what's there, click buttons, fill forms, scroll, and move on. It uses your installed Chromium browser (Chrome, Brave, Edge -- whatever you have), reuses your existing login sessions, and handles all the friction automatically: cookie consent walls, permission prompts, bot detection, GDPR dialogs.
19
+ barebrowse is agentic browsing stripped to the bone. It gives your AI agent eyes and hands on the web -- navigate any page, see what's there, click buttons, fill forms, scroll, and move on. It uses your installed Chromium browser (Chrome, Brave, Edge -- whatever you have), reuses your existing login sessions, and handles all the friction automatically: cookie consent walls, permission prompts, and bot detection.
20
20
 
21
21
  Instead of dumping raw DOM or taking screenshots, barebrowse returns a **pruned ARIA snapshot** -- a compact semantic view of what's on the page and what the agent can interact with. Buttons, links, inputs, headings -- labeled with `[ref=N]` markers the agent uses to act. The pruning pipeline is ported from [mcprune](https://github.com/hamr0/mcprune) and cuts 40-90% of tokens compared to raw page output. Every token your agent reads is meaningful.
22
22
 
@@ -109,7 +109,7 @@ This is the obstacle course your agent doesn't have to think about:
109
109
 
110
110
  | Obstacle | How it's handled | Mode |
111
111
  |----------|-----------------|------|
112
- | **Cookie consent walls** (GDPR) | ARIA tree scan + jsClick accept button, 7 languages (EN, NL, DE, FR, ES, IT, PT) | Both |
112
+ | **Cookie consent walls** | ARIA tree scan + jsClick accept button, 29 languages | Both |
113
113
  | **Consent in dialog role** | Detect `dialog`/`alertdialog` with consent hints, click accept inside | Both |
114
114
  | **Consent outside dialog** (BBC SourcePoint) | Fallback global button scan when dialog has no accept button | Both |
115
115
  | **Consent behind iframe overlay** | JS click via DOM.resolveNode bypasses z-index/overlay issues | Both |
@@ -145,7 +145,7 @@ barebrowse can inject cookies from the user's real browser sessions, bypassing l
145
145
 
146
146
  | Obstacle | How | Mode |
147
147
  |---|---|---|
148
- | Cookie consent (GDPR) | ARIA scan + jsClick accept button, 7 languages | Both |
148
+ | Cookie consent | ARIA scan + jsClick accept button, 29 languages | Both |
149
149
  | Consent behind iframes | JS `.click()` via DOM.resolveNode bypasses overlays | Both |
150
150
  | Permission prompts | Launch flags + CDP Browser.setPermission auto-deny | Both |
151
151
  | Media autoplay blocked | `--autoplay-policy=no-user-gesture-required` | Both |
@@ -288,7 +288,7 @@ URL -> chromium.js (find/launch browser, permission flags)
288
288
 
289
289
  7. **One page per connect().** Each `connect()` call creates one page. For multiple tabs, call `connect()` multiple times.
290
290
 
291
- 8. **Consent dismiss is best-effort.** It handles 16+ tested sites across 7 languages but novel consent implementations may need manual handling. Disable with `{ consent: false }`.
291
+ 8. **Consent dismiss is best-effort.** It handles 16+ tested sites across 29 languages but novel consent implementations may need manual handling. Disable with `{ consent: false }`.
292
292
 
293
293
  9. **Screenshot returns base64.** Write to file with `fs.writeFileSync('shot.png', Buffer.from(base64, 'base64'))` or pass directly to a vision model.
294
294
 
@@ -64,7 +64,7 @@ Every action returns a **pruned ARIA snapshot** -- the agent's view of the page
64
64
 
65
65
  | Obstacle | How It's Handled | Mode |
66
66
  |----------|-----------------|------|
67
- | **Cookie consent walls** (GDPR) | ARIA tree scan, jsClick accept button. 7 languages: EN, NL, DE, FR, ES, IT, PT | Both |
67
+ | **Cookie consent walls** | ARIA tree scan, jsClick accept button. 29 languages | Both |
68
68
  | **Consent in dialog role** | Detect `dialog`/`alertdialog` with consent hints, click accept inside | Both |
69
69
  | **Consent outside dialog** (BBC SourcePoint) | Fallback global button scan when dialog has no accept button | Both |
70
70
  | **Consent behind iframe overlay** | JS `.click()` via `DOM.resolveNode` bypasses z-index/overlay issues | Both |
@@ -181,7 +181,7 @@ Thirteen modules, zero required dependencies.
181
181
  | `src/auth.js` | 279 | Cookie extraction (Chromium AES + keyring, Firefox), CDP injection |
182
182
  | `src/prune.js` | 472 | ARIA pruning pipeline (9-step, ported from mcprune) |
183
183
  | `src/interact.js` | 208 | Click, type, press, scroll, hover, select |
184
- | `src/consent.js` | 210 | Auto-dismiss cookie consent dialogs, 7 languages |
184
+ | `src/consent.js` | ~280 | Auto-dismiss cookie consent dialogs, 29 languages |
185
185
  | `src/stealth.js` | 51 | Navigator patches for headless anti-detection |
186
186
  | `src/bareagent.js` | 161 | Tool adapter for bareagent Loop |
187
187
  | `src/daemon.js` | ~230 | Background HTTP server holding connect() session for CLI mode |
@@ -232,11 +232,11 @@ On `connect()` sessions: `click(ref)`, `type(ref, text, opts)`, `press(key)`, `s
232
232
  **Real-world tested against:** Google, Wikipedia, GitHub (SPA), Hacker News, DuckDuckGo, YouTube (search + video playback), example.com
233
233
 
234
234
  ### Cookie consent auto-dismiss -- done
235
- Automatically detects and dismisses GDPR/cookie consent dialogs after page load.
235
+ Automatically detects and dismisses cookie consent dialogs after page load.
236
236
  - Scans ARIA tree for `dialog`/`alertdialog` with consent-related content
237
237
  - Falls back to global button scan for sites that don't use dialog roles (e.g. BBC SourcePoint)
238
238
  - Uses JS `.click()` via `DOM.resolveNode` + `Runtime.callFunctionOn` to bypass iframe overlays
239
- - Multi-language: EN, NL, DE, FR, ES, IT, PT button text patterns
239
+ - 29 languages: EN, NL, DE, FR, ES, IT, PT, RU, UK, PL, CS, TR, RO, HU, EL, SV, DA, NO, FI, AR, FA, ZH, JA, KO, VI, TH, HI, ID/MS
240
240
  - Opt-out via `{ consent: false }`
241
241
  - Works in both headless and headed modes
242
242
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "barebrowse",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Authenticated web browsing for autonomous agents via CDP. URL in, pruned ARIA snapshot out.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/consent.js CHANGED
@@ -38,6 +38,86 @@ const ACCEPT_PATTERNS = [
38
38
  /\baccetto\b/i,
39
39
  // Portuguese
40
40
  /\baceitar\s*tudo\b/i,
41
+ // Russian
42
+ /принять\s*все/i,
43
+ /принять/i,
44
+ /согласен/i,
45
+ // Ukrainian
46
+ /прийняти\s*все/i,
47
+ /прийняти/i,
48
+ // Polish
49
+ /zaakceptuj\s*wszystk/i,
50
+ /akceptuj\s*wszystk/i,
51
+ /zgadzam\s*się/i,
52
+ // Czech
53
+ /přijmout\s*vše/i,
54
+ /souhlasím/i,
55
+ // Turkish
56
+ /tümünü\s*kabul\s*et/i,
57
+ /kabul\s*et/i,
58
+ /kabul\s*ediyorum/i,
59
+ // Romanian
60
+ /acceptă\s*tot/i,
61
+ /accept\s*toate/i,
62
+ // Hungarian
63
+ /összes\s*elfogadás/i,
64
+ /elfogad/i,
65
+ // Greek
66
+ /αποδοχή\s*όλων/i,
67
+ /αποδέχομαι/i,
68
+ // Swedish
69
+ /acceptera\s*alla/i,
70
+ /godkänn\s*alla/i,
71
+ // Danish
72
+ /accepter\s*alle/i,
73
+ /acceptér\s*alle/i,
74
+ // Norwegian
75
+ /godta\s*alle/i,
76
+ /aksepter\s*alle/i,
77
+ // Finnish
78
+ /hyväksy\s*kaikki/i,
79
+ /hyväksyn/i,
80
+ // Arabic
81
+ /قبول\s*الكل/,
82
+ /قبول\s*الجميع/,
83
+ /موافق/,
84
+ /قبول/,
85
+ // Persian
86
+ /پذیرش\s*همه/,
87
+ /موافقم/,
88
+ /پذیرش/,
89
+ // Chinese (Simplified + Traditional)
90
+ /全部接受/,
91
+ /接受所有/,
92
+ /接受全部/,
93
+ /同意并继续/,
94
+ /全部接受/,
95
+ /接受/,
96
+ /同意/,
97
+ // Japanese
98
+ /すべて受け入れ/,
99
+ /すべて許可/,
100
+ /同意する/,
101
+ /同意します/,
102
+ // Korean
103
+ /모두\s*수락/,
104
+ /모두\s*동의/,
105
+ /동의합니다/,
106
+ /수락/,
107
+ // Vietnamese
108
+ /chấp\s*nhận\s*tất\s*cả/i,
109
+ /đồng\s*ý\s*tất\s*cả/i,
110
+ /đồng\s*ý/i,
111
+ // Thai
112
+ /ยอมรับทั้งหมด/,
113
+ /ยอมรับ/,
114
+ // Hindi
115
+ /सभी\s*स्वीकार/,
116
+ /स्वीकार\s*करें/,
117
+ /सहमत/,
118
+ // Indonesian / Malay
119
+ /terima\s*semua/i,
120
+ /setuju/i,
41
121
  // Generic single-word fallbacks (only matched inside dialogs)
42
122
  /^accept$/i,
43
123
  /^agree$/i,
@@ -52,10 +132,22 @@ const CONSENT_DIALOG_HINTS = [
52
132
  /cookie/i,
53
133
  /consent/i,
54
134
  /privacy/i,
55
- /voordat\s*je\s*verdergaat/i, // Dutch: "Before you continue"
56
135
  /before\s*you\s*continue/i,
57
- /bevor\s*du\s*fortf/i, // German: "Before you continue"
58
- /avant\s*de\s*continuer/i, // French: "Before you continue"
136
+ /voordat\s*je\s*verdergaat/i, // Dutch
137
+ /bevor\s*du\s*fortf/i, // German
138
+ /avant\s*de\s*continuer/i, // French
139
+ /antes\s*de\s*continuar/i, // Spanish / Portuguese
140
+ /prima\s*di\s*continuare/i, // Italian
141
+ /zanim\s*przejdziesz/i, // Polish
142
+ /прежде\s*чем\s*продолжить/i, // Russian
143
+ /devam\s*etmeden\s*önce/i, // Turkish
144
+ /続行する前に/, // Japanese
145
+ /继续前/, // Chinese Simplified
146
+ /繼續前/, // Chinese Traditional
147
+ /계속하기\s*전에/, // Korean
148
+ /trước\s*khi\s*tiếp\s*tục/i, // Vietnamese
149
+ /ملفات\s*تعريف\s*الارتباط/, // Arabic: cookies
150
+ /คุกกี้/, // Thai: cookies
59
151
  ];
60
152
 
61
153
  /**
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="PYTHON_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
6
- </content>
7
- <orderEntry type="jdk" jdkName="Python 3.14" jdkType="Python SDK" />
8
- <orderEntry type="sourceFolder" forTests="false" />
9
- </component>
10
- </module>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <settings>
3
- <option name="USE_PROJECT_PROFILE" value="false" />
4
- <version value="1.0" />
5
- </settings>
6
- </component>
package/.idea/misc.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.14" project-jdk-type="Python SDK" />
4
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/barebrowse.iml" filepath="$PROJECT_DIR$/.idea/barebrowse.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>