| ▲ | Show HN: Cursor for Userscripts(github.com) | ||||||||||||||||||||||||||||||||||
| 50 points by mifydev 8 hours ago | 13 comments | |||||||||||||||||||||||||||||||||||
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. | |||||||||||||||||||||||||||||||||||
| ▲ | mrandish an hour ago | parent | next [-] | ||||||||||||||||||||||||||||||||||
Cool! Just this week I've been playing around using web chatbots to write userscript. So far, I've just been cutting/pasting code from ViolentMonkey's basic edit window - which is a clunky workflow and a real editor like VSCode would be great. Even though the script is quite short, I've already found I definitely need auto-rollback due to AI regressions. So this sounds very useful! I use Firefox (on Win) but I guess it might be worth using Chrome just for write/test iteration and then copy over to FF. Looking just now it appears ViolentMonkey on Chrome died in the Manifest V3 apocalypse but is still on Edge. | |||||||||||||||||||||||||||||||||||
| ▲ | rahimnathwani 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||
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. | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| ▲ | Akranazon 6 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||
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. | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| ▲ | cxr 3 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||
<https://web.archive.org/web/20120601101804/https://blog.mozi...> <https://sites.coecis.cornell.edu/leshed/files/2015/12/coscri...> | |||||||||||||||||||||||||||||||||||
| ▲ | Esophagus4 6 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||
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. | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| ▲ | _false 4 hours ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||
Love the decision to edit DOM directly. More LLM tools should carefully consider their training environments instead of treating LLMs like AI Gods. | |||||||||||||||||||||||||||||||||||