The flow
When you run./easybrawto run script.auto, this is what happens:
Parse the script
easybrawto reads your
.auto file line by line. It resolves language aliases (so .navegar becomes .navigate), extracts browser configuration, and builds a map of functions and commands.Launch the browser
Chrome (or Brave/Edge) is started with the
--remote-debugging-port=9222 flag and pointed at your chosen profile directory. This enables the CDP endpoint.Connect via WebSocket
easybrawto connects to
http://localhost:9222/json, finds the first real page target (ignoring background processes and extensions), and opens a WebSocket connection to it.Enable the Page domain
Page.enable is sent to activate CDP events like navigation and load detection.Execute commands in sequence
Each command is translated into CDP calls or JavaScript via
Runtime.evaluate. Commands wait for a response before the next one runs — there’s no async race condition.Why CDP instead of WebDriver
WebDriver (used by Selenium and Playwright) sits between your code and the browser. It adds a detectable layer — many sites check for WebDriver’s presence innavigator.webdriver and block automated sessions.
CDP is the browser’s own internal protocol. It’s what Chrome’s DevTools uses when you open the inspector. There’s no extra process, no injected scripts that persist, and no navigator.webdriver = true.
easybrawto doesn’t disable automation flags or spoof user agents. It just doesn’t add the signals that most anti-bot systems look for. Using a real persistent profile with real cookies and session history makes it even harder to distinguish from a human session.
How elements are found
easybrawto never relies on a single selector strategy. Every command that interacts with an element runs a cascade:For .clickButton('target')
For .insertText('selector', 'value')
name and aria-label are the most reliable selectors — they’re semantic attributes that developers rarely remove, and they survive CSS framework rebuilds.
How text is inserted
Modern JavaScript frameworks (React, Vue, Angular) don’t listen to.value = assignments directly — they listen to synthetic events. easybrawto handles this by:
- Scrolling the element into view
- Focusing the element
- Setting the value via the native prototype setter (not direct assignment)
- Dispatching
inputandchangeevents withbubbles: true
insertText compatible with controlled inputs in any JS framework without any special configuration.
Profile system
| Type | Command | Behavior |
|---|---|---|
| Persistent | chrome.persistProfile('name') | Saved to ~/.easybrawto/profiles/name/. Survives between runs. |
| System | chrome.profile('/path', 'Profile 3') | Uses an existing browser profile. CDP must be allowed. |
| Temporary | chrome.tempProfile() or nothing | Created in /tmp/easybrawto_*. Deleted after the run. |
