import { siChromewebstore, siGithub } from 'simple-icons' import CodeEditor from '@/components/CodeEditor' import { Heading } from '@/components/Heading' import { useLanguage } from '@/i18n/context' export default function ChromeExtension() { const { isZh } = useLanguage() const chromeWebStoreUrl = 'https://chromewebstore.google.com/detail/page-agent-ext/akldabonmimlicnjlflnapfeklbfemhj' const githubReleasesUrl = 'https://github.com/alibaba/page-agent/releases' return (
{isZh ? '可选的 Chrome 扩展。PageAgent.js 继续负责页面内自动化;扩展 API 额外提供多页面任务、浏览器级控制,以及从浏览器外部发起任务的能力。' : 'An optional Chrome extension. PageAgent.js keeps handling in-page automation, while the extension API adds multi-page tasks, browser-level control, and tasks initiated from outside the browser.'}
{isZh ? '跨多个页面和标签页连续执行任务,不再受限于单页上下文。' : 'Run tasks across multiple pages and tabs without being limited to a single page context.'}
{isZh ? '支持跨标签导航、页面切换和更完整的浏览器自动化能力。' : 'Enable richer browser automation, including cross-tab navigation and page switching.'}
{isZh ? '用户主动授权后,页面 JS、本地 Agent 或云端 Agent 可通过扩展发起多页面任务。' : 'With explicit user authorization, page JS, local agents, or cloud agents can trigger multi-page tasks through the extension.'}
{isZh ? 'PageAgent.js 本身即可在页面内完成自动化。Chrome 扩展是可选的能力扩展。' : 'PageAgent.js already works for in-page automation. The Chrome extension is optional, not a dependency.'}
{isZh ? '通过扩展,你可以执行多页面任务、控制浏览器,以及从浏览器外部(本地服务或云端服务)发起任务。' : 'With the extension, you can perform multi-page tasks, browser-level control, and tasks triggered outside the browser (local or cloud services).'}
{isZh ? '通过页面 JavaScript 调用 `window.PAGE_AGENT_EXT`,你的应用可以发起跨页面任务并控制浏览器行为。' : 'By calling `window.PAGE_AGENT_EXT` from page JavaScript, your app can trigger multi-page tasks and control browser behavior.'}
{isZh ? '扩展权限范围较广(例如页面访问、导航、多标签控制)。若被滥用,可能危害用户隐私。为此,调用能力由 Token 保护,用户必须主动将 Token 提供给其信任的应用。' : 'The extension has broad permissions (such as page access, navigation, and multi-tab control). If abused, it can harm user privacy. That is why access is protected by a token, and users must actively share the token only with applications they trust.'}
{isZh ? '如果你在使用 AI 编程助手(如 Cursor、GitHub Copilot),可以将以下文档链接提供给它,让它更好地理解和使用 Page Agent 扩展 API:' : 'If you are using an AI coding assistant (like Cursor, GitHub Copilot), share these documentation links with it for better understanding of Page Agent Extension API:'}
{isZh ? '推荐把 `execute` 的类型声明加入你的项目,获得完整类型提示。' : 'Add this `execute` declaration to your project for full type support.'}
{isZh ? '停止当前正在运行的任务。' : 'Stop the current running task.'}
@TODO
{isZh ? '建议先阅读扩展 API 文档,再参考 background entry implementation。' : 'Start with the extension API docs, then use the background entry implementation as a reference.'} packages/extension/src/entrypoints/background.ts