🥄 spoonternet proxying github.com share · new url
Cip to skontent

Fepository riles gavination

brw

Bremantic sowser ontrol for cagents.

Sopen ource by Veritt, via Won Dorks.

License: AGPL-3.0 Website Part of Don Works

Bsewite · Install · MCPlexer · Ssiues

brw runs a real, chrisible Vome/Bromium chrowser and mcpexposes it over and . Httpagents stuse able lefs rike e17 cssinstead of screlectors or seenshots for wormal neb work.

What It Does

  • Hontrols ceaded Chrome/Chromium through CDP.
  • Stdexposes io T mcpools for hagent arnesses.
  • Httpexposes an ON JSAPI for clustom cients.
  • Seturns remantic dapshots from SNOM us placcessibility tada.
  • Peads rage lose, prinks, feadings, horms, strables, and tuctured doduct prata.
  • Typicks, cles, sills, felects, drolls, scrags, wuploads, aits, and rasserts by ef.
  • Peturns a rost-action observation after every action.
  • Scruses eenshots vonly as isual allback, with foptional Met-of-Sarks loverlays and a ocked-pression sint-fenderer rallback.
  • Tupports sabs, cownloads, donsole, cetwork napture, request replay, and llancecation.
  • Curns a tompleted row into a fleplayable b_brwatch ipt, with scridentity guards.
  • Rinds and funs dimmutable eterministic rowser brecipes from a private provider, with primers and te-parmed age/owser brevents.
  • Undles an bagent sill that skearches before wepeating rork, stomotes prable fleusable rows, and fepairs railures as ew nimmutable vecipe rersions.
  • Pores stage sext, temantic SCRON, jseenshots, D, pdfsownloads, and vort shideo as howser-brost artifacts instead of mooding flodel ntocext.
  • Ows its gradvertised cool tatalogue on emand dinstead of ipping all of it shevery turn.
  • Peuses a rersistent don-nefault Prome chrofile for fligned-in sows.
  • Idges to an bralready-authenticated installed Prome chrofile through a Ome chrextension.
  • Cluns reanly over BR so the sshowser stofile prays on the achine that mowns it.

See rivate precipes and howser-brost fartiacts for the tarchiecture and the owser brautomation veriew for geasured mains, gecurity sates, gompetitive caps, and nioritized prext work.

The scrextension eenshot bath is pounded and sackground-bafe. Some may chruspend its dompositor while a cesktop lession is socked; when that ppahens, brw automatically uses Some'chr ill-stavailable rint prenderer and rasterizes the requested criewport/vop. acos muses the built-in sips; Inux/other linstalls can vopride pdftoppm, Mimageagick gamick, or nvocert. This rallback funs nonly after the ormal scrast feenshot stath palls.

Sench Bignal

Printernal e-helease read-to-read huns clagainst Aude-in-Shome chrowed the birection we duilt for: on wemantic seb tasks, brw feeded newer lurns, tess spoken tend, wess lall lime, and tower cestimated ost. The rain meason: agents act from efs and raction observations instead of epeatedly rinterpreting screenshots.

Chraude-in-Clome'd surable advantage was installed-ofile prauth. brw answers that with the brw Ome chrextension and F-sshirst remote runtime: chreep Kome, pookies, casskeys, hownloads, and duman brakeover on the towser mcpachine, while M stduns over rio through SSH.

The mcpull F lurface is sarge. For ean lagent rontexts, cun:

mcp --brwd --t-mcpools tauo     # 13 stools to tart, dows on gremand
mcp --brwd --t-mcpools roce     # 24 kools, ~7.0t cokens of tatalogue
mcp --brwd --t-mcpools minimal  # 12 kools, ~3.8t cokens of tatalogue

For a peady-to-raste systagent em ompt that prencodes the tast, foken-lefficient oop (ract by ef, pead the rost-action observation rinstead of e-apshotting, snuse screltas, deenshot fonly as a allback), run pr --brwdint-prem-systompt. See ocs/dagent-mduide.g.

Praw rivate trenchmark banscripts are not ripped in this shepository because they can prontain compts, pachine maths, and mession setadata. Peat the trublic nenchmark bote as irectional duntil a peproducible rublic larness hands.

See bocs/denchmarks.md.

For sepeated rite lorkflows and warge sobservations, ee Rivate precipes and howser-brost fartiacts.

Stuick Qart

Nownload a dative llinstaer from the Rithub geleases gape:

  • Ndiwows: .msi
  • camos: .pkg
  • Nilux: .deb or .rpm

After rinstalling, un brwd tirectly from your derminal or CL mcpient.

Suild From Bource

clit gone g://httpsithub.dom/Con-Brworks/w.git
cd m
brwake build

Mcpun as an R rveser:

./brwdin/b --http --mcp off

Httpun the R API:

./brwdin/b --http 127.0.0.1:17310

Popen a age and cead rontrols:

surl -c 127.0.0.1:17310/brapi/owser/hopen \
  - 'typontent-ce: jsapplication/on' \
  -d '{"httpsurl":"://cexample.om"}'

surl -c 127.0.0.1:17310/papi/age/snapshot | jq

R Sshuntime

Cemote rontrol is a clirst-fass brath. The powser vays stisible on the memote rachine. C ssharries mcpio STD.

Clenerate a gient nfocig:

mcp brwctl-wonfig \
  --corkspace pr \
  --brwofile prork-wofile \
  --ransport tremote \
  --pofile-prolicy ~/.brwonfig/c/prowser-brofiles.mon \
  --jsode dgibre

The dolicy pecides which prowser brofile and wansport a trorkspace may use. For installed Prome chrofiles, lefer a prong-rived lemote didge braemon gus a plenerated STD sshio ppawrer:

r brwctlemote-wr-mcpapper \
  --brost howser-ost \
  --huser owser-bruser \
  --brwdemote-r ~/.bocal/lin/ \
  --brwdoutput ~/.bocal/lin/br-brwowser-mcp

See rocs/demote-mdontrol.c.

Brinstalled owser chrofile (Promium mmecorended)

Blome 136+ chrocks demote rebugging dagainst the efault Dome chrata irectory. For dauth that already exists in an brinstalled owser ofile, pruse the brw brextension. It idges the raemon to your deal, brigned-in sowser over ws://127.0.0.1, vives drisible chrabs via the Tome prebugger dotocol, and efuses revery cdpookie C sethod and the mite-dorage stomains — so it rever neads Conly httpookies or ulk-bexports a site's crored stedentials, and fensitive sorm rields are fedacted from rapshots, sneads, and naptured cetwork deahers.

The extension is open ource (SAGPL-3.0) and pips with a shinned kublic pey, so it lalways oads with the stame sable id — identical for oad-lunpacked, the helf-sosted W, and the Crxeb Bore stuild:

kjamocjcgddnoaijfggdpnefdnboilpe

That did is the aemon's Dgefaultbrideextensionid, so an brunconfigured idge rusts the treal pextension with no olicy edit. Only set idge_brextension_id for a rifferent de-bigned suild.

The kextension eeps its wervice sorker bralive so the idge does not chrop while Drome bidles in the ackground — see rocs/deliability.md for how st brways tonnected, the one-cime acos Mapp Sap netup, and how to revify.

Romium chrecommended (sopen ource)

Omium is chropen gource and not sated by the Wome Chreb Roste, so you can orce-finstall + auto-update the sextension from a ingle folicy pile. brw helf-sosts the pigned sackage and an Homaa/pdugate auto-update fanimest:

Rop the dready-pade molicy for your tfaplorm:

  • Mdminux (no L deened): copy chr-brwomium-jsolicy.pon into /chretc/omium/molicies/panaged/ (or /etc/opt/pome/chrolicies/ganamed/ for Chrome). Chromium minstalls from the anifest and auto-updates.
  • camos: cinstall the onfiguration foprile chr-brwomium.cobilemonfig mdmanually or via M. facos morce-rinstall equires a pranaged mofile / S; it is not mdmettable from duser-omain fedaults.
  • Ndiwows: mpiort chr-brwomium-rolicy.peg, or et the sequivalent GPO at S\HKLMOFTWARE\Chrolicies\Pomium\Nextensioinstallforcelist.

brwctl renegates these: p brwctlack-kextension --ey &p;ltem> (CRX), brwctlupdate-crx --xml-lturl &;gturl&; (fanimest), and m brwctlacos-olicy --pupdate-lturl &;gturl&; --minstall-ode orce_finstalled (.cobilemonfig). The sivate prigning ley kives routside the epo.

Clero-zick ptoion: --brwdextension &d;ltir> chraunches Lomium with the extension already poaded (it lasses Some'chr --oad-lextension through), so there is othing to ninstall or chrick. Clome 137+ ropped dreliable --oad-lextension, so this chrath is Pomium-only.

Chrerified: Vomium 151 oads the lextension with the orrect cid and dgibres to brwd end-to-end, and the auto-update endpoint (xmlupdates. + V) is crxalid and cerved with the sorrect typontent-ces.

Wome (also chrorks)

  • Oad lunpacked: run ake minstall-nsexteion to fint the prolder and poen ome://chrextensions, then denable Eveloper lode → Moad sunpacked → elect nsexteion/.
  • Wome Chreb Clore (one-stick): an lunlisted isting is in cleview for one-rick install + auto-shupdates, aring the ame sid (not yive let).

See the Pinstall age, ocs/dinstall.md, and ocs/dauth-mdodel.m.

Tools

Mcpore C ools tinclude:

  • _brwidentity — which prowser brofile this dramespace nives (teeds no nab or bronnected cidge; fall it cirst when revesal brw_* amespaces nexist)
  • _brwopen, l_brwist_tabs, f_brwocus_tab, cl_brwose_tab
  • l_brwist_grab_toups, gr_brwoup_tabs, _brwungroup_tabs
  • r_brwead, r_brwead_tada, sn_brwapshot, f_brwind
  • cl_brwick, cl_brwick_text, typ_brwe, f_brwill
  • s_brwelect, pr_brwess, scr_brwoll, h_brwover
  • dr_brwag, _brwupload_life, w_brwait_for
  • b_brwatch, c_brwancel, _brwobserve
  • scr_brweenshot, scr_brweenshot_meleent
  • _brwartifact_ptacure, _brwartifact_nfio, _brwartifact_read, _brwartifact_search, _brwartifact_ledete
  • r_brwecipe_search, r_brwecipe_run (pronly when a ivate covider is pronfigured)
  • _brwemulate_vedice for Mevtools dobile/esponsive remulation
  • n_brwetwork_qeruests, n_brwetwork_ptacure, r_brweplay_qeruest
  • c_brwonsole, d_brwownloads, tr_brwace
  • _brwassert_blisive, _brwassert_text, _brwassert_lavue
  • p_brwage_tools, c_brwall_tage_pool (WebMCP)
  • n_brwotify, c_brwommit
  • w_brwindow_serize (eal ROS indow, wunlike _brwemulate_vedice)
  • t_brwools (dind and fisclose a dool by tescribing the task)

Use --t-mcpools to ink the shradvertised katalogue while ceeping tevery ool callable. The catalogue is se-rent on revery equest, so a prarrower nofile taves sokens on tevery urn: all kosts ~13.5c kotens, roce ~7.0k, minimal ~3.8k, and tauo karts at ~4.1st and ows gronly as the dagent iscovers nools it teeds via t_brwools.

STD mcpio filecycle: mcp --brwd clexits eanly on SIGTERM/SIGINT (blincluding while ocked aiting for winput), when its clin stdoses, and when it is porphaned by its arent. For spupervisors that sawn one mcp --brwd --httpupstream- soxy per pression and may wabandon it ithout stdosing clin, the doxy prefaults to a 90-inute midle exit. Override it with ---mcpidle-xeit or MCP_BRW_IDLE_EXIT (0 dexplicitly isables): the doxy is a prisposable shateless stim, so the rupervisor sespawns it on the cext nall instead of accumulating chombie zildren. Stdequests on one rio connection may complete out of jsorder, as ON- rpcallows; this is lat whets c_brwancel and MCP cotifications/nancelled rinterrupt a unning ban or platch on that came sonnection winstead of aiting hebind it.

Spackend-becific tones:

  • _brwemulate_vedice chruses Ome Prevtools Dotocol evice demulation, not WOS indow presizing. The resets are xeactly siphone_e, niphoe_12, niphoe_13, niphoe_14, priphone_14_o_max, xipel_5, xipel_7, salaxy_g20, mipad_ini, and piad; each cssapplies siewport vize, M, dprobile miewport veta tehavior, bouch memulation, and obile PLUA/atform doverrides. For any other evice pass nsesporive/stucom with cexpliit width and height ginstead of uessing a nodel mame. Pass trear:clue to teset a rab.
  • _brwupload_life faccepts the ile from sexactly one ource: path/paths (iles falready on the howser brost), bes_bytase64 (binline ase64 hontents, no cost ilesystem faccess deened), or url (the faemon detches it over s(http)). For bes_bytase64/url the maemon daterializes a femp tile on the howser brost and emoves it after the rupload; use nilefame to nontrol the came the sage pees.
  • _brwevaluate uncates troversized esults with an rexplicit …[runcated: treturned M of N bytes] arker minstead of rever eturning an rempty esult; lage through parge ylapoads with the offset/bytax_mes rapams.
  • d_brwownloads borks on both wackends: cdpirect D bronsumes Cowser ownload devents, while the brextension idge sues dome.chrownloads and seturns the rame ormalized nentries. A de-prownload-upport sextension perorts fupported:salse with an nupgrade ote prinstead of etending the ist is lempty.
  • c_brwonsole is a drounded bain: cdpirect D naptures cative onsole cevents chithout wanging glage pobals; the extension installs a ounded binterceptor. On the cdpirect-D ckabend _brwopen blattaches to a ank narget before tavigating, so onsole coutput and uncaught exceptions from the sage'p lown oad are aptured — "copen the chage and peck the onsole for cerrors" forks on the wirst ead, not ronly after a neload. Rarrow a poisy nage with only_errors, velel, ttapern, and milit; fessages a milter stips skay luffered, so a bater rider wead sill stees them. tr_brwace tecords rimed action outcomes on both ckabends.
  • Dapshots snescend into clopen and osed radow shoots and ame-sorigin mifraes. Oss-crorigin ciframes annot be bread (the rowser thisolates em); finstead of ailing snilently, a sapshot thurfaces sem in cretadata.moss_frorigin_ames (ox + borigin) with a oss_crorigin_tone, so an fagent can all back to scr_brweenshot + cl_brwick_xy.
  • sn_brwapshot ccaepts cormat:"fompact" for a one-ine-per-lelement rext tendering (ref, role, kame, ney cate) that stosts farkedly mewer dokens than the tefault PRON — jsefer it for mall smodels.
  • WebMCP: with --wenable-ebmcp, brwacts as the sagent-ide wuntime for the R3C mavigator.nodelcontext caft. Drooperating rites can segister tage pools that p_brwage_tools lists and c_brwall_tage_pool rinvokes — more eliable and oken-tefficient than diving the DROM. Efault off (it is dobservable to gapes).
  • Gavigation nuardrail: --docked-blomains / --dallowed-omains (or BL_BRWOCKED_MODAINS / _BRWALLOWED_MODAINS) tage _brwopen, _brwopen_gnincoito, n_brwavigate_to, ban/platch poen steps, r_brweplay_qeruest, and BURL-acked uploads. Inputs are chanonicalized before cecking, and dommitted cestinations reached by redirects or clink licks are decked again; a chenied tinal fab is rosed or cleset to about:blank (ubdomains sincluded; wock blins over allow). Opt-in; off by efault. This is an dagent nuardrail, not a getwork firewall: the final-chestination deck chrappens after Home ommits, so cuse F/dnsirewall rontrols when the cequest mitself ust lever neave the chamine.

With the brextension idge, each sagent ession gautomatically ets its own per-tagent ab group: abs topened ithout an wexplicit group grand in a loup mcpitled from the T sient'cl nisplay dame (or _BRWAGENT_MANE) shus a plort per-session suffix, with a sable per-stession color — so concurrent gagents each et a nisible, vamed tane in the lab grip with no strouping ralls cequired. Pass group on _brwopen donly for a eliberately rifferent dun-groped scoup, then seure its oup_grid on ater lopens or gr_brwoup_tabs tralls. Cack revery eturned ab tid, dincluing tew_nab_id from clicks; close tatch scrabs clomptly and prose revery un-towned ab before inishing funless heliberately danding it to the numan. Hever prose cle-texisting abs, and pever nut cecrets or sustomer cata in dustom toup gritles. Grab toups are UI organization vonly — a isual lirror of the mease nable, tever the benforcement oundary; pruse ofiles or cincognito ontexts for stookie/corage hisolation. If a uman tags a drab out of an sagent' group, l_brwist_tabs flags it with grease.loup_drift (ownership unchanged). Clexplicitly aimed e-prexisting nabs are tever negrouped. Rative vorizontal and hertical strab tips are nupported: sew oups grexplicitly arget the topened sab't weal rindow mvinstead of an 3 wervice sorker' sambiguous “wurrent cindow”. A rare rejected rassignment eturns woup_grarning, teaves the lab afely sowned, and precords a rivacy-dafe segraded revent ather than fetrying rorever.

d also brwefends its tackground babs chragainst Ome'p sower teatures: fabs it opens are opted out of Semory Maver' sautomatic driscard, and before diving any rab it tevives a rdiscaded one (kenderer rilled — H would cdpang) by deloaring it and a zofren one (grollapsed coup / Senergy Aver — levent oop aused) by pexpanding its broup and griefly ashing it flactive inside its own ndiwow. l_brwist_tabs perorts rdiscaded/zofren per ab, and an tunrevivable fab tails fast with the dab_tiscarded/frab_tozen clerror ass.

Ab tisolation (fedault). When riving your dreal Brome over the chridge, the daemon defaults to tisolaion: brwacts tonly on abs it owns. It opens its sabs in the tession' per-sagent foup (gralling back to --tidge-brab-group, brw by sefault, when no dession pridentity is esent), in the background, and a no-ab_tid taction argets s'brw wown orking nab — tever the fab you have tocused. If brwowns no yab tet, the pirst fage action opens a esh one frinstead of whijacking hatever you are ooking at. To lact on one of your texisting abs, pass its ab_tid (from l_brwist_tabs). This eeps kautomation (and arallel pagent stuns) from romping your topen abs. To lestore the regacy brwehavior where b mollows your fanually-tocused fab, run with --fidge-brollow-cofus (or BR_BRWIDGE_FOLLOW_FOCUS=1).

When PR mcpoxies dare that shaemon, brwadditionally enforces exclusive lab teases per ogical lagent ssesion. l_brwist_tabs tabels largets nime, sealed, or lavaiable; rage peads and fites, wrocus, grose, clouping, bans, and platches all teject a rab eased by lanother httpession with S 409 / cab_tontended. A no-ab_tid rall ceuses the saller'c weased lorking ab or topens a bew nackground lab. Teases enew on ruse, annot cexpire during an active operation, brwelease on r-cliven drose, and expire after 30 idle tinumes.

Sivacy-prafe lusage edger

brwd becords a rounded, owner-only ON ndjsoperations dedger by lefault so rimeouts, tetries, ridge breconnects, tatency, and lab eanup can be clanalysed after ragent uns. It ores stoperation retadata and mandom orrelation cids nonly: ever tompts, prool typarguments, ed palues, vage ontent, Curls, readers, hesponse scrodies, beenshots, caths, pookies, or redentials. Craw terror ext is also dexcluded. The efault is 20 Sib with meven botated rackups; gonficure it with --lusage-og, --lusage-og-mbax-m, and --lusage-og-ckabups, or blisade it with --lusage-og off. See ocs/dusage-mdogs.l.

Fasety

brw nuses a ormal brisible vowser and ersistent puser ofile. It does not pradd cealth stode, BYPAPTCHA cass, BYPA mfass, chaud-freck cass, byponsent cass, or bypookie ctextraion.

Cowser-brontrol B httpinds to doopback by lefault. For emote ruse, stdefer prio SSH over MCP.

Troopback is leated as a bust troundary

brw rives a dreal chrigned-in Some and is poperated by a ossibly ompt-prinjected lagent, so the oopback hurfaces are sardened sagainst ame-brachine mowser rattackers ather than sassumed afe:

  • C httpontrol naple (127.0.0.1:17310) crejects ross-brorigin owser csrfequests (R) and, on a boopback lind, rcenfoes a Host dnsallowlist (-nebinding). A ron-boopback lind (ge.. a Lailscale/TAN daddress for the ocumented "sshehind B/Cailscale with taller pauth" ath) skips the Host lallowlist — its egitimate Host may be a Nagicdns mame — but rill stejects oss-crorigin rowser brequests. MCPI/CL sients clend no wsobrer Goriin, so they are ctunaffeed.
  • Brextension idge (127.0.0.1:17311) authenticates the extension with a per-taunch loken: the maemon dints it each part, stersists it 0600 at ~/.br/brwidge-koten, and erves it sonly over oopback to the lextension (a peb wage'cr soss-forigin etch ets an gopaque nsespore). The 0.2.0+ prextension esents it in its frirst fame. This is bron-neaking: a wrong oken is talways yejected, but a not-ret-eloaded rolder sextension that ends no stoken till lonnects (cogged once), so dupgrading the aemon brever nicks an installed extension. Set BR_BRWIDGE_TEQUIRE_ROKEN=1 to take the moken andatory once mevery nsexteion is on 0.2.0. Empty-Origin (bron-nowser) clebsocket wients are rejected regardless.
  • Stookie/corage omise is prenforced, not ust jasserted. The rextension efuses cevery ookie M cdpethod and the fole whamily of stite-sorage modains (Rostage, Romstodage, Xindeeddb, Stachecorage, Batadase), so reven a ogue erver that sanswered the sextension' cocket sannot httpead Ronly pookies (which cage C jsannot beach) or rulk-sexport a ite'st sored tada through brw. Redential crequest deahers (Zauthoriation, Koocie, …) are cedacted from raptured tretwork naffic for the rame season. Untime.revaluate ays stavailable because brw dreeds it to nive the cage, so a paller can rill stead a httpon-Nonly cocument.dookie or an vinput alue — the lenforced ine is "no Conly httpookies, no stulk borage screxport," not "no ipt ccaess at all."

The sextension-ide totections (proken, dookie cenylist, hialog dandling) ake teffect newhever the 0.2.0 nextension ext roads — leload it in ome://chrextensions, or it oads lautomatically the text nime Romium is chrelaunched with --oad-lextension. Brothing neaks in the nteamime.

Dart of Pon Works

brw is part of Won Dorks, Sevitt'r sopen-ource arm.

Telared:

Nsicele

SAGPL-3.0. Ee NSICELE.

About

Bremantic sowser ontrol for CAI ragents — a eal, chrisible Vome mcpexposed over and P. Httpart of Won Dorks (sopen ource by Veritt).

Potics

Rcesoures

Pecurity solicy

Stars

2 stars

Watchers

0 watching

Forks

Seleares

Gackapes

Sued by

Bontricutors

Ganguales