[HN Gopher] Show HN: Cursor for Userscripts
___________________________________________________________________
Show HN: Cursor for Userscripts
I've been experimenting with embedding an Claude Code/Cursor-style
coding agent directly into the browser. At a high level, the agent
generates and maintains userscripts and CSS that are re-applied on
page load. Rather than just editing DOM via JS in console the agent
is treating the page, and the DOM as a file. The models are often
trained in RL sandboxes with full access to the filesystem and
bash, so they are really good at using it. So to make the agent
behave well, I've simulated this environment. The whole state of a
page and scripts is implemented as a virtual filesystem hacked on
top of browser.local storage. URL is mapped to directories, and the
agent starts inside this directory. It has the tools to read/edit
files, grep around and a fake bash command that is just used for
running scripts and executing JS code. I've tested only with Opus
4.5 so far, and it works pretty reliably. The state of the file
system can be synced to the real filesystem, although because
Firefox doesn't support Filesystem API, you need to manually import
the fs contents first. This agent is _really_ useful for
extracting things to CSV, but it 's also can be used for fun.
Demo: https://x.com/ichebykin/status/2015686974439608607
Author : mifydev
Score : 26 points
Date : 2026-01-28 19:39 UTC (3 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| Esophagus4 wrote:
| Awesome! So the agent has access to the DOM/JS running in the
| browser?
|
| That's one of my biggest headaches writing user scripts
| currently: I write the script in an IDE with Claude then copy it
| to the browser / manually test it in the browser, then copy the
| results back to Claude or tell it what went wrong.
|
| Looking forward to trying this.
| mifydev wrote:
| Yup, full access to DOM! Still needs a lot of optimizations,
| but the trick is that the agent reads the DOM as file, so it
| can grep parts of it naturally.
| Zekio wrote:
| to my knowledge all the major userscript extensions, at least
| allow watching for file changes so you don't have to copy it
| manually, so you can just refresh the page to test
| Akranazon wrote:
| I'm working on a version of this, https://www.quillmonkey.com/ so
| you got ahead of me. I imagine there are many versions of this
| coming. Interesting what set of tools you went with.
| mifydev wrote:
| Oh that's cool! I've just used wxt to pack extension for
| firefox and chrome and just used typescript and plain anthropic
| api. My goal is to make this run fully inside the browser,
| without any helper binaries, like I've seen with others.
| Akranazon wrote:
| Your project seems pretty close to where mine was a couple
| weeks ago, where I was focused on a BYOK solution (user-
| entered Anthropic API key). I saw there was another similar
| extension already released in the app store (RobotMonkey)
| which hooks up to their own backend service, and offers
| subscriptions. For my project, I think that's the right way
| to go.
|
| It's funny what details about our designs are similar through
| accident. And what other things are completely different. I
| can show you my design potentially.
|
| Representing websites in a virtual filesystem is creative and
| definitely makes it easier for the agent to collect
| information about the page. But I'm confused between the
| `Bash` and the `Edit` tools. It seems like one uses the
| chrome executeScript API, and the other updates the file
| system. But if it's just doing file writes, are those edits
| visible in the browser, and persistent across sessions?
| rahimnathwani wrote:
| It would be cool if you could make this work with Gemini Flash,
| with keys from AI Studio. I imagine that would expand the set of
| people who would try it out, because they could use 'free' keys
| and not worry about unexpected bills.
___________________________________________________________________
(page generated 2026-01-28 23:00 UTC)