From f05bf68f61a67c8bdd905c2463d67cb151e2809a Mon Sep 17 00:00:00 2001 From: Simon <10131203+gaomeng1900@users.noreply.github.com> Date: Mon, 11 May 2026 19:28:49 +0800 Subject: [PATCH] docs: `?autoInit=false` docs --- README.md | 2 ++ docs/README-zh.md | 2 ++ .../website/src/pages/docs/introduction/quick-start/page.tsx | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 8821929..44789b7 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ Fastest way to try PageAgent with our free Demo LLM: | Global | https://cdn.jsdelivr.net/npm/page-agent@1.8.1/dist/iife/page-agent.demo.js | | China | https://registry.npmmirror.com/page-agent/1.8.1/files/dist/iife/page-agent.demo.js | +Add `?autoInit=false` to load the script without creating the demo agent automatically. You can then instantiate it with `new window.PageAgent(...)`. + ### NPM Installation ```bash diff --git a/docs/README-zh.md b/docs/README-zh.md index 77231fc..0a23570 100644 --- a/docs/README-zh.md +++ b/docs/README-zh.md @@ -52,6 +52,8 @@ | Global | https://cdn.jsdelivr.net/npm/page-agent@1.8.1/dist/iife/page-agent.demo.js | | China | https://registry.npmmirror.com/page-agent/1.8.1/files/dist/iife/page-agent.demo.js | +在 URL 后添加 `?autoInit=false` 可只加载脚本,不自动创建 Demo Agent;之后可通过 `new window.PageAgent(...)` 手动初始化。 + ### NPM 安装 ```bash diff --git a/packages/website/src/pages/docs/introduction/quick-start/page.tsx b/packages/website/src/pages/docs/introduction/quick-start/page.tsx index 86fafc1..7d0aa9a 100644 --- a/packages/website/src/pages/docs/introduction/quick-start/page.tsx +++ b/packages/website/src/pages/docs/introduction/quick-start/page.tsx @@ -58,6 +58,11 @@ export default function QuickStart() { code={``} language="html" /> +
+ {isZh + ? '在 URL 后添加 ?autoInit=false 可只加载脚本,不自动创建 Demo Agent;之后可通过 new window.PageAgent(...) 手动初始化。' + : 'Add ?autoInit=false to load the script without creating the demo agent automatically. You can then instantiate it with new window.PageAgent(...).'} +