An AI side panel for injecting dynamic page scripts, reshaping any page on demand, and replaying those changes automatically.
PageHand turns the Chrome side panel into a lightweight page copilot.
Its core superpower is dynamic page scripting: describe the change you want in natural language, let the model generate the script, execute it from chat, and keep it alive for future visits. It can also read the current page, answer questions about what is on screen, and replay matching scripts across revisit and SPA route changes.
Most browser AI tools stop at summarization.
PageHand goes one step further:
- Read the current page context.
- Generate a runnable dynamic script for that page.
- Let you execute the script from chat.
- Persist the script and replay it automatically next time.
That means you are no longer limited to “ask questions about the page.” You can actively reshape the page: remove clutter, inject UI, highlight actions, add summaries, translate content, or customize internal tools for yourself without maintaining a separate userscript workflow by hand.
- Generate dynamic page scripts from natural language and execute them directly from chat.
- Inject UI, remove sections, rewrite content, or alter page behavior without hand-writing code first.
- Persist scripts by
path,exact, ordomainscope. - Run multiple scripts on the same page.
- Re-apply matching scripts on SPA route changes.
- Chat with the current page instead of a blank LLM session.
- Toggle search per message when you want extra context.
- Inspect effective scripts for the current page and enable or disable them quickly.
- Use a compact chat-first UI with prompt library shortcuts.
- Support
light,dark, andautothemes.
flowchart LR
A["Current page"] --> B["Page context extractor"]
B --> C["PageHand side panel"]
C --> D["OpenAI-compatible model API"]
D --> C
C --> E["Generated answer or script"]
E --> F["Execute in current tab"]
F --> G["Persist rule in chrome.storage + chrome.userScripts"]
G --> H["Auto-run on revisit and SPA route changes"]
PageHand answers with awareness of the active tab.
Example prompts:
总结当前页面提取这个页面的关键信息说明这个页面下一步最值得做的事情把当前页面结构拆解给我
Enable script mode when you want the model to modify the page instead of only answering.
Example prompts:
移除广告和推荐区,让正文更干净在标题下方插入一张摘要卡片高亮当前页面最关键的 CTA把正文翻译成简体中文,但保留排版
The assistant returns a script card in chat. You choose a persistence scope and click 执行.
This is the heart of PageHand:
- ask for a change in plain language
- get back an executable script
- inject it into the page instantly
- keep that behavior on the next visit
After execution, PageHand stores the rule locally and registers it with chrome.userScripts.
That gives you:
- automatic replay on revisit
- reusable site rules
- layered rules for the same page
- stable personal page customization without re-prompting every time
For single-page applications, PageHand listens for route transitions and re-runs matching rules when the URL changes.
The side panel shows whether the current page already has matching scripts and lets you:
- inspect effective status
- run a rule immediately
- enable or disable a rule
- Chat-first: the side panel should feel like a normal assistant.
- Minimal friction: search and script mode are simple toggles next to send.
- Personal automation: generated scripts are for self-use and repeated workflows.
- Local ownership: settings and rules live in browser storage.
- Fast iteration: generate, execute, refine, and keep the result.
Download the latest zip from:
https://github.com/lwxyfer/pagehand/releases/latest
Use the asset named like:
pagehand-0.1.0-chrome.zip
Unzip the release package to any local folder you control.
Open chrome://extensions, enable Developer Mode, and load:
<your-extracted-folder>
In the extension details page, turn on:
Allow User Scripts
This is required for persistent script replay.
- Open a normal
http,https, orfilepage. - Open PageHand from the Chrome side panel.
- Open Settings and add your model provider API key, base URL, and model name.
- Try a quick action such as
总结当前页面. - Turn on script mode and ask for a page modification.
- Choose a scope and click
执行. - Revisit the page and confirm the script auto-runs.
The settings page includes:
- API key
- Base URL
- Model
- Temperature
- Max tokens
- Theme mode:
light,dark,auto - Default script scope
- Prompt Library
- Site-specific instructions
PageHand uses these core Chrome capabilities:
sidePanelfor the chat UIstoragefor settings and persistent rulestabsandactiveTabfor current-tab awarenessscriptingto inject the page bridge when neededuserScriptsto persist and replay generated page scripts
Host permissions are limited to http, https, and file pages.
PageHand talks to an OpenAI-compatible chat completions endpoint.
That means you are not locked to DeepSeek. You can point it at any compatible provider or self-hosted gateway that supports:
POST /chat/completions- bearer-token authentication
- regular text completions
- JSON-style responses for script generation
DeepSeek is the default example because it works well for this workflow, but it is not the only supported model backend.
If you want to modify PageHand itself:
git clone https://github.com/lwxyfer/pagehand.git
cd pagehand
npm install
npm run devType-check the project:
npm run compileBuild production assets:
npm run buildCreate a distributable zip:
npm run zipsrc/
app/
sidepanel/ # chat-first side panel UI
options/ # full settings page
deepseek.ts # OpenAI-compatible model integration
page-context.ts # current-page extraction
prompts.ts # analyze/script prompts
runtime.ts # userScripts registration and execution
storage.ts # settings and rule persistence
app-entries/
background.ts # orchestration and message routing
page-bridge.content.ts
sidepanel/
options/
scripts/
validate-deepseek.ts # local verification helper
- Clean cluttered articles and focus on the main content.
- Add custom reading aids to documentation pages.
- Highlight internal workflow steps on dashboards or consoles.
- Insert summaries, notes, or action cards into repeated work pages.
- Build lightweight personal augmentations for SaaS tools without maintaining a full userscript stack manually.
- Chrome internal pages such as
chrome://are not supported. - Arbitrary script side effects cannot always be reversed safely without reloading the page.
- Script quality depends on the target DOM and the generated code.
- The project currently targets Chromium-based browsers, not Firefox.
- Generated scripts are code and should be treated seriously.
- PageHand is intended for self-use, controlled environments, and trusted workflows.
- Avoid script generation on sensitive pages such as banking, payment, identity, or production admin systems.
- Settings and script rules are stored locally in browser storage.
- Current page content is sent to the configured AI endpoint only when you ask for analysis or script generation.
- PageHand does not require a hosted backend to function.
PageHand started from the excellent Page Assist codebase and was reshaped into a focused current-page assistant plus persistent page scripting tool.
- reversible script runtime for true no-refresh disable
- rule grouping and batch execution controls
- import and export for personal script libraries
- richer script inspection and debugging tools

