usermods 开源浏览器扩展发布:对话生成 userscript 定制任意网站
kballenegger/usermods
开源浏览器扩展 usermods 发布,用户可在任意页面打开侧边栏,用自然语言描述需求,模型会检查页面 DOM、编写 userscript 并实时测试,再以 Try 和 Save 按钮交付。
Vibe-code userscripts in place. An open-source browser extension that lets you customize any website by chatting with the LLM of your choice.
Open the side panel on any page, describe what you want changed, and usermods inspects the page, writes a userscript, tests it live, and hands it to you with Try and Save buttons. Saved mods run automatically on every matching page load. Export them as standard .user.js files, share them as a GitHub gist or on Greasy Fork from your own signed-in tab (usermods fills the form; you press the button), install ones from Greasy Fork or any page that offers one, or migrate your whole Tampermonkey library in one file.
Userscripts, userstyles, usermods.
usermods-launch-readme.mp4
Why
- Any backend. Anthropic's API, OpenAI, OpenRouter, or anything OpenAI-compatible: Ollama, LM Studio, vLLM, mlx_lm. Your key, your machine, no account, no hosted service.
- Use the subscription you already pay for. Sign in with ChatGPT (Plus, Pro, Team) or SuperGrok / X Premium+ straight from Settings. No API key, no local proxy, no per-token bill. (In the build from this repository; the Chrome Web Store version leaves sign-in out.)
- The model actually sees the page. It reads a pruned DOM, lists elements, reads computed styles, takes screenshots, and runs scripts to test its work before proposing anything.
- One-off tasks too. "Scroll to the bottom, open every carousel, and give me download links for all the photos" runs as a script, no mod required.
- Portable. Mods are plain userscripts with a
==UserScript==header. Nothing proprietary. MIT.
Status
Early, and working end to end: chat, page inspection, live testing, propose, save, run on load, edit an installed mod in chat, import and export. A Chrome Web Store listing is on its way; the Safari build runs on Mac, iPhone and iPad. See Roadmap.
Screenshots
More, including every screen in both themes and the iPhone build: docs/screenshots.md.
Features
- Chat that inspects the page and writes a mod — it reads the real DOM, tries things with
run_script, tests the finished script the way the saved mod will run (on a fresh page load when that matters), and only then proposes something you can Try and Save. The proposal says how it was tested. - Any provider, including subscriptions — Anthropic, OpenAI, xAI, OpenRouter, any OpenAI-compatible endpoint, ChatGPT and SuperGrok sign-in. Connect several; pick the model and its thinking level per chat, and switch mid-conversation.
- Edit any installed mod in chat — including ones you imported. Update mod writes back over the same mod, header and stored values intact.
- Tampermonkey import and GM compatibility — one backup file brings the whole library across, with the
GM_*API,@require,@resourceand@connectthe scripts expect. - Images and screenshots — paste or drop a mockup into the composer, and the model can capture the tab to check its own work. Text-only endpoints are detected and told to work structurally instead.
- Drafts with versions — each chat keeps one draft mod with a version strip, line diffs and an undoable roll back.
- Dashboard — every chat and every mod across every site in a full tab, with search, bulk actions and a source editor.
- Safari — the same extension on Mac, iPhone and iPad, subscription sign-in included.
Install (from source)
Requires Node 22+ and Chrome 135+.
npm install npm run build
Then in Chrome:
- Open
chrome://extensions, turn on Developer mode, click Load unpacked, and pick.output/chrome-mv3. - Click Details on usermods and turn on Allow User Scripts. Chrome requires this toggle for any extension that runs user scripts, including Tampermonkey.
- Click the usermods icon to open the side panel on that tab. Go to Settings, click a preset under Add provider, and paste a key (or a local server URL). It saves as you type. Back in Chat, the model is the chip in the chat bar.
For Safari, node scripts/safari-xcode.mjs doctor says what your Xcode allows, and simulator / mac build it. One app, one extension, both platforms, subscription sign-in included — docs/safari.md has the build, the install steps, the limitations and what has actually been seen running.
Learn more
- docs/guide.md — using usermods: providers, picking the model and thinking level, subscriptions, editing a mod, importing and migrating, images, the dashboard, where the panel opens.
- docs/gm-api.md — the
GM_*compatibility table,@connect, and the page world. - docs/architecture.md — how it works: the agent loop, drafts, compaction, storage, the test harness, security notes.
- docs/safari.md — the Safari build, its limitations and what has been seen running.
- docs/screenshots.md — the full gallery. docs/design.md — the style guide.
- docs/roadmap.md — what is next. CHANGELOG.md — what changed.
Privacy
usermods has no server, no account and no telemetry. The author receives nothing. To change a page, the model has to see it, so when you send a message usermods sends — directly from your browser to the provider you picked for that chat, and nowhere else — your message, the page's address and title, a pruned copy of its HTML, details of elements it looks up or you point at, and a screenshot of the visible tab when the model asks for one. If the page is your mailbox or your bank, that content goes too; close the panel on pages you would rather not share. Point usermods at a local model and nothing leaves the machine at all.
Your API key, subscription tokens, saved mods, their GM_setValue stores and your chat history all live in extension local storage on your device. Keys and tokens are sent only to the endpoint they authenticate.
The panel says all of this in the side panel before your first message, and the notice is always available again from Settings → Review data notice. The full policy is in PRIVACY.md; the Chrome Web Store submission material is in docs/store/.
Contributing
Issues and pull requests are welcome. CONTRIBUTING.md covers the setup, the npm scripts, where everything lives, how to add a provider, and the one hard rule: every fix lands with a regression test. The Code of Conduct sets out how this project is run and the one line it draws.
Author
Made by Kenneth Ballenegger.
License
MIT © Kenneth Ballenegger
来源:GitHub · github.com

