What is MonkeyMom: A Tampermonkey AI Script
About the author: Tooling engineer, formerly at Qualcomm and MediaTek. Builds MonkeyMom, an AI userscript factory for desktop and mobile managers.
MonkeyMom is a Tampermonkey AI script that writes userscripts: describe a task, and AI generates a child script that runs with GM privileges, no upload needed.
Most userscripts are written by someone else and installed by you. MonkeyMom flips that: it is a userscript that writes userscripts. Describe what you want in plain language, and its AI turns that into a child script that runs on the page immediately — no upload, no review queue, no waiting for the author of a script to add the feature you need.
A script factory, not a script
How generation works
The idea is simple once you see it. JavaScript is a functional language, and a script can build and run another script. Before AI, that meant string concatenation and guesswork. Now the "code generator" inside the loop is a language model:
- You describe the task — "download this table", "hide the sidebar", "make this site dark".
- MonkeyMom asks the configured model for a script, with a constrained GM API allow-list in the prompt.
- The generated code is injected into the page as a child script, compiled inside the privileged injection rather than through
eval. - If it works, save it to the script list. If not, ask for a change and rerun.
Child scripts get full GM privileges
That child script is not a sandboxed toy. It runs with the userscript manager's privileges and can use GM.setValue, GM.xmlHttpRequest, GM.openInTab, @resource assets, menu commands and notifications — the same surface a hand-written userscript would get.
An agent loop, not a single prompt
Observe, decide, act, repeat
A single prompt only handles tasks you can describe precisely. MonkeyMom also runs an agent loop: observe the page, decide on a tool, act, look at the result, repeat. The tools are deliberately coarse — one execute_script entry point for page code, plus capabilities page JavaScript cannot reliably do on its own:
- Read the page as markdown, and take screenshots via
html2canvas. - Cross-origin HTTP requests that bypass CORS restrictions.
- Save and manage child scripts, skills and conversations.
- Move files between the browser's OPFS workspace and your disk.
- Ask you a question when the task is genuinely ambiguous.
Lightweight automation inside a real tab
Because the loop drives a real browser tab, this is a cheap form of browser automation. It is not a replacement for Playwright or a headless fleet — it is lightweight automation inside the tab you are already using.
The family of tabs
Parallel sub-tasks across tabs
Recent versions turned the chat list into a proper workspace. A task runs in a conversation, and an agent can open more than one tab to split work in parallel — each tab gets its own isolated task state, with a handoff note so a task survives navigation to another site. ### Triggering tasks from a URL
A URL ending in #__tm=<JSON> opens the chat page and sends the prompt directly, which makes it easy to trigger MonkeyMom from a bookmark or another tool.
Why the compatibility work matters
Managers do not behave the same
A lot of the effort is invisible: testing how GM.* calls actually behave across Tampermonkey, Violentmonkey, Stay for Safari and Via on mobile. Return values differ — some managers return promises, some return the element directly, some return undefined. GM.xmlHttpRequest is callback-based in some managers, so await-ing it and reading .status throws. MonkeyMom records these differences, keeps the API allow-list aligned with the official docs, and synthesizes the classic GM_getValue family with per-script storage so old scripts keep working.
Export keeps you portable
The payoff is portability: a child script can be exported as a standard userscript, and MonkeyMom itself runs on desktop and mobile managers alike.
What you can do with it today
Everyday uses
- Free replacements for paid browser extensions — a dark-mode script on Safari, for example, where the extension store charges for the same feature.
- One-off extractions — pull a table from a page that has no download button, clean it up, and save the script for next time.
- Small automations — form filling, list scanning, repetitive clicking, with a human in the loop at the confirmation step.
- A patch for weak in-browser AI — when the browser's built-in assistant cannot reach the page, a userscript with GM privileges still can.
Getting started
Install and run your first task
Install the script from the site, open the AI chat tab, and describe the first thing you want to change about a page. If you already have a userscript you like, install it the same way — MonkeyMom runs standard .user.js files as child scripts, and asks before installing anything it did not generate.
The generated script is yours to keep, edit and export. That is the point: the browser already has a script engine, and now it has a way to write to it.