{"owner":"iflytek","repo":"astron-rpa","hasSkills":true,"totalSkillsCount":37,"totalTokensCount":19017,"categories":["anthropic-skill","root-instruction","plugin-manifest"],"hasMcp":false,"mcpConfig":null,"found":["frontend/packages/auth-app/package.json","frontend/packages/auth-app/tsconfig.node.json","AGENTS.md","frontend/packages/auth-app/tsconfig.json","frontend/packages/auth-app/tsconfig.app.json","frontend/packages/auth-app/README.md","frontend/packages/browser-plugin/README.md","frontend/packages/browser-plugin/API.md","frontend/packages/browser-plugin/tsconfig.node.json","frontend/packages/browser-plugin/package.json","frontend/packages/browser-plugin/README.zh.md","frontend/packages/browser-plugin/tsconfig.json","frontend/packages/cli/README.md","frontend/packages/cli/README.zh-CN.md","frontend/packages/cli/package.json","frontend/packages/cli/tsconfig.json","frontend/packages/components/README.md","frontend/packages/components/package.json","frontend/packages/components/tsconfig.json","frontend/packages/electron-app/README.md","frontend/packages/electron-app/electron-builder.json","frontend/packages/electron-app/package.json","frontend/packages/electron-app/tsconfig.json","frontend/packages/electron-app/tsconfig.node.json","frontend/packages/electron-app/tsconfig.web.json","frontend/packages/shared/package.json","frontend/packages/shared/tsconfig.json","frontend/packages/web-app/package.json","frontend/packages/web-app/tsconfig.json","frontend/packages/web-app/tsconfig.node.json","frontend/packages/browser-plugin/public/manifest.json","frontend/packages/components/lib/cdn-info.json","frontend/packages/cli/templates/template-vue/package.json","frontend/packages/cli/templates/template-vue/tsconfig.json","engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json","frontend/packages/components/src/components/Sheet/luckyexcel/README.md","engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json"],"skills":{"frontend/packages/auth-app/package.json":"{\n  \"name\": \"@rpa/auth-app\",\n  \"private\": true,\n  \"version\": \"0.0.0\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"vite\",\n    \"build\": \"vue-tsc -b && vite build\",\n    \"preview\": \"vite preview\"\n  },\n  \"dependencies\": {\n    \"@rpa/components\": \"workspace:*\",\n    \"@rpa/shared\": \"workspace:*\",\n    \"vue\": \"catalog:\"\n  },  \n  \"devDependencies\": {\n    \"@types/node\": \"^24.10.0\",\n    \"@vitejs/plugin-vue\": \"catalog:\",\n    \"@vitejs/plugin-vue-jsx\": \"catalog:\",\n    \"vite-plugin-svg4vue\": \"^4.5.1\",\n    \"@vue/tsconfig\": \"^0.8.1\",\n    \"tailwindcss\": \"^3.4.4\",\n    \"typescript\": \"~5.9.3\",\n    \"vite\": \"catalog:\",\n    \"vue-tsc\": \"^3.1.3\"\n  }\n}\n","frontend/packages/auth-app/tsconfig.node.json":"{\n  \"compilerOptions\": {\n    \"tsBuildInfoFile\": \"./node_modules/.tmp/tsconfig.node.tsbuildinfo\",\n    \"target\": \"ES2023\",\n    \"lib\": [\"ES2023\"],\n    \"module\": \"ESNext\",\n    \"types\": [\"node\"],\n    \"skipLibCheck\": true,\n\n    /* Bundler mode */\n    \"moduleResolution\": \"bundler\",\n    \"allowImportingTsExtensions\": true,\n    \"verbatimModuleSyntax\": true,\n    \"moduleDetection\": \"force\",\n    \"noEmit\": true,\n\n    /* Linting */\n    \"strict\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"erasableSyntaxOnly\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"noUncheckedSideEffectImports\": true\n  },\n  \"include\": [\"vite.config.ts\"]\n}\n","AGENTS.md":"# AGENTS.md\n\nGuidance for AI coding agents working in the **astron-rpa** (AstronRPA)\nrepository — an agent-ready RPA suite with out-of-the-box automation tools for\ndesktop applications, web systems, and business-process automation.\n\nAstronRPA uses a **server–client** architecture: server components run via\nDocker, and the client (RPA engine + desktop app) is packaged and run on the\nmachine that executes RPA tasks. The client toolchain is Windows-first.\n\n## Project layout\n\nThis is a multi-language monorepo driven by a unified `Makefile` (with modular\nincludes under `makefiles/`).\n\n- `backend/` — server-side microservices (deployed via Docker Compose):\n  - `robot-service/`, `resource-service/`, `rpa-auth/` — Java / Spring Boot\n    services (Maven; each ships `checkstyle.xml`, `pmd-ruleset.xml`,\n    `spotbugs-exclude.xml`).\n  - `ai-service/`, `openapi-service/` — Python services (managed with `uv`).\n- `engine/` — the Python RPA execution engine (managed with `uv`, linted with\n  `ruff`): `main.py`, `components/` (RPA components), `servers/`, `shared/`.\n- `frontend/` — pnpm workspace monorepo (Vue 3 + TypeScript, Vitest, ESLint,\n  i18n under `locales/`). Notable packages under `frontend/packages/`:\n  `electron-app` (desktop client), `web-app` (web console), `browser-plugin`,\n  `auth-app`, `cli`, `components`, `shared`.\n- `docker/` — Docker Compose manifests for the server stack.\n- `makefiles/` — modular Make components (`common.mk`, `python.mk`, `java.mk`,\n  `typescript.mk`, `go.mk`, `git.mk`).\n- `resources/` — packaged client resources. `docs/`, `FAQ.md`, `BUILD_GUIDE.md`\n  — documentation.\n\n## Toolchain\n\n- **Python 3.13.x** + **uv 0.8+** — RPA engine and Python services.\n- **Node.js 22+** + **pnpm 9+** — frontend workspace.\n- **Java JDK 8+** + **Maven** — Java backend services.\n- **Docker & Docker Compose** — server deployment.\n- Windows client packaging also needs **SWIG** (Python↔C/C++ bindings, e.g.\n  `pywinhook`) and **7-Zip** (deployment archives). See `BUILD_GUIDE.md`.\n\n## Common commands\n\nQuality and git workflow are driven by the root `Makefile` (run `make help` to\nsee detected projects and targets):\n\n- `make install-tools` — install the formatting/linting toolchain.\n- `make fmt` — format across languages (`fmt-python`, `fmt-java`, `fmt-ts`, …).\n- `make check` (alias `make lint`) — format check + linters\n  (`check-python`, `check-java`, `check-ts`, …). CI is check-only; it does not\n  auto-fix.\n- `make new-feature name=<short-name>` / `make new-bugfix name=<short-name>` —\n  branch helpers following the project's branch strategy.\n\nPre-commit hooks (install with `pre-commit install`) format the engine with\nruff: `uv run --project engine --dev ruff format ./engine`.\n\n### Run the server (Docker)\n\n```bash\ncd docker\ncp .env.example .env\n# configure the public HTTPS names and copy the certificate/key to docker/certs/\n# see docker/HTTPS_DEPLOYMENT.md for required variables\ndocker compose up -d mysql casdoor\n# wait for Casdoor initialization, then synchronize this deployment's credentials\npython3 scripts/sync-casdoor-credentials.py\ndocker compose up -d\ndocker compose ps\n```\n\nGateway API: https://localhost · Casdoor auth: https://localhost:8443\n\n### Build the client (Windows)\n\n```bash\n# full build (engine + frontend desktop app) from the repo root\n./build.bat --python-exe \"C:\\Program Files\\Python313\\python.exe\"\n./build.bat --skip-frontend   # engine only\n./build.bat --skip-engine     # frontend only\n```\n\nThe packaged installer is written to `frontend/packages/electron-app/dist/`.\n\n### Frontend (pnpm workspace, from `frontend/`)\n\n```bash\npnpm install\npnpm dev:web         # run the web console in dev\npnpm dev:desktop     # run the desktop app in dev\npnpm build:desktop   # build the Windows desktop app\n```\n\n## Testing instructions\n\nThere is no aggregate `make test`; run tests per component:\n\n- **Frontend**: `pnpm test` (Vitest) or `pnpm test:run` for a single run.\n- **Python** (`engine`, `backend/ai-service`, `backend/openapi-service`):\n  `uv run pytest` within the project where tests exist (e.g. `backend/ai-service`\n  has a `tests/` directory).\n- **Java** (`backend/robot-service`, `resource-service`, `rpa-auth`):\n  `mvn test` within the service directory.\n\nRun `make check` and the relevant tests before opening a PR, and add or update\ntests for code you change.\n\n## Code style\n\nFormatting and linting are wired through `make fmt` / `make check`:\n\n| Language        | Format / Lint                                                        |\n| --------------- | -------------------------------------------------------------------- |\n| Python          | `ruff` format + `ruff` check (see `engine/.ruff.toml`)               |\n| Java            | Checkstyle + PMD + SpotBugs (per-service configs)                     |\n| TypeScript/Vue  | ESLint (`frontend/eslint.config.mjs`); `pnpm lint` / `pnpm lint:fix` |\n\n## PR instructions\n\n- Create branches with the Make helpers (`make new-feature name=<…>`).\n- Run `make check` and the relevant component tests before committing; make sure\n  pre-commit hooks pass.\n- Keep PRs focused and write clear, conventional commit messages.\n- For build and deployment details, see `BUILD_GUIDE.md`.\n","frontend/packages/auth-app/tsconfig.json":"{\n  \"files\": [],\n  \"references\": [\n    { \"path\": \"./tsconfig.app.json\" },\n    { \"path\": \"./tsconfig.node.json\" }\n  ]\n}\n","frontend/packages/auth-app/tsconfig.app.json":"{\n  \"extends\": \"@vue/tsconfig/tsconfig.dom.json\",\n  \"compilerOptions\": {\n    \"tsBuildInfoFile\": \"./node_modules/.tmp/tsconfig.app.tsbuildinfo\",\n    \"types\": [\"vite/client\"],\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"@/*\": [\"./src/*\"]\n    },\n\n    /* Linting */\n    \"strict\": true,\n    \"noUnusedLocals\": false,\n    \"noUnusedParameters\": false,\n    \"erasableSyntaxOnly\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"noUncheckedSideEffectImports\": true\n  },\n  \"include\": [\"src/**/*.ts\", \"src/**/*.tsx\", \"src/**/*.vue\", \"../components/src/components/LaunchCarousel/LaunchCarousel.vue\", \"../components/src/components/LaunchCarousel/launch.ts\"]\n}\n","frontend/packages/auth-app/README.md":"# Vue 3 + TypeScript + Vite\n\nThis template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.\n\nLearn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).\n","frontend/packages/browser-plugin/README.md":"# English | [简体中文](./README.zh.md)\n\n# Repository Description\n\nThis repository is for the RPA browser plugin, which handles web-related automation.\n\n# Build Instructions\n\n- Build command: `npm run build` to package the universal extension for Chrome/Edge browsers\n- `npm run build:browser` is used to package the plugin for a specific browser. It supports any Chromium/Firefox-based browser variant. You only need to set `custom_agent` in `src/3rd/rpa_websocket.js` and add the corresponding command in `package.json`. The `browser` refers to the executable file name of the target browser.\n- Node version requirement: v20+\n\n# Feature Overview\n\n## 1. Deep Search Feature\n\nTo trigger deep search, you need to hover the mouse for more than 5 seconds. Deep search is designed to solve the problem of some elements being covered. However, for some uncovered elements, deep search may result in selecting an element that is not the one the user wants, so not all elements require deep search.\n\n### Implementation:\n\nBy using `document.elementsFromPoint(x, y)` to get all elements under the mouse coordinates (x, y), then for each element, calculate the distance from its left, top, right, and bottom to the target (x, y), and find the closest element. If there are multiple results, take the first one.\n\n### Recursive shadowRoot Element Retrieval\n\nSee the `shadowRootElement` function for details. It recursively checks if an element is a shadowRoot element. If so, it continues to search within the shadowRoot until a normal element is found. The path is concatenated with `$shadow$` for easy identification. When retrieving elements by path, `$shadow$` is also recognized, and the function `getElementBySelector` is used to find the target element. Currently, shadowRoot elements only support CSS selectors, not XPath selectors.\n\n### Frame Positioning Feature\n\n#### Unified Handling for Cross-origin/Same-origin iframe Elements\n\n##### 1. Cross-origin iframe Handling\n\nIn cross-origin iframes, due to the same-origin policy and the fact that iframe src can be fixed but the URL may change, and there may be identical src iframes in the same tab, finding the desired iframe by src is inaccurate. The solution is to obtain the nesting relationship (parentFrameId) from the plugin's main process, get the nesting order, and then, by passing the x, y coordinates and the nesting order, search layer by layer. The x, y coordinates are also reduced layer by layer by the iframe's position and box model (borderLeft, paddingLeft) to get the accurate position in the iframe content. See the `getIframeElement` function in backgroundInject and contentInject for details.\n\n##### 2. Same-origin iframe Handling\n\nSame as above. Although the same-origin restriction is less strict, using the same method avoids redundancy, reduces variables, and minimizes errors.\n\n##### 3. iframe Element Positioning\n\nIn content, all frame elements in the current window are marked, and the iframe's XPath is sent to the corresponding iframe via `iframe.contentWindow.postMessage`. The iframe receives the XPath via `window.addEventListener('message', function(e) { })` and sends it to the main process. This binds the iframe's XPath to its id. Thus, the full iframe path can be obtained according to the id nesting relationship, and the target element in the iframe can be located via the `iframeXpath` field.\n\n##### 4. Note\n\nThe logic for locating iframeXpath is the same as for other elements, and there are also dynamic issues.\n\n# Building crx/xpi Packages\n\n### Chrome\n\n1. Chrome can build crx plugin packages. It is recommended to use the Chrome Developer Dashboard to publish to the Chrome Web Store. A developer account is required (paid). If not published to the store, Chrome will restrict enabling the plugin. You need to add the plugin to the whitelist via the `chrome://policy` policy. On Windows, add to the registry at `Software\\Policies\\Google\\Chrome\\ExtensionInstallAllowlist`. On Linux, add to `/etc/opt/chrome/policies/managed/policy.json`. See [https://chromeenterprise.google/policies/?policy=ExtensionInstallAllowlist]() for details.\n2. For unpublished packaging: Open Chrome, go to chrome://extensions/, enable Developer Mode, select 'Pack extension', browse to the extension root directory. The first time, you can leave the private key file blank. After packing, a .crx file and a .pem key file will be generated in the root directory. The .pem file is needed for future updates. Using the same key file will generate the same plugin id for updates.\n\n### Firefox\n\n1. You can apply for a free developer account on Firefox, upload your packaged xpi file, and install it directly without publishing.\n2. Please package the Firefox extension yourself, upload it using your own developer account, and build your own XPI file.\n","frontend/packages/browser-plugin/API.md":"<!-- @format -->\n\n# Astron Browser Plugin API 文档\n\n## 1. 概述\n\n- **插件简介**：Astron Browser Plugin是Astron RPA 在web自动化的重要组成部分，为Astron RPA提供Chrome/Edge/Firefox 等浏览器提供网页自动化能力\n- **主要特性**：\n\n* 浏览器Tab 页操作\n* 网页元素操作\n* Cookie 操作\n* 脚本注入操作\n* iframe 操作\n\n- **版本信息**：5.2.11\n\n## 2. 快速开始\n\n- **安装**：npm run build 打包后使用浏览器插件管理加载插件\n- **基础配置**：Chrome 浏览器，node 环境推荐 node版本 v20+\n\n## 3. API 参考\n\n- **接口：http://127.0.0.1:{port}/browser/transition** 默认port: 9082\n- **类型：POST**\n- **请求体:application/json**\n\n```json\n{\n  \"browser_type\": \"chrome\", // firefox, edge ...\n  \"data\": {\n    \"x\": 854, \"y\": 314\n  },\n  \"key\": \"getElement\"\n}\n```\n\n### 3.1 支持的API列表\n\n#### Tab 页操作 (Tab Operations)\n\n- `reloadTab` - 刷新当前标签页\n- `stopLoad` - 停止加载\n- `openNewTab` - 打开新标签页\n- `closeTab` - 关闭标签页\n- `updateTab` - 更新标签页 URL\n- `activeTab` - 激活标签页\n- `getActiveTab` - 获取活跃标签页\n- `switchTab` - 切换到指定标签页\n- `getAllTabs` - 获取所有标签页\n- `backward` - 后退\n- `forward` - 前进\n- `maxWindow` - 最大化窗口\n- `minWindow` - 最小化窗口\n- `getTitle` - 获取标签页标题\n- `getUrl` - 获取标签页 URL\n- `captureScreen` - 网页可视区域截图\n- `capturePage` - 截取全部网页\n- `loadComplete` - 判断网页是否加载完成\n- `getFrames` - 获取所有帧\n- `getExtFrames` - 获取扩展帧\n- `resetZoom` - 重置缩放\n- `getTabId` - 获取标签页 ID\n- `getFrameTree` - 获取帧树\n- `printPage` - 打印页面\n\n#### 元素操作 (Element Operations)\n\n- `getElement` - 获取元素信息\n- `getElementPos` - 获取元素绝对位置\n- `checkElement` - 校验元素\n- `getOuterHTML` - 获取元素 HTML\n- `scrollIntoView` - 滚动到可视区域\n- `scrollToTop` - 滚动到顶部\n- `elementIsRender` - 等待元素渲染\n- `elementIsReady` - 元素是否准备好（包含页面状态）\n\n#### 元素属性操作 (Element Attribute Operations)\n\n- `getElementText` - 获取元素文本\n- `getElementAttrs` - 获取元素属性\n- `setElementAttr` - 设置元素属性\n- `removeElementAttr` - 移除元素属性\n- `getElementChecked` - 获取元素 checked 状态\n- `setElementChecked` - 设置元素 checked 状态\n- `getElementSelected` - 获取元素 selected 状态\n- `setElementSelected` - 设置元素 selected 状态\n\n#### 元素交互 (Element Interaction)\n\n- `clickElement` - 点击元素\n- `inputElement` - 输入内容\n\n#### 元素选择与导航 (Element Selection & Navigation)\n\n- `similarElement` - 获取相似元素\n- `elementFromSelect` - 通过选择条件获取元素\n- `getSimilarIterator` - 相似元素迭代\n- `getParentElement` - 获取父元素（扩大选区）\n- `getChildElement` - 获取子元素（缩小选区）\n- `getRelativeElement` - 获取关联元素（parent/sibling/child）\n- `generateElement` - 通过 xpath/cssSelector/text 生成元素\n\n#### 数据抓取 (Data Extraction)\n\n- `elementIsTable` - 判断元素是否为表格\n- `tableDataBatch` - 批量抓取表格数据\n- `tableColumnDataBatch` - 批量抓取表格单列数据\n- `tableHeaderBatch` - 批量抓取表头数据\n- `similarBatch` - 批量抓取相似元素数据\n- `simalarListBatch` - 批量抓取相似元素列表\n- `highLightColumn` - 高亮列\n- `getBatchData` - 获取批量数据\n- `scrollWindow` - 滚动窗口\n- `elementShot` - 元素截图\n- `getTableData` - 获取表格数据\n\n#### JavaScript 执行 (JavaScript Execution)\n\n- `runJS` - 注入并执行 JavaScript 代码\n\n#### Cookie 操作 (Cookie Operations)\n\n- `getCookie` - 获取 cookie\n- `setCookies` - 设置 cookie\n- `removeCookie` - 删除 cookie\n\n#### 调试器控制 (Debugger Control)\n\n- `startDebugger` - 启动调试器\n- `stopDebugger` - 停止调试器\n\n#### 网络监听 (Network Monitoring)\n\n- `getRequestInterceptionFilters` - 获取请求拦截过滤器\n- `setRequestInterceptionFilters` - 设置请求拦截过滤器\n- `addRequestInterceptionFilter` - 添加请求拦截过滤器\n- `removeRequestInterceptionFilter` - 移除请求拦截过滤器\n- `startDebugNetworkListen` - 启动网络监听\n- `stopDebugNetworkListen` - 停止网络监听\n- `getDebugNetworkData` - 获取网络监听数据\n- `clearDebugNetworkData` - 清除网络监听数据\n\n#### 其他操作 (Other Operations)\n\n- `currentExtension` - 获取插件信息\n- `backgroundInject` - 后台注入检查 `deprecated`\n- `contentInject` - 内容注入检查 `deprecated`\n\n### 3.2 响应格式\n\n- **返回体:application/json**\n\n```json\n{\n  \"code\": \"0000\", // background code \n  \"msg\": \"ok\",\n  \"data\": {\n    \"code\": \"0000\", // content code \n    \"data\": {\n      \"matchTypes\": [],\n      \"checkType\": \"visualization\",\n      \"xpath\": \"//textarea[@id=\\\"APjFqb\\\"]\",\n      \"cssSelector\": \"#APjFqb\",\n      \"pathDirs\": [\n        {\n          \"tag\": \"textarea\",\n          \"checked\": true,\n          \"value\": \"textarea\",\n          \"attrs\": [\n            {\n              \"name\": \"id\",\n              \"value\": \"APjFqb\",\n              \"checked\": true,\n              \"type\": 0\n            },\n            {\n              \"name\": \"class\",\n              \"value\": \"gLFyf\",\n              \"checked\": false,\n              \"type\": 1\n            },\n            {\n              \"name\": \"title\",\n              \"value\": \"Google 搜索\",\n              \"checked\": false,\n              \"type\": 0\n            }\n          ]\n        }\n      ],\n      \"rect\": {\n        \"left\": 594,\n        \"top\": 268,\n        \"width\": 672,\n        \"height\": 75,\n        \"right\": 1265,\n        \"bottom\": 343,\n        \"x\": 594,\n        \"y\": 268\n      },\n      \"url\": \"https://www.google.com.hk/\",\n      \"shadowRoot\": false,\n      \"tag\": \"输入域\",\n      \"text\": \"unknown\",\n      \"tabTitle\": \"Google\",\n      \"tabUrl\": \"https://www.google.com.hk/\",\n      \"isFrame\": false,\n      \"frameId\": 0\n    },\n    \"msg\": \"success\"\n  }\n}\n```\n\n### 3.3 API 使用示例\n\n#### Tab 页操作示例\n\n```json\n// 获取活跃标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getActiveTab\"\n}\n\n// 打开新标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://www.baidu.com/\" },\n    \"key\": \"openNewTab\"\n}\n\n// 获取标签页 URL\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getUrl\"\n}\n\n// 获取标签页 title\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getTitle\"\n}\n\n// 刷新标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"reloadTab\"\n}\n\n// 停止加载\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"stopLoad\"\n}\n\n// 最大化窗口\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"maxWindow\"\n}\n\n// 最小化窗口\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"minWindow\"\n}\n\n// 后退\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"backward\"\n}\n\n// 前进\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"forward\"\n}\n\n// 关闭标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://developer.mozilla.org/zh-CN/plus\" },\n    \"key\": \"closeTab\"\n}\n\n// 切换到指定标签页（通过URL）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://developer.mozilla.org/zh-CN/plus\" },\n    \"key\": \"switchTab\"\n}\n\n// 切换到指定标签页（通过标题）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"title\": \"MDN Plus\" },\n    \"key\": \"switchTab\"\n}\n\n// 更新标签页 URL\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://www.abc.com\" },\n    \"key\": \"updateTab\"\n}\n\n// 网页可视区域截图\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"captureScreen\"\n}\n\n// 截取全部网页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"capturePage\"\n}\n\n// 页面是否加载完成\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"loadComplete\"\n}\n\n// 获取所有帧\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getFrames\"\n}\n\n// 获取帧树\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getFrameTree\"\n}\n\n// 重置缩放\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"resetZoom\"\n}\n\n// 打印页面\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"orientation\": \"portrait\",\n        \"margins\": { \"left\": 0, \"top\": 0, \"right\": 0, \"bottom\": 0 }\n    },\n    \"key\": \"printPage\"\n}\n```\n\n#### JavaScript 执行示例\n\n```json\n// 注入并执行 JavaScript\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"code\": \"console.log(1);return 1\",\n        \"url\": \"http://192.168.56.1:9010/aa/2.html?a=1\",\n        \"tabUrl\": \"http://192.168.56.1:9010/1.html\",\n        \"iframeXpath\": \"html/body/div[1]/iframe/html/body/div/button\",\n        \"isFrame\": true\n    },\n    \"key\": \"runJS\"\n}\n```\n\n#### 元素选择和获取示例\n\n```json\n// 获取元素信息\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"x\": 854, \"y\": 314 },\n    \"key\": \"getElement\"\n}\n\n// 获取元素绝对位置\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div/div/div[3]\",\n        \"cssSelector\": \"#app>div.arrange>div:nth-child(1)>div:nth-child(3)\"\n    },\n    \"key\": \"getElementPos\"\n}\n\n// 校验元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"checkElement\"\n}\n\n// 滚动元素到可视区域\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"scrollIntoView\"\n}\n\n// 等待元素渲染\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"elementIsRender\"\n}\n\n// 元素是否准备好（包含页面状态）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"container\\\"]/div[3]/div[2]/div/div[2]/div[1]/p[23]\",\n        \"cssSelector\": \"p:nth-child(23)\"\n    },\n    \"key\": \"elementIsReady\"\n}\n\n// 获取元素 HTML\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"x\": 0, \"y\": 0 },\n    \"key\": \"getOuterHTML\"\n}\n\n// 获取相似元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//ul[@id=\\\"hotsearch-content-wrapper\\\"]/li[2]/a/span[2]\",\n        \"cssSelector\": \"#hotsearch-content-wrapper>li:nth-child(2)>a:nth-child(1)>span:nth-child(4)\"\n    },\n    \"key\": \"similarElement\"\n}\n\n// 通过选择条件获取元素信息\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/div[1]/div[1]/section[5]/section[1]/div/div/button/span\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div>div:nth-child(2)>section:nth-child(1)>article>div:nth-child(3)>div:nth-child(1)>section:nth-child(5)>section:nth-child(1)>div>div>button>span\"\n    },\n    \"key\": \"elementFromSelect\"\n}\n\n// 获取父元素（扩大选区）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"spa-mount-point\\\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div/div\",\n        \"cssSelector\": \"#spa-mount-point>div>div.ent-resource>div>div.ent-resource-main>div.ent-resource-body>div.branch-tabs-wrap>div.tabs-container>div.branch-tabs>div.el-tabs__header>div>div\"\n    },\n    \"key\": \"getParentElement\"\n}\n\n// 获取子元素（缩小选区）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"spa-mount-point\\\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div/div\",\n        \"cssSelector\": \"#spa-mount-point>div>div.ent-resource>div>div.ent-resource-main>div.ent-resource-body>div.branch-tabs-wrap>div.tabs-container>div.branch-tabs>div.el-tabs__header>div>div\",\n        \"originXpath\": \"/html/body/div/section/section/main/div/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div/div\"\n    },\n    \"key\": \"getChildElement\"\n}\n\n// 通过 xpath/cssSelector/text 生成元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"type\": \"xpath\",\n        \"value\": \"//div\",\n        \"returnType\": \"single\"\n    },\n    \"key\": \"generateElement\"\n}\n\n// 获取关联元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"element\\\"]\",\n        \"relativeOptions\": {\n            \"relativeType\": \"child\",\n            \"elementGetType\": \"index\",\n            \"index\": 1\n        }\n    },\n    \"key\": \"getRelativeElement\"\n}\n\n// 相似元素迭代\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"index\": 0,\n        \"count\": 5,\n        \"xpath\": \"//nav[@id=\\\"nav\\\"]/ul/li[24]/ul/li/a\",\n        \"cssSelector\": \"#nav>ul>li:nth-child(24)>ul>li>a\"\n    },\n    \"key\": \"getSimilarIterator\"\n}\n```\n\n#### 元素属性操作示例\n\n```json\n// 获取元素文本\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"getElementText\"\n}\n\n// 获取元素属性\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"getElementAttrs\"\n}\n\n// 设置元素属性\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\",\n        \"attrName\": \"data-value\",\n        \"attrValue\": \"test\"\n    },\n    \"key\": \"setElementAttr\"\n}\n\n// 移除元素属性\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\",\n        \"attrName\": \"data-value\"\n    },\n    \"key\": \"removeElementAttr\"\n}\n\n// 获取 checked 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//input[@id=\\\"checkbox\\\"]\",\n        \"cssSelector\": \"#checkbox\"\n    },\n    \"key\": \"getElementChecked\"\n}\n\n// 设置 checked 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//input[@id=\\\"checkbox\\\"]\",\n        \"cssSelector\": \"#checkbox\",\n        \"checked\": true\n    },\n    \"key\": \"setElementChecked\"\n}\n\n// 获取 selected 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//option[@value=\\\"option1\\\"]\",\n        \"cssSelector\": \"option[value='option1']\"\n    },\n    \"key\": \"getElementSelected\"\n}\n\n// 设置 selected 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//option[@value=\\\"option1\\\"]\",\n        \"cssSelector\": \"option[value='option1']\",\n        \"selected\": true\n    },\n    \"key\": \"setElementSelected\"\n}\n```\n\n#### 元素交互示例\n\n```json\n// 点击元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//button[@id=\\\"submit\\\"]\",\n        \"cssSelector\": \"#submit\"\n    },\n    \"key\": \"clickElement\"\n}\n\n// 输入内容\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//input[@id=\\\"username\\\"]\",\n        \"cssSelector\": \"#username\",\n        \"text\": \"test_input\"\n    },\n    \"key\": \"inputElement\"\n}\n```\n\n#### Cookie 操作示例\n\n```json\n// 获取 Cookie\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"url\": \"http://localhost:1420/\",\n        \"name\": \"JSESSIONID\"\n    },\n    \"key\": \"getCookie\"\n}\n\n// 设置 Cookie\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"url\": \"http://localhost:1420/\",\n        \"name\": \"JSESSIONID\",\n        \"value\": \"123\"\n    },\n    \"key\": \"setCookies\"\n}\n\n// 删除 Cookie\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"url\": \"http://localhost:1420/\",\n        \"name\": \"JSESSIONID\"\n    },\n    \"key\": \"removeCookie\"\n}\n```\n\n#### 数据抓取示例\n\n```json\n// 判断元素是否为表格\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//table[@id=\\\"dataTable\\\"]\",\n        \"cssSelector\": \"#dataTable\"\n    },\n    \"key\": \"elementIsTable\"\n}\n\n// 批量抓取表格数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/section[3]/table[1]/tbody/tr[5]/td[1]\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div.ant-row.css-9loccf>div:nth-child(2)>section:nth-child(1)>article>section:nth-child(4)>table:nth-child(4)>tbody>tr:nth-child(5)>td:nth-child(1)\"\n    },\n    \"key\": \"tableDataBatch\"\n}\n\n// 批量抓取表格单列数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/section[3]/table[1]/tbody/tr[5]/td[1]\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div.ant-row.css-9loccf>div:nth-child(2)>section:nth-child(1)>article>section:nth-child(4)>table:nth-child(4)>tbody>tr:nth-child(5)>td:nth-child(1)\"\n    },\n    \"key\": \"tableColumnDataBatch\"\n}\n\n// 批量抓取相似元素数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/section[3]/table[1]/tbody/tr[5]/td[1]\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div.ant-row.css-9loccf>div:nth-child(2)>section:nth-child(1)>article>section:nth-child(4)>table:nth-child(4)>tbody>tr:nth-child(5)>td:nth-child(1)\"\n    },\n    \"key\": \"similarBatch\"\n}\n\n// 元素截图\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"container\\\"]/div[3]/div[2]/div/div[2]/div[1]/p[23]\",\n        \"cssSelector\": \"p:nth-child(23)\"\n    },\n    \"key\": \"elementShot\"\n}\n\n// 滚动窗口\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"scrollX\": 0,\n        \"scrollY\": 100\n    },\n    \"key\": \"scrollWindow\"\n}\n```\n\n#### 调试器和网络监听示例\n\n```json\n// 启动调试器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"startDebugger\"\n}\n\n// 停止调试器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"stopDebugger\"\n}\n\n// 获取请求拦截过滤器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getRequestInterceptionFilters\"\n}\n\n// 设置请求拦截过滤器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"filters\": [\n            { \"urlPattern\": \".*\\\\.js$\", \"pathPattern\": \"static\" }\n        ]\n    },\n    \"key\": \"setRequestInterceptionFilters\"\n}\n\n// 启动网络监听\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"filters\": [\n            { \"urlPattern\": \".*api.*\", \"pathPattern\": \"\" }\n        ]\n    },\n    \"key\": \"startDebugNetworkListen\"\n}\n\n// 停止网络监听\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"stopDebugNetworkListen\"\n}\n\n// 获取网络监听数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getDebugNetworkData\"\n}\n\n// 清除网络监听数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"clearDebugNetworkData\"\n}\n```\n\n#### 其他操作示例\n\n```json\n// 获取插件信息\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"currentExtension\"\n}\n\n// 后台注入检查\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"backgroundInject\"\n}\n\n// 内容注入检查\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"contentInject\"\n}\n```\n\n## 4. 调用示例\n\n```\ncurl -X POST 'http://127.0.0.1:9082/browser/transition' -H 'User-Agent: Reqable/2.30.3' -H 'Content-Type: application/json' -d '{\n  \"browser_type\": \"<<bt>>\",\n  \"data\": {\n    \"x\": 0,\n    \"y\": 0\n  },\n  \"key\": \"getElement\"\n}'\n```\n\n## 5. 高级配置与集成\n\n针对市面常见浏览器，可自行适配对应的浏览器名称与token，一般为浏览器可执行文件的文件名称\n\n## 6. 注意事项\n\n- 插件通信依靠Astron RPA 客户端服务，请先打开Astron RPA 客户端\n- 插件通信依靠注册的token,token 会编码，例如Chrome 浏览器 token=`$chrome$`\n\n## 7. 常见问题解答\n\n- 不同浏览器使用插件执行时需要对应能力支持该浏览器。\n\n## 8. 附录\n\n- **错误码列表**：\n\n```\n  SUCCESS = '0000', // 成功\n  UNKNOWN_ERROR = '5001', // 未知异常\n  ELEMENT_NOT_FOUND = '5002', // 元素未找到\n  EXECUTE_ERROR = '5003', // 执行错误\n  VERSION_ERROR = '5004', // 版本错误\n```\n","frontend/packages/browser-plugin/tsconfig.node.json":"{\n  \"compilerOptions\": {\n    \"composite\": true,\n    \"skipLibCheck\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"allowSyntheticDefaultImports\": true\n  },\n  \"include\": [\"vite.config.mts\", \"manifest.ts\"]\n}\n","frontend/packages/browser-plugin/package.json":"{\n  \"name\": \"@rpa/extension\",\n  \"displayName\": \"RPA-Browser-Plugin\",\n  \"version\": \"5.2.12\",\n  \"description\": \"RPA browser plugin\",\n  \"homepage\": \"\",\n  \"type\": \"commonjs\",\n  \"keywords\": [],\n  \"license\": \"ISC\",\n  \"author\": \"\",\n  \"main\": \"background.js\",\n  \"scripts\": {\n    \"tsc\" : \"tsc --noEmit\",\n    \"test\": \"vitest\",\n    \"build\": \"cross-env BUILD_ENTRY=background vite build && cross-env BUILD_ENTRY=content vite build\",\n    \"build:firefox\": \"cross-env BUILD_ENTRY=background vite build --mode=firefox && cross-env BUILD_ENTRY=content vite build --mode=firefox\",\n    \"build:chromium\": \"cross-env BUILD_ENTRY=background vite build --mode=chromium && cross-env BUILD_ENTRY=content vite build --mode=chromium\",\n    \"test:browser\": \"vitest --config=vitest.browser.config.js\",\n    \"coverage\": \"vitest --config=vitest.browser.config.js run --coverage\",\n    \"build:all\": \"npm run build && npm run build:firefox && npm run build:chromium\",\n    \"lint:fix\": \"eslint --fix \\\"**/*.{ts,js}\\\"\"\n  },\n  \"devDependencies\": {\n    \"@babel/cli\": \"^7.25.6\",\n    \"@babel/core\": \"^7.25.2\",\n    \"@babel/preset-env\": \"^7.25.4\",\n    \"@types/archiver\": \"^6.0.3\",\n    \"@vitest/browser\": \"^3.2.4\",\n    \"@vitest/coverage-v8\": \"^3.2.4\",\n    \"ai-motion\": \"^0.4.8\",\n    \"archiver\": \"^7.0.1\",\n    \"chrome-types\": \"^0.1.290\",\n    \"cross-env\": \"^7.0.3\",\n    \"jsdom\": \"^27.0.0\",\n    \"vite\": \"^5.4.21\",\n    \"vitest\": \"^3.2.4\"\n  }\n}\n","frontend/packages/browser-plugin/README.zh.md":"# 简体中文 | [English](./README.md)\n\n# 仓库说明\n\n本仓库为RPA浏览器插件仓库，处理网页相关自动化\n\n# 打包说明\n\n- 打包命令：`npm run build` 即可打包 Chrome/Edge 浏览器通用插件\n- npm run build:`browser` 为打包成对应浏览器的插件，可以是任何Chromium/Firefox 内核的变体浏览器，只需要在`src/3rd/rpa_websocket.js` 中设置 custom_agent，`package.json` 中添加命令即可，`browser` 为该浏览器可执行文件的文件名\n- node 版本说明：v20+\n\n# 部分功能说明\n\n## 1. 插件深度搜索功能\n\n需要悬浮鼠标5秒以上，才能触发深度搜索，深度搜索旨在解决一部分元素遮挡的问题，但有些未遮挡的元素，深度搜索后会导致元素并非是用户想要的元素，所以不是所有的元素都需要触发深度搜索\n\n### 实现方式：\n\n通过获取鼠标 x,y 下所有的元素 `document.elementsFromPoint(x, y)` 来获取元素后，通过每个元素的 left, top, right, bottom 距离 target (x, y) 找到最近的一个元素，若存在多个结果，取第一项。\n\n### 插件 shadowRoot 递归获取元素功能,\n\n具体查看 `shadowRootElement` 函数，递归查找元素是否是 shadowRoot 元素，若是，则继续查找 shadowRoot 下元素，直到找到普通元素，中间拼接 `$shadow$`，方便用户识别元素路径, 通过path获取元素时，也会识别到 `$shadow$`，并经函数 `getElementBySelector`找到目标元素， shadowRoot 元素暂时只支持 css 选择器获取，不支持xpath选择器获取。\n\n### frame 定位功能\n\n#### 跨域/同源iframe 元素位置统一处理办法\n\n#### 1. 跨域iframe元素位置统一处理办法\n\n说明：在跨域iframe元素中，由于同源策略的限制，以及存在iframe 的src 固定，iframe 的url 是会变动的，以及同一个tab下可能存在一摸一样src 的iframe , 通过src 查找所要的iframe 是不准确的。\n解决方法：通过插件主进程获取到iframe 的嵌套关系， parentFrameId , 得到一个嵌套关系的顺序，让后通过传入的 x,y 坐标，通过嵌套关系顺序，逐层查找，x, y 也会逐层减去 iframe 的位置，以及iframe的盒模型borderLeft, paddingLeft 得到准确的iframe content 的位置。\n详细见 getIframeElement 这个函数在backgroundInject 和contentInject 的处理\n\n#### 2. 同源iframe元素位置统一处理办法\n\n说明： 同上，虽然同源限制更小，但是按同一套方法处理，可以避免冗余，减少变量，减少出错。\n\n#### 3. iframe元素定位处理办法\n\n说明：再content中，会标记当前窗口下的所有frame 元素，并通过iframe.contentWindow.postMessage将iframe 的xpath 路径传给对应的iframe, 对应的iframe 中通过window.addEventListener('message', function(e) { }) 接收xpath 路径, 并传给主进程，这时就可以绑定iframe 的xpath 路径和iframe 的id。这样就可以按照 id 的嵌套关系来得到一个总的iframe 的 path 全路径，通过iframeXpath 这个字段即可定位到对应的iframe 以及iframe中的目标元素。\n\n#### 4. 注意\n\niframeXpath 与其他元素定位逻辑相同，统一查找逻辑，也存在动态性问题。\n\n# 构建crx/xpi 包说明\n\n### Chrome\n\n1. chrome 可以选择构建crx 插件包，推荐使用chrome developer dashboard 发布到chrome 插件商店，chrome 开发者账户需要收费，若不发布到插件商店，会被chrome 浏览器的限制启用，需要在安装插件时写入chrome://policy 政策   `ExtensionInstallAllowlist `  Windows 以注册表的方式 `Software\\Policies\\Google\\Chrome\\ExtensionInstallAllowlist` 写入白名单，Linux 写入方式  `/etc/opt/chrome/policies/managed/policy.json  ` 详细可见 [https://chromeenterprise.google/policies/?policy=ExtensionInstallAllowlist]()\n2. 不发布的打包方式：打开chrome浏览器，进入chrome://extensions/ 页， 启用开发者模式，选择打包扩展程序，浏览扩展程序根目录，第一次私钥文件可以不填，然后打包扩展程序，在扩展程序根目录就会生成一个对应的.crx 文件 和 .pem 密钥文件，.pem文件后续在更新插件包的时候需要使用，同一个密钥文件就会生成一样的插件id， 用于更新插件。\n\n### Firefox\n\n1. firefox 可以免费自行申请一个开发者账户，上传打包自己的插件xpi 文件，可以不发布，直接下载下xpi 文件亦可以安装。\n2. firefox 插件请自行打包，使用自己的开发者账户上传，构建自己的xpi 文件\n","frontend/packages/browser-plugin/tsconfig.json":"{\n  \"compilerOptions\": {\n    \"target\": \"ES2023\",\n    \"types\": [\"chrome-types/_all.d.ts\"],\n    \"allowJs\": true,\n    \"rootDir\": \"src\",\n    \"outDir\": \"dist\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"noImplicitAny\": false,\n    \"strict\": false\n  },\n  \"include\": [\"src/*\", \"src/**/*\"],\n  \"exclude\": [\"node_modules\", \"dist\", \"src/3rd/*\", \"\"],\n  \"references\": [{ \"path\": \"./tsconfig.node.json\" }]\n}\n","frontend/packages/cli/README.md":"# cli Documentation\n\nPath: `frontend/packages/cli/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/README.md)","frontend/packages/cli/README.zh-CN.md":"# Cli Skill\n\nPath: `frontend/packages/cli/README.zh-CN.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/README.zh-CN.md)","frontend/packages/cli/package.json":"# Cli Skill\n\nPath: `frontend/packages/cli/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/package.json)","frontend/packages/cli/tsconfig.json":"# Cli Skill\n\nPath: `frontend/packages/cli/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/tsconfig.json)","frontend/packages/components/README.md":"# components Documentation\n\nPath: `frontend/packages/components/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/README.md)","frontend/packages/components/package.json":"# Components Skill\n\nPath: `frontend/packages/components/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/package.json)","frontend/packages/components/tsconfig.json":"# Components Skill\n\nPath: `frontend/packages/components/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/tsconfig.json)","frontend/packages/electron-app/README.md":"# electron-app Documentation\n\nPath: `frontend/packages/electron-app/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/README.md)","frontend/packages/electron-app/electron-builder.json":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/electron-builder.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/electron-builder.json)","frontend/packages/electron-app/package.json":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/package.json)","frontend/packages/electron-app/tsconfig.json":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.json)","frontend/packages/electron-app/tsconfig.node.json":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/tsconfig.node.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.node.json)","frontend/packages/electron-app/tsconfig.web.json":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/tsconfig.web.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.web.json)","frontend/packages/shared/package.json":"# Shared Skill\n\nPath: `frontend/packages/shared/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/shared/package.json)","frontend/packages/shared/tsconfig.json":"# Shared Skill\n\nPath: `frontend/packages/shared/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/shared/tsconfig.json)","frontend/packages/web-app/package.json":"# Web-app Skill\n\nPath: `frontend/packages/web-app/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/package.json)","frontend/packages/web-app/tsconfig.json":"# Web-app Skill\n\nPath: `frontend/packages/web-app/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/tsconfig.json)","frontend/packages/web-app/tsconfig.node.json":"# Web-app Skill\n\nPath: `frontend/packages/web-app/tsconfig.node.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/tsconfig.node.json)","frontend/packages/browser-plugin/public/manifest.json":"# Public Skill\n\nPath: `frontend/packages/browser-plugin/public/manifest.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/browser-plugin/public/manifest.json)","frontend/packages/components/lib/cdn-info.json":"# Lib Skill\n\nPath: `frontend/packages/components/lib/cdn-info.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/lib/cdn-info.json)","frontend/packages/cli/templates/template-vue/package.json":"# Template-vue Skill\n\nPath: `frontend/packages/cli/templates/template-vue/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/templates/template-vue/package.json)","frontend/packages/cli/templates/template-vue/tsconfig.json":"# Template-vue Skill\n\nPath: `frontend/packages/cli/templates/template-vue/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/templates/template-vue/tsconfig.json)","engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json":"# Plugins Skill\n\nPath: `engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json)","frontend/packages/components/src/components/Sheet/luckyexcel/README.md":"# luckyexcel Documentation\n\nPath: `frontend/packages/components/src/components/Sheet/luckyexcel/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/src/components/Sheet/luckyexcel/README.md)","engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json":"# Chromium-extension Skill\n\nPath: `engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json)"},"files":{"frontend/packages/auth-app/package.json":"{\n  \"name\": \"@rpa/auth-app\",\n  \"private\": true,\n  \"version\": \"0.0.0\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"vite\",\n    \"build\": \"vue-tsc -b && vite build\",\n    \"preview\": \"vite preview\"\n  },\n  \"dependencies\": {\n    \"@rpa/components\": \"workspace:*\",\n    \"@rpa/shared\": \"workspace:*\",\n    \"vue\": \"catalog:\"\n  },  \n  \"devDependencies\": {\n    \"@types/node\": \"^24.10.0\",\n    \"@vitejs/plugin-vue\": \"catalog:\",\n    \"@vitejs/plugin-vue-jsx\": \"catalog:\",\n    \"vite-plugin-svg4vue\": \"^4.5.1\",\n    \"@vue/tsconfig\": \"^0.8.1\",\n    \"tailwindcss\": \"^3.4.4\",\n    \"typescript\": \"~5.9.3\",\n    \"vite\": \"catalog:\",\n    \"vue-tsc\": \"^3.1.3\"\n  }\n}\n","frontend/packages/auth-app/tsconfig.node.json":"{\n  \"compilerOptions\": {\n    \"tsBuildInfoFile\": \"./node_modules/.tmp/tsconfig.node.tsbuildinfo\",\n    \"target\": \"ES2023\",\n    \"lib\": [\"ES2023\"],\n    \"module\": \"ESNext\",\n    \"types\": [\"node\"],\n    \"skipLibCheck\": true,\n\n    /* Bundler mode */\n    \"moduleResolution\": \"bundler\",\n    \"allowImportingTsExtensions\": true,\n    \"verbatimModuleSyntax\": true,\n    \"moduleDetection\": \"force\",\n    \"noEmit\": true,\n\n    /* Linting */\n    \"strict\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"erasableSyntaxOnly\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"noUncheckedSideEffectImports\": true\n  },\n  \"include\": [\"vite.config.ts\"]\n}\n","AGENTS.md":"# AGENTS.md\n\nGuidance for AI coding agents working in the **astron-rpa** (AstronRPA)\nrepository — an agent-ready RPA suite with out-of-the-box automation tools for\ndesktop applications, web systems, and business-process automation.\n\nAstronRPA uses a **server–client** architecture: server components run via\nDocker, and the client (RPA engine + desktop app) is packaged and run on the\nmachine that executes RPA tasks. The client toolchain is Windows-first.\n\n## Project layout\n\nThis is a multi-language monorepo driven by a unified `Makefile` (with modular\nincludes under `makefiles/`).\n\n- `backend/` — server-side microservices (deployed via Docker Compose):\n  - `robot-service/`, `resource-service/`, `rpa-auth/` — Java / Spring Boot\n    services (Maven; each ships `checkstyle.xml`, `pmd-ruleset.xml`,\n    `spotbugs-exclude.xml`).\n  - `ai-service/`, `openapi-service/` — Python services (managed with `uv`).\n- `engine/` — the Python RPA execution engine (managed with `uv`, linted with\n  `ruff`): `main.py`, `components/` (RPA components), `servers/`, `shared/`.\n- `frontend/` — pnpm workspace monorepo (Vue 3 + TypeScript, Vitest, ESLint,\n  i18n under `locales/`). Notable packages under `frontend/packages/`:\n  `electron-app` (desktop client), `web-app` (web console), `browser-plugin`,\n  `auth-app`, `cli`, `components`, `shared`.\n- `docker/` — Docker Compose manifests for the server stack.\n- `makefiles/` — modular Make components (`common.mk`, `python.mk`, `java.mk`,\n  `typescript.mk`, `go.mk`, `git.mk`).\n- `resources/` — packaged client resources. `docs/`, `FAQ.md`, `BUILD_GUIDE.md`\n  — documentation.\n\n## Toolchain\n\n- **Python 3.13.x** + **uv 0.8+** — RPA engine and Python services.\n- **Node.js 22+** + **pnpm 9+** — frontend workspace.\n- **Java JDK 8+** + **Maven** — Java backend services.\n- **Docker & Docker Compose** — server deployment.\n- Windows client packaging also needs **SWIG** (Python↔C/C++ bindings, e.g.\n  `pywinhook`) and **7-Zip** (deployment archives). See `BUILD_GUIDE.md`.\n\n## Common commands\n\nQuality and git workflow are driven by the root `Makefile` (run `make help` to\nsee detected projects and targets):\n\n- `make install-tools` — install the formatting/linting toolchain.\n- `make fmt` — format across languages (`fmt-python`, `fmt-java`, `fmt-ts`, …).\n- `make check` (alias `make lint`) — format check + linters\n  (`check-python`, `check-java`, `check-ts`, …). CI is check-only; it does not\n  auto-fix.\n- `make new-feature name=<short-name>` / `make new-bugfix name=<short-name>` —\n  branch helpers following the project's branch strategy.\n\nPre-commit hooks (install with `pre-commit install`) format the engine with\nruff: `uv run --project engine --dev ruff format ./engine`.\n\n### Run the server (Docker)\n\n```bash\ncd docker\ncp .env.example .env\n# configure the public HTTPS names and copy the certificate/key to docker/certs/\n# see docker/HTTPS_DEPLOYMENT.md for required variables\ndocker compose up -d mysql casdoor\n# wait for Casdoor initialization, then synchronize this deployment's credentials\npython3 scripts/sync-casdoor-credentials.py\ndocker compose up -d\ndocker compose ps\n```\n\nGateway API: https://localhost · Casdoor auth: https://localhost:8443\n\n### Build the client (Windows)\n\n```bash\n# full build (engine + frontend desktop app) from the repo root\n./build.bat --python-exe \"C:\\Program Files\\Python313\\python.exe\"\n./build.bat --skip-frontend   # engine only\n./build.bat --skip-engine     # frontend only\n```\n\nThe packaged installer is written to `frontend/packages/electron-app/dist/`.\n\n### Frontend (pnpm workspace, from `frontend/`)\n\n```bash\npnpm install\npnpm dev:web         # run the web console in dev\npnpm dev:desktop     # run the desktop app in dev\npnpm build:desktop   # build the Windows desktop app\n```\n\n## Testing instructions\n\nThere is no aggregate `make test`; run tests per component:\n\n- **Frontend**: `pnpm test` (Vitest) or `pnpm test:run` for a single run.\n- **Python** (`engine`, `backend/ai-service`, `backend/openapi-service`):\n  `uv run pytest` within the project where tests exist (e.g. `backend/ai-service`\n  has a `tests/` directory).\n- **Java** (`backend/robot-service`, `resource-service`, `rpa-auth`):\n  `mvn test` within the service directory.\n\nRun `make check` and the relevant tests before opening a PR, and add or update\ntests for code you change.\n\n## Code style\n\nFormatting and linting are wired through `make fmt` / `make check`:\n\n| Language        | Format / Lint                                                        |\n| --------------- | -------------------------------------------------------------------- |\n| Python          | `ruff` format + `ruff` check (see `engine/.ruff.toml`)               |\n| Java            | Checkstyle + PMD + SpotBugs (per-service configs)                     |\n| TypeScript/Vue  | ESLint (`frontend/eslint.config.mjs`); `pnpm lint` / `pnpm lint:fix` |\n\n## PR instructions\n\n- Create branches with the Make helpers (`make new-feature name=<…>`).\n- Run `make check` and the relevant component tests before committing; make sure\n  pre-commit hooks pass.\n- Keep PRs focused and write clear, conventional commit messages.\n- For build and deployment details, see `BUILD_GUIDE.md`.\n","frontend/packages/auth-app/tsconfig.json":"{\n  \"files\": [],\n  \"references\": [\n    { \"path\": \"./tsconfig.app.json\" },\n    { \"path\": \"./tsconfig.node.json\" }\n  ]\n}\n","frontend/packages/auth-app/tsconfig.app.json":"{\n  \"extends\": \"@vue/tsconfig/tsconfig.dom.json\",\n  \"compilerOptions\": {\n    \"tsBuildInfoFile\": \"./node_modules/.tmp/tsconfig.app.tsbuildinfo\",\n    \"types\": [\"vite/client\"],\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"@/*\": [\"./src/*\"]\n    },\n\n    /* Linting */\n    \"strict\": true,\n    \"noUnusedLocals\": false,\n    \"noUnusedParameters\": false,\n    \"erasableSyntaxOnly\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"noUncheckedSideEffectImports\": true\n  },\n  \"include\": [\"src/**/*.ts\", \"src/**/*.tsx\", \"src/**/*.vue\", \"../components/src/components/LaunchCarousel/LaunchCarousel.vue\", \"../components/src/components/LaunchCarousel/launch.ts\"]\n}\n","frontend/packages/auth-app/README.md":"# Vue 3 + TypeScript + Vite\n\nThis template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.\n\nLearn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).\n","frontend/packages/browser-plugin/README.md":"# English | [简体中文](./README.zh.md)\n\n# Repository Description\n\nThis repository is for the RPA browser plugin, which handles web-related automation.\n\n# Build Instructions\n\n- Build command: `npm run build` to package the universal extension for Chrome/Edge browsers\n- `npm run build:browser` is used to package the plugin for a specific browser. It supports any Chromium/Firefox-based browser variant. You only need to set `custom_agent` in `src/3rd/rpa_websocket.js` and add the corresponding command in `package.json`. The `browser` refers to the executable file name of the target browser.\n- Node version requirement: v20+\n\n# Feature Overview\n\n## 1. Deep Search Feature\n\nTo trigger deep search, you need to hover the mouse for more than 5 seconds. Deep search is designed to solve the problem of some elements being covered. However, for some uncovered elements, deep search may result in selecting an element that is not the one the user wants, so not all elements require deep search.\n\n### Implementation:\n\nBy using `document.elementsFromPoint(x, y)` to get all elements under the mouse coordinates (x, y), then for each element, calculate the distance from its left, top, right, and bottom to the target (x, y), and find the closest element. If there are multiple results, take the first one.\n\n### Recursive shadowRoot Element Retrieval\n\nSee the `shadowRootElement` function for details. It recursively checks if an element is a shadowRoot element. If so, it continues to search within the shadowRoot until a normal element is found. The path is concatenated with `$shadow$` for easy identification. When retrieving elements by path, `$shadow$` is also recognized, and the function `getElementBySelector` is used to find the target element. Currently, shadowRoot elements only support CSS selectors, not XPath selectors.\n\n### Frame Positioning Feature\n\n#### Unified Handling for Cross-origin/Same-origin iframe Elements\n\n##### 1. Cross-origin iframe Handling\n\nIn cross-origin iframes, due to the same-origin policy and the fact that iframe src can be fixed but the URL may change, and there may be identical src iframes in the same tab, finding the desired iframe by src is inaccurate. The solution is to obtain the nesting relationship (parentFrameId) from the plugin's main process, get the nesting order, and then, by passing the x, y coordinates and the nesting order, search layer by layer. The x, y coordinates are also reduced layer by layer by the iframe's position and box model (borderLeft, paddingLeft) to get the accurate position in the iframe content. See the `getIframeElement` function in backgroundInject and contentInject for details.\n\n##### 2. Same-origin iframe Handling\n\nSame as above. Although the same-origin restriction is less strict, using the same method avoids redundancy, reduces variables, and minimizes errors.\n\n##### 3. iframe Element Positioning\n\nIn content, all frame elements in the current window are marked, and the iframe's XPath is sent to the corresponding iframe via `iframe.contentWindow.postMessage`. The iframe receives the XPath via `window.addEventListener('message', function(e) { })` and sends it to the main process. This binds the iframe's XPath to its id. Thus, the full iframe path can be obtained according to the id nesting relationship, and the target element in the iframe can be located via the `iframeXpath` field.\n\n##### 4. Note\n\nThe logic for locating iframeXpath is the same as for other elements, and there are also dynamic issues.\n\n# Building crx/xpi Packages\n\n### Chrome\n\n1. Chrome can build crx plugin packages. It is recommended to use the Chrome Developer Dashboard to publish to the Chrome Web Store. A developer account is required (paid). If not published to the store, Chrome will restrict enabling the plugin. You need to add the plugin to the whitelist via the `chrome://policy` policy. On Windows, add to the registry at `Software\\Policies\\Google\\Chrome\\ExtensionInstallAllowlist`. On Linux, add to `/etc/opt/chrome/policies/managed/policy.json`. See [https://chromeenterprise.google/policies/?policy=ExtensionInstallAllowlist]() for details.\n2. For unpublished packaging: Open Chrome, go to chrome://extensions/, enable Developer Mode, select 'Pack extension', browse to the extension root directory. The first time, you can leave the private key file blank. After packing, a .crx file and a .pem key file will be generated in the root directory. The .pem file is needed for future updates. Using the same key file will generate the same plugin id for updates.\n\n### Firefox\n\n1. You can apply for a free developer account on Firefox, upload your packaged xpi file, and install it directly without publishing.\n2. Please package the Firefox extension yourself, upload it using your own developer account, and build your own XPI file.\n","frontend/packages/browser-plugin/API.md":"<!-- @format -->\n\n# Astron Browser Plugin API 文档\n\n## 1. 概述\n\n- **插件简介**：Astron Browser Plugin是Astron RPA 在web自动化的重要组成部分，为Astron RPA提供Chrome/Edge/Firefox 等浏览器提供网页自动化能力\n- **主要特性**：\n\n* 浏览器Tab 页操作\n* 网页元素操作\n* Cookie 操作\n* 脚本注入操作\n* iframe 操作\n\n- **版本信息**：5.2.11\n\n## 2. 快速开始\n\n- **安装**：npm run build 打包后使用浏览器插件管理加载插件\n- **基础配置**：Chrome 浏览器，node 环境推荐 node版本 v20+\n\n## 3. API 参考\n\n- **接口：http://127.0.0.1:{port}/browser/transition** 默认port: 9082\n- **类型：POST**\n- **请求体:application/json**\n\n```json\n{\n  \"browser_type\": \"chrome\", // firefox, edge ...\n  \"data\": {\n    \"x\": 854, \"y\": 314\n  },\n  \"key\": \"getElement\"\n}\n```\n\n### 3.1 支持的API列表\n\n#### Tab 页操作 (Tab Operations)\n\n- `reloadTab` - 刷新当前标签页\n- `stopLoad` - 停止加载\n- `openNewTab` - 打开新标签页\n- `closeTab` - 关闭标签页\n- `updateTab` - 更新标签页 URL\n- `activeTab` - 激活标签页\n- `getActiveTab` - 获取活跃标签页\n- `switchTab` - 切换到指定标签页\n- `getAllTabs` - 获取所有标签页\n- `backward` - 后退\n- `forward` - 前进\n- `maxWindow` - 最大化窗口\n- `minWindow` - 最小化窗口\n- `getTitle` - 获取标签页标题\n- `getUrl` - 获取标签页 URL\n- `captureScreen` - 网页可视区域截图\n- `capturePage` - 截取全部网页\n- `loadComplete` - 判断网页是否加载完成\n- `getFrames` - 获取所有帧\n- `getExtFrames` - 获取扩展帧\n- `resetZoom` - 重置缩放\n- `getTabId` - 获取标签页 ID\n- `getFrameTree` - 获取帧树\n- `printPage` - 打印页面\n\n#### 元素操作 (Element Operations)\n\n- `getElement` - 获取元素信息\n- `getElementPos` - 获取元素绝对位置\n- `checkElement` - 校验元素\n- `getOuterHTML` - 获取元素 HTML\n- `scrollIntoView` - 滚动到可视区域\n- `scrollToTop` - 滚动到顶部\n- `elementIsRender` - 等待元素渲染\n- `elementIsReady` - 元素是否准备好（包含页面状态）\n\n#### 元素属性操作 (Element Attribute Operations)\n\n- `getElementText` - 获取元素文本\n- `getElementAttrs` - 获取元素属性\n- `setElementAttr` - 设置元素属性\n- `removeElementAttr` - 移除元素属性\n- `getElementChecked` - 获取元素 checked 状态\n- `setElementChecked` - 设置元素 checked 状态\n- `getElementSelected` - 获取元素 selected 状态\n- `setElementSelected` - 设置元素 selected 状态\n\n#### 元素交互 (Element Interaction)\n\n- `clickElement` - 点击元素\n- `inputElement` - 输入内容\n\n#### 元素选择与导航 (Element Selection & Navigation)\n\n- `similarElement` - 获取相似元素\n- `elementFromSelect` - 通过选择条件获取元素\n- `getSimilarIterator` - 相似元素迭代\n- `getParentElement` - 获取父元素（扩大选区）\n- `getChildElement` - 获取子元素（缩小选区）\n- `getRelativeElement` - 获取关联元素（parent/sibling/child）\n- `generateElement` - 通过 xpath/cssSelector/text 生成元素\n\n#### 数据抓取 (Data Extraction)\n\n- `elementIsTable` - 判断元素是否为表格\n- `tableDataBatch` - 批量抓取表格数据\n- `tableColumnDataBatch` - 批量抓取表格单列数据\n- `tableHeaderBatch` - 批量抓取表头数据\n- `similarBatch` - 批量抓取相似元素数据\n- `simalarListBatch` - 批量抓取相似元素列表\n- `highLightColumn` - 高亮列\n- `getBatchData` - 获取批量数据\n- `scrollWindow` - 滚动窗口\n- `elementShot` - 元素截图\n- `getTableData` - 获取表格数据\n\n#### JavaScript 执行 (JavaScript Execution)\n\n- `runJS` - 注入并执行 JavaScript 代码\n\n#### Cookie 操作 (Cookie Operations)\n\n- `getCookie` - 获取 cookie\n- `setCookies` - 设置 cookie\n- `removeCookie` - 删除 cookie\n\n#### 调试器控制 (Debugger Control)\n\n- `startDebugger` - 启动调试器\n- `stopDebugger` - 停止调试器\n\n#### 网络监听 (Network Monitoring)\n\n- `getRequestInterceptionFilters` - 获取请求拦截过滤器\n- `setRequestInterceptionFilters` - 设置请求拦截过滤器\n- `addRequestInterceptionFilter` - 添加请求拦截过滤器\n- `removeRequestInterceptionFilter` - 移除请求拦截过滤器\n- `startDebugNetworkListen` - 启动网络监听\n- `stopDebugNetworkListen` - 停止网络监听\n- `getDebugNetworkData` - 获取网络监听数据\n- `clearDebugNetworkData` - 清除网络监听数据\n\n#### 其他操作 (Other Operations)\n\n- `currentExtension` - 获取插件信息\n- `backgroundInject` - 后台注入检查 `deprecated`\n- `contentInject` - 内容注入检查 `deprecated`\n\n### 3.2 响应格式\n\n- **返回体:application/json**\n\n```json\n{\n  \"code\": \"0000\", // background code \n  \"msg\": \"ok\",\n  \"data\": {\n    \"code\": \"0000\", // content code \n    \"data\": {\n      \"matchTypes\": [],\n      \"checkType\": \"visualization\",\n      \"xpath\": \"//textarea[@id=\\\"APjFqb\\\"]\",\n      \"cssSelector\": \"#APjFqb\",\n      \"pathDirs\": [\n        {\n          \"tag\": \"textarea\",\n          \"checked\": true,\n          \"value\": \"textarea\",\n          \"attrs\": [\n            {\n              \"name\": \"id\",\n              \"value\": \"APjFqb\",\n              \"checked\": true,\n              \"type\": 0\n            },\n            {\n              \"name\": \"class\",\n              \"value\": \"gLFyf\",\n              \"checked\": false,\n              \"type\": 1\n            },\n            {\n              \"name\": \"title\",\n              \"value\": \"Google 搜索\",\n              \"checked\": false,\n              \"type\": 0\n            }\n          ]\n        }\n      ],\n      \"rect\": {\n        \"left\": 594,\n        \"top\": 268,\n        \"width\": 672,\n        \"height\": 75,\n        \"right\": 1265,\n        \"bottom\": 343,\n        \"x\": 594,\n        \"y\": 268\n      },\n      \"url\": \"https://www.google.com.hk/\",\n      \"shadowRoot\": false,\n      \"tag\": \"输入域\",\n      \"text\": \"unknown\",\n      \"tabTitle\": \"Google\",\n      \"tabUrl\": \"https://www.google.com.hk/\",\n      \"isFrame\": false,\n      \"frameId\": 0\n    },\n    \"msg\": \"success\"\n  }\n}\n```\n\n### 3.3 API 使用示例\n\n#### Tab 页操作示例\n\n```json\n// 获取活跃标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getActiveTab\"\n}\n\n// 打开新标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://www.baidu.com/\" },\n    \"key\": \"openNewTab\"\n}\n\n// 获取标签页 URL\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getUrl\"\n}\n\n// 获取标签页 title\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getTitle\"\n}\n\n// 刷新标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"reloadTab\"\n}\n\n// 停止加载\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"stopLoad\"\n}\n\n// 最大化窗口\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"maxWindow\"\n}\n\n// 最小化窗口\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"minWindow\"\n}\n\n// 后退\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"backward\"\n}\n\n// 前进\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"forward\"\n}\n\n// 关闭标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://developer.mozilla.org/zh-CN/plus\" },\n    \"key\": \"closeTab\"\n}\n\n// 切换到指定标签页（通过URL）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://developer.mozilla.org/zh-CN/plus\" },\n    \"key\": \"switchTab\"\n}\n\n// 切换到指定标签页（通过标题）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"title\": \"MDN Plus\" },\n    \"key\": \"switchTab\"\n}\n\n// 更新标签页 URL\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://www.abc.com\" },\n    \"key\": \"updateTab\"\n}\n\n// 网页可视区域截图\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"captureScreen\"\n}\n\n// 截取全部网页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"capturePage\"\n}\n\n// 页面是否加载完成\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"loadComplete\"\n}\n\n// 获取所有帧\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getFrames\"\n}\n\n// 获取帧树\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getFrameTree\"\n}\n\n// 重置缩放\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"resetZoom\"\n}\n\n// 打印页面\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"orientation\": \"portrait\",\n        \"margins\": { \"left\": 0, \"top\": 0, \"right\": 0, \"bottom\": 0 }\n    },\n    \"key\": \"printPage\"\n}\n```\n\n#### JavaScript 执行示例\n\n```json\n// 注入并执行 JavaScript\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"code\": \"console.log(1);return 1\",\n        \"url\": \"http://192.168.56.1:9010/aa/2.html?a=1\",\n        \"tabUrl\": \"http://192.168.56.1:9010/1.html\",\n        \"iframeXpath\": \"html/body/div[1]/iframe/html/body/div/button\",\n        \"isFrame\": true\n    },\n    \"key\": \"runJS\"\n}\n```\n\n#### 元素选择和获取示例\n\n```json\n// 获取元素信息\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"x\": 854, \"y\": 314 },\n    \"key\": \"getElement\"\n}\n\n// 获取元素绝对位置\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div/div/div[3]\",\n        \"cssSelector\": \"#app>div.arrange>div:nth-child(1)>div:nth-child(3)\"\n    },\n    \"key\": \"getElementPos\"\n}\n\n// 校验元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"checkElement\"\n}\n\n// 滚动元素到可视区域\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"scrollIntoView\"\n}\n\n// 等待元素渲染\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"elementIsRender\"\n}\n\n// 元素是否准备好（包含页面状态）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"container\\\"]/div[3]/div[2]/div/div[2]/div[1]/p[23]\",\n        \"cssSelector\": \"p:nth-child(23)\"\n    },\n    \"key\": \"elementIsReady\"\n}\n\n// 获取元素 HTML\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"x\": 0, \"y\": 0 },\n    \"key\": \"getOuterHTML\"\n}\n\n// 获取相似元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//ul[@id=\\\"hotsearch-content-wrapper\\\"]/li[2]/a/span[2]\",\n        \"cssSelector\": \"#hotsearch-content-wrapper>li:nth-child(2)>a:nth-child(1)>span:nth-child(4)\"\n    },\n    \"key\": \"similarElement\"\n}\n\n// 通过选择条件获取元素信息\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/div[1]/div[1]/section[5]/section[1]/div/div/button/span\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div>div:nth-child(2)>section:nth-child(1)>article>div:nth-child(3)>div:nth-child(1)>section:nth-child(5)>section:nth-child(1)>div>div>button>span\"\n    },\n    \"key\": \"elementFromSelect\"\n}\n\n// 获取父元素（扩大选区）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"spa-mount-point\\\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div/div\",\n        \"cssSelector\": \"#spa-mount-point>div>div.ent-resource>div>div.ent-resource-main>div.ent-resource-body>div.branch-tabs-wrap>div.tabs-container>div.branch-tabs>div.el-tabs__header>div>div\"\n    },\n    \"key\": \"getParentElement\"\n}\n\n// 获取子元素（缩小选区）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"spa-mount-point\\\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div/div\",\n        \"cssSelector\": \"#spa-mount-point>div>div.ent-resource>div>div.ent-resource-main>div.ent-resource-body>div.branch-tabs-wrap>div.tabs-container>div.branch-tabs>div.el-tabs__header>div>div\",\n        \"originXpath\": \"/html/body/div/section/section/main/div/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div/div\"\n    },\n    \"key\": \"getChildElement\"\n}\n\n// 通过 xpath/cssSelector/text 生成元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"type\": \"xpath\",\n        \"value\": \"//div\",\n        \"returnType\": \"single\"\n    },\n    \"key\": \"generateElement\"\n}\n\n// 获取关联元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"element\\\"]\",\n        \"relativeOptions\": {\n            \"relativeType\": \"child\",\n            \"elementGetType\": \"index\",\n            \"index\": 1\n        }\n    },\n    \"key\": \"getRelativeElement\"\n}\n\n// 相似元素迭代\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"index\": 0,\n        \"count\": 5,\n        \"xpath\": \"//nav[@id=\\\"nav\\\"]/ul/li[24]/ul/li/a\",\n        \"cssSelector\": \"#nav>ul>li:nth-child(24)>ul>li>a\"\n    },\n    \"key\": \"getSimilarIterator\"\n}\n```\n\n#### 元素属性操作示例\n\n```json\n// 获取元素文本\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"getElementText\"\n}\n\n// 获取元素属性\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"getElementAttrs\"\n}\n\n// 设置元素属性\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\",\n        \"attrName\": \"data-value\",\n        \"attrValue\": \"test\"\n    },\n    \"key\": \"setElementAttr\"\n}\n\n// 移除元素属性\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\",\n        \"attrName\": \"data-value\"\n    },\n    \"key\": \"removeElementAttr\"\n}\n\n// 获取 checked 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//input[@id=\\\"checkbox\\\"]\",\n        \"cssSelector\": \"#checkbox\"\n    },\n    \"key\": \"getElementChecked\"\n}\n\n// 设置 checked 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//input[@id=\\\"checkbox\\\"]\",\n        \"cssSelector\": \"#checkbox\",\n        \"checked\": true\n    },\n    \"key\": \"setElementChecked\"\n}\n\n// 获取 selected 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//option[@value=\\\"option1\\\"]\",\n        \"cssSelector\": \"option[value='option1']\"\n    },\n    \"key\": \"getElementSelected\"\n}\n\n// 设置 selected 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//option[@value=\\\"option1\\\"]\",\n        \"cssSelector\": \"option[value='option1']\",\n        \"selected\": true\n    },\n    \"key\": \"setElementSelected\"\n}\n```\n\n#### 元素交互示例\n\n```json\n// 点击元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//button[@id=\\\"submit\\\"]\",\n        \"cssSelector\": \"#submit\"\n    },\n    \"key\": \"clickElement\"\n}\n\n// 输入内容\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//input[@id=\\\"username\\\"]\",\n        \"cssSelector\": \"#username\",\n        \"text\": \"test_input\"\n    },\n    \"key\": \"inputElement\"\n}\n```\n\n#### Cookie 操作示例\n\n```json\n// 获取 Cookie\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"url\": \"http://localhost:1420/\",\n        \"name\": \"JSESSIONID\"\n    },\n    \"key\": \"getCookie\"\n}\n\n// 设置 Cookie\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"url\": \"http://localhost:1420/\",\n        \"name\": \"JSESSIONID\",\n        \"value\": \"123\"\n    },\n    \"key\": \"setCookies\"\n}\n\n// 删除 Cookie\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"url\": \"http://localhost:1420/\",\n        \"name\": \"JSESSIONID\"\n    },\n    \"key\": \"removeCookie\"\n}\n```\n\n#### 数据抓取示例\n\n```json\n// 判断元素是否为表格\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//table[@id=\\\"dataTable\\\"]\",\n        \"cssSelector\": \"#dataTable\"\n    },\n    \"key\": \"elementIsTable\"\n}\n\n// 批量抓取表格数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/section[3]/table[1]/tbody/tr[5]/td[1]\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div.ant-row.css-9loccf>div:nth-child(2)>section:nth-child(1)>article>section:nth-child(4)>table:nth-child(4)>tbody>tr:nth-child(5)>td:nth-child(1)\"\n    },\n    \"key\": \"tableDataBatch\"\n}\n\n// 批量抓取表格单列数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/section[3]/table[1]/tbody/tr[5]/td[1]\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div.ant-row.css-9loccf>div:nth-child(2)>section:nth-child(1)>article>section:nth-child(4)>table:nth-child(4)>tbody>tr:nth-child(5)>td:nth-child(1)\"\n    },\n    \"key\": \"tableColumnDataBatch\"\n}\n\n// 批量抓取相似元素数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/section[3]/table[1]/tbody/tr[5]/td[1]\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div.ant-row.css-9loccf>div:nth-child(2)>section:nth-child(1)>article>section:nth-child(4)>table:nth-child(4)>tbody>tr:nth-child(5)>td:nth-child(1)\"\n    },\n    \"key\": \"similarBatch\"\n}\n\n// 元素截图\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"container\\\"]/div[3]/div[2]/div/div[2]/div[1]/p[23]\",\n        \"cssSelector\": \"p:nth-child(23)\"\n    },\n    \"key\": \"elementShot\"\n}\n\n// 滚动窗口\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"scrollX\": 0,\n        \"scrollY\": 100\n    },\n    \"key\": \"scrollWindow\"\n}\n```\n\n#### 调试器和网络监听示例\n\n```json\n// 启动调试器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"startDebugger\"\n}\n\n// 停止调试器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"stopDebugger\"\n}\n\n// 获取请求拦截过滤器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getRequestInterceptionFilters\"\n}\n\n// 设置请求拦截过滤器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"filters\": [\n            { \"urlPattern\": \".*\\\\.js$\", \"pathPattern\": \"static\" }\n        ]\n    },\n    \"key\": \"setRequestInterceptionFilters\"\n}\n\n// 启动网络监听\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"filters\": [\n            { \"urlPattern\": \".*api.*\", \"pathPattern\": \"\" }\n        ]\n    },\n    \"key\": \"startDebugNetworkListen\"\n}\n\n// 停止网络监听\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"stopDebugNetworkListen\"\n}\n\n// 获取网络监听数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getDebugNetworkData\"\n}\n\n// 清除网络监听数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"clearDebugNetworkData\"\n}\n```\n\n#### 其他操作示例\n\n```json\n// 获取插件信息\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"currentExtension\"\n}\n\n// 后台注入检查\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"backgroundInject\"\n}\n\n// 内容注入检查\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"contentInject\"\n}\n```\n\n## 4. 调用示例\n\n```\ncurl -X POST 'http://127.0.0.1:9082/browser/transition' -H 'User-Agent: Reqable/2.30.3' -H 'Content-Type: application/json' -d '{\n  \"browser_type\": \"<<bt>>\",\n  \"data\": {\n    \"x\": 0,\n    \"y\": 0\n  },\n  \"key\": \"getElement\"\n}'\n```\n\n## 5. 高级配置与集成\n\n针对市面常见浏览器，可自行适配对应的浏览器名称与token，一般为浏览器可执行文件的文件名称\n\n## 6. 注意事项\n\n- 插件通信依靠Astron RPA 客户端服务，请先打开Astron RPA 客户端\n- 插件通信依靠注册的token,token 会编码，例如Chrome 浏览器 token=`$chrome$`\n\n## 7. 常见问题解答\n\n- 不同浏览器使用插件执行时需要对应能力支持该浏览器。\n\n## 8. 附录\n\n- **错误码列表**：\n\n```\n  SUCCESS = '0000', // 成功\n  UNKNOWN_ERROR = '5001', // 未知异常\n  ELEMENT_NOT_FOUND = '5002', // 元素未找到\n  EXECUTE_ERROR = '5003', // 执行错误\n  VERSION_ERROR = '5004', // 版本错误\n```\n","frontend/packages/browser-plugin/tsconfig.node.json":"{\n  \"compilerOptions\": {\n    \"composite\": true,\n    \"skipLibCheck\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"allowSyntheticDefaultImports\": true\n  },\n  \"include\": [\"vite.config.mts\", \"manifest.ts\"]\n}\n","frontend/packages/browser-plugin/package.json":"{\n  \"name\": \"@rpa/extension\",\n  \"displayName\": \"RPA-Browser-Plugin\",\n  \"version\": \"5.2.12\",\n  \"description\": \"RPA browser plugin\",\n  \"homepage\": \"\",\n  \"type\": \"commonjs\",\n  \"keywords\": [],\n  \"license\": \"ISC\",\n  \"author\": \"\",\n  \"main\": \"background.js\",\n  \"scripts\": {\n    \"tsc\" : \"tsc --noEmit\",\n    \"test\": \"vitest\",\n    \"build\": \"cross-env BUILD_ENTRY=background vite build && cross-env BUILD_ENTRY=content vite build\",\n    \"build:firefox\": \"cross-env BUILD_ENTRY=background vite build --mode=firefox && cross-env BUILD_ENTRY=content vite build --mode=firefox\",\n    \"build:chromium\": \"cross-env BUILD_ENTRY=background vite build --mode=chromium && cross-env BUILD_ENTRY=content vite build --mode=chromium\",\n    \"test:browser\": \"vitest --config=vitest.browser.config.js\",\n    \"coverage\": \"vitest --config=vitest.browser.config.js run --coverage\",\n    \"build:all\": \"npm run build && npm run build:firefox && npm run build:chromium\",\n    \"lint:fix\": \"eslint --fix \\\"**/*.{ts,js}\\\"\"\n  },\n  \"devDependencies\": {\n    \"@babel/cli\": \"^7.25.6\",\n    \"@babel/core\": \"^7.25.2\",\n    \"@babel/preset-env\": \"^7.25.4\",\n    \"@types/archiver\": \"^6.0.3\",\n    \"@vitest/browser\": \"^3.2.4\",\n    \"@vitest/coverage-v8\": \"^3.2.4\",\n    \"ai-motion\": \"^0.4.8\",\n    \"archiver\": \"^7.0.1\",\n    \"chrome-types\": \"^0.1.290\",\n    \"cross-env\": \"^7.0.3\",\n    \"jsdom\": \"^27.0.0\",\n    \"vite\": \"^5.4.21\",\n    \"vitest\": \"^3.2.4\"\n  }\n}\n","frontend/packages/browser-plugin/README.zh.md":"# 简体中文 | [English](./README.md)\n\n# 仓库说明\n\n本仓库为RPA浏览器插件仓库，处理网页相关自动化\n\n# 打包说明\n\n- 打包命令：`npm run build` 即可打包 Chrome/Edge 浏览器通用插件\n- npm run build:`browser` 为打包成对应浏览器的插件，可以是任何Chromium/Firefox 内核的变体浏览器，只需要在`src/3rd/rpa_websocket.js` 中设置 custom_agent，`package.json` 中添加命令即可，`browser` 为该浏览器可执行文件的文件名\n- node 版本说明：v20+\n\n# 部分功能说明\n\n## 1. 插件深度搜索功能\n\n需要悬浮鼠标5秒以上，才能触发深度搜索，深度搜索旨在解决一部分元素遮挡的问题，但有些未遮挡的元素，深度搜索后会导致元素并非是用户想要的元素，所以不是所有的元素都需要触发深度搜索\n\n### 实现方式：\n\n通过获取鼠标 x,y 下所有的元素 `document.elementsFromPoint(x, y)` 来获取元素后，通过每个元素的 left, top, right, bottom 距离 target (x, y) 找到最近的一个元素，若存在多个结果，取第一项。\n\n### 插件 shadowRoot 递归获取元素功能,\n\n具体查看 `shadowRootElement` 函数，递归查找元素是否是 shadowRoot 元素，若是，则继续查找 shadowRoot 下元素，直到找到普通元素，中间拼接 `$shadow$`，方便用户识别元素路径, 通过path获取元素时，也会识别到 `$shadow$`，并经函数 `getElementBySelector`找到目标元素， shadowRoot 元素暂时只支持 css 选择器获取，不支持xpath选择器获取。\n\n### frame 定位功能\n\n#### 跨域/同源iframe 元素位置统一处理办法\n\n#### 1. 跨域iframe元素位置统一处理办法\n\n说明：在跨域iframe元素中，由于同源策略的限制，以及存在iframe 的src 固定，iframe 的url 是会变动的，以及同一个tab下可能存在一摸一样src 的iframe , 通过src 查找所要的iframe 是不准确的。\n解决方法：通过插件主进程获取到iframe 的嵌套关系， parentFrameId , 得到一个嵌套关系的顺序，让后通过传入的 x,y 坐标，通过嵌套关系顺序，逐层查找，x, y 也会逐层减去 iframe 的位置，以及iframe的盒模型borderLeft, paddingLeft 得到准确的iframe content 的位置。\n详细见 getIframeElement 这个函数在backgroundInject 和contentInject 的处理\n\n#### 2. 同源iframe元素位置统一处理办法\n\n说明： 同上，虽然同源限制更小，但是按同一套方法处理，可以避免冗余，减少变量，减少出错。\n\n#### 3. iframe元素定位处理办法\n\n说明：再content中，会标记当前窗口下的所有frame 元素，并通过iframe.contentWindow.postMessage将iframe 的xpath 路径传给对应的iframe, 对应的iframe 中通过window.addEventListener('message', function(e) { }) 接收xpath 路径, 并传给主进程，这时就可以绑定iframe 的xpath 路径和iframe 的id。这样就可以按照 id 的嵌套关系来得到一个总的iframe 的 path 全路径，通过iframeXpath 这个字段即可定位到对应的iframe 以及iframe中的目标元素。\n\n#### 4. 注意\n\niframeXpath 与其他元素定位逻辑相同，统一查找逻辑，也存在动态性问题。\n\n# 构建crx/xpi 包说明\n\n### Chrome\n\n1. chrome 可以选择构建crx 插件包，推荐使用chrome developer dashboard 发布到chrome 插件商店，chrome 开发者账户需要收费，若不发布到插件商店，会被chrome 浏览器的限制启用，需要在安装插件时写入chrome://policy 政策   `ExtensionInstallAllowlist `  Windows 以注册表的方式 `Software\\Policies\\Google\\Chrome\\ExtensionInstallAllowlist` 写入白名单，Linux 写入方式  `/etc/opt/chrome/policies/managed/policy.json  ` 详细可见 [https://chromeenterprise.google/policies/?policy=ExtensionInstallAllowlist]()\n2. 不发布的打包方式：打开chrome浏览器，进入chrome://extensions/ 页， 启用开发者模式，选择打包扩展程序，浏览扩展程序根目录，第一次私钥文件可以不填，然后打包扩展程序，在扩展程序根目录就会生成一个对应的.crx 文件 和 .pem 密钥文件，.pem文件后续在更新插件包的时候需要使用，同一个密钥文件就会生成一样的插件id， 用于更新插件。\n\n### Firefox\n\n1. firefox 可以免费自行申请一个开发者账户，上传打包自己的插件xpi 文件，可以不发布，直接下载下xpi 文件亦可以安装。\n2. firefox 插件请自行打包，使用自己的开发者账户上传，构建自己的xpi 文件\n","frontend/packages/browser-plugin/tsconfig.json":"{\n  \"compilerOptions\": {\n    \"target\": \"ES2023\",\n    \"types\": [\"chrome-types/_all.d.ts\"],\n    \"allowJs\": true,\n    \"rootDir\": \"src\",\n    \"outDir\": \"dist\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"noImplicitAny\": false,\n    \"strict\": false\n  },\n  \"include\": [\"src/*\", \"src/**/*\"],\n  \"exclude\": [\"node_modules\", \"dist\", \"src/3rd/*\", \"\"],\n  \"references\": [{ \"path\": \"./tsconfig.node.json\" }]\n}\n","frontend/packages/cli/README.md":"# cli Documentation\n\nPath: `frontend/packages/cli/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/README.md)","frontend/packages/cli/README.zh-CN.md":"# Cli Skill\n\nPath: `frontend/packages/cli/README.zh-CN.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/README.zh-CN.md)","frontend/packages/cli/package.json":"# Cli Skill\n\nPath: `frontend/packages/cli/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/package.json)","frontend/packages/cli/tsconfig.json":"# Cli Skill\n\nPath: `frontend/packages/cli/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/tsconfig.json)","frontend/packages/components/README.md":"# components Documentation\n\nPath: `frontend/packages/components/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/README.md)","frontend/packages/components/package.json":"# Components Skill\n\nPath: `frontend/packages/components/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/package.json)","frontend/packages/components/tsconfig.json":"# Components Skill\n\nPath: `frontend/packages/components/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/tsconfig.json)","frontend/packages/electron-app/README.md":"# electron-app Documentation\n\nPath: `frontend/packages/electron-app/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/README.md)","frontend/packages/electron-app/electron-builder.json":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/electron-builder.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/electron-builder.json)","frontend/packages/electron-app/package.json":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/package.json)","frontend/packages/electron-app/tsconfig.json":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.json)","frontend/packages/electron-app/tsconfig.node.json":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/tsconfig.node.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.node.json)","frontend/packages/electron-app/tsconfig.web.json":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/tsconfig.web.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.web.json)","frontend/packages/shared/package.json":"# Shared Skill\n\nPath: `frontend/packages/shared/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/shared/package.json)","frontend/packages/shared/tsconfig.json":"# Shared Skill\n\nPath: `frontend/packages/shared/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/shared/tsconfig.json)","frontend/packages/web-app/package.json":"# Web-app Skill\n\nPath: `frontend/packages/web-app/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/package.json)","frontend/packages/web-app/tsconfig.json":"# Web-app Skill\n\nPath: `frontend/packages/web-app/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/tsconfig.json)","frontend/packages/web-app/tsconfig.node.json":"# Web-app Skill\n\nPath: `frontend/packages/web-app/tsconfig.node.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/tsconfig.node.json)","frontend/packages/browser-plugin/public/manifest.json":"# Public Skill\n\nPath: `frontend/packages/browser-plugin/public/manifest.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/browser-plugin/public/manifest.json)","frontend/packages/components/lib/cdn-info.json":"# Lib Skill\n\nPath: `frontend/packages/components/lib/cdn-info.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/lib/cdn-info.json)","frontend/packages/cli/templates/template-vue/package.json":"# Template-vue Skill\n\nPath: `frontend/packages/cli/templates/template-vue/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/templates/template-vue/package.json)","frontend/packages/cli/templates/template-vue/tsconfig.json":"# Template-vue Skill\n\nPath: `frontend/packages/cli/templates/template-vue/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/templates/template-vue/tsconfig.json)","engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json":"# Plugins Skill\n\nPath: `engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json)","frontend/packages/components/src/components/Sheet/luckyexcel/README.md":"# luckyexcel Documentation\n\nPath: `frontend/packages/components/src/components/Sheet/luckyexcel/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/src/components/Sheet/luckyexcel/README.md)","engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json":"# Chromium-extension Skill\n\nPath: `engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json)"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/AGENTS.md","title":"AI Agent Protocol & Instructions","category":"root-instruction","format":"markdown","content":"# AGENTS.md\n\nGuidance for AI coding agents working in the **astron-rpa** (AstronRPA)\nrepository — an agent-ready RPA suite with out-of-the-box automation tools for\ndesktop applications, web systems, and business-process automation.\n\nAstronRPA uses a **server–client** architecture: server components run via\nDocker, and the client (RPA engine + desktop app) is packaged and run on the\nmachine that executes RPA tasks. The client toolchain is Windows-first.\n\n## Project layout\n\nThis is a multi-language monorepo driven by a unified `Makefile` (with modular\nincludes under `makefiles/`).\n\n- `backend/` — server-side microservices (deployed via Docker Compose):\n  - `robot-service/`, `resource-service/`, `rpa-auth/` — Java / Spring Boot\n    services (Maven; each ships `checkstyle.xml`, `pmd-ruleset.xml`,\n    `spotbugs-exclude.xml`).\n  - `ai-service/`, `openapi-service/` — Python services (managed with `uv`).\n- `engine/` — the Python RPA execution engine (managed with `uv`, linted with\n  `ruff`): `main.py`, `components/` (RPA components), `servers/`, `shared/`.\n- `frontend/` — pnpm workspace monorepo (Vue 3 + TypeScript, Vitest, ESLint,\n  i18n under `locales/`). Notable packages under `frontend/packages/`:\n  `electron-app` (desktop client), `web-app` (web console), `browser-plugin`,\n  `auth-app`, `cli`, `components`, `shared`.\n- `docker/` — Docker Compose manifests for the server stack.\n- `makefiles/` — modular Make components (`common.mk`, `python.mk`, `java.mk`,\n  `typescript.mk`, `go.mk`, `git.mk`).\n- `resources/` — packaged client resources. `docs/`, `FAQ.md`, `BUILD_GUIDE.md`\n  — documentation.\n\n## Toolchain\n\n- **Python 3.13.x** + **uv 0.8+** — RPA engine and Python services.\n- **Node.js 22+** + **pnpm 9+** — frontend workspace.\n- **Java JDK 8+** + **Maven** — Java backend services.\n- **Docker & Docker Compose** — server deployment.\n- Windows client packaging also needs **SWIG** (Python↔C/C++ bindings, e.g.\n  `pywinhook`) and **7-Zip** (deployment archives). See `BUILD_GUIDE.md`.\n\n## Common commands\n\nQuality and git workflow are driven by the root `Makefile` (run `make help` to\nsee detected projects and targets):\n\n- `make install-tools` — install the formatting/linting toolchain.\n- `make fmt` — format across languages (`fmt-python`, `fmt-java`, `fmt-ts`, …).\n- `make check` (alias `make lint`) — format check + linters\n  (`check-python`, `check-java`, `check-ts`, …). CI is check-only; it does not\n  auto-fix.\n- `make new-feature name=<short-name>` / `make new-bugfix name=<short-name>` —\n  branch helpers following the project's branch strategy.\n\nPre-commit hooks (install with `pre-commit install`) format the engine with\nruff: `uv run --project engine --dev ruff format ./engine`.\n\n### Run the server (Docker)\n\n```bash\ncd docker\ncp .env.example .env\n# configure the public HTTPS names and copy the certificate/key to docker/certs/\n# see docker/HTTPS_DEPLOYMENT.md for required variables\ndocker compose up -d mysql casdoor\n# wait for Casdoor initialization, then synchronize this deployment's credentials\npython3 scripts/sync-casdoor-credentials.py\ndocker compose up -d\ndocker compose ps\n```\n\nGateway API: https://localhost · Casdoor auth: https://localhost:8443\n\n### Build the client (Windows)\n\n```bash\n# full build (engine + frontend desktop app) from the repo root\n./build.bat --python-exe \"C:\\Program Files\\Python313\\python.exe\"\n./build.bat --skip-frontend   # engine only\n./build.bat --skip-engine     # frontend only\n```\n\nThe packaged installer is written to `frontend/packages/electron-app/dist/`.\n\n### Frontend (pnpm workspace, from `frontend/`)\n\n```bash\npnpm install\npnpm dev:web         # run the web console in dev\npnpm dev:desktop     # run the desktop app in dev\npnpm build:desktop   # build the Windows desktop app\n```\n\n## Testing instructions\n\nThere is no aggregate `make test`; run tests per component:\n\n- **Frontend**: `pnpm test` (Vitest) or `pnpm test:run` for a single run.\n- **Python** (`engine`, `backend/ai-service`, `backend/openapi-service`):\n  `uv run pytest` within the project where tests exist (e.g. `backend/ai-service`\n  has a `tests/` directory).\n- **Java** (`backend/robot-service`, `resource-service`, `rpa-auth`):\n  `mvn test` within the service directory.\n\nRun `make check` and the relevant tests before opening a PR, and add or update\ntests for code you change.\n\n## Code style\n\nFormatting and linting are wired through `make fmt` / `make check`:\n\n| Language        | Format / Lint                                                        |\n| --------------- | -------------------------------------------------------------------- |\n| Python          | `ruff` format + `ruff` check (see `engine/.ruff.toml`)               |\n| Java            | Checkstyle + PMD + SpotBugs (per-service configs)                     |\n| TypeScript/Vue  | ESLint (`frontend/eslint.config.mjs`); `pnpm lint` / `pnpm lint:fix` |\n\n## PR instructions\n\n- Create branches with the Make helpers (`make new-feature name=<…>`).\n- Run `make check` and the relevant component tests before committing; make sure\n  pre-commit hooks pass.\n- Keep PRs focused and write clear, conventional commit messages.\n- For build and deployment details, see `BUILD_GUIDE.md`.\n","isInternal":false,"tokens":1353,"sizeBytes":5243},{"name":"manifest.json","path":"engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json","title":"Chromium-extension Skill","category":"anthropic-skill","format":"json","content":"# Chromium-extension Skill\n\nPath: `engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json)","tokens":300,"sizeBytes":350},{"name":"policy.json","path":"engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json","title":"Plugins Skill","category":"anthropic-skill","format":"json","content":"# Plugins Skill\n\nPath: `engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json)","tokens":300,"sizeBytes":297},{"name":"package.json","path":"frontend/packages/auth-app/package.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/auth-app/package.json","title":"@rpa/auth-app","category":"anthropic-skill","format":"json","content":"{\n  \"name\": \"@rpa/auth-app\",\n  \"private\": true,\n  \"version\": \"0.0.0\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"vite\",\n    \"build\": \"vue-tsc -b && vite build\",\n    \"preview\": \"vite preview\"\n  },\n  \"dependencies\": {\n    \"@rpa/components\": \"workspace:*\",\n    \"@rpa/shared\": \"workspace:*\",\n    \"vue\": \"catalog:\"\n  },  \n  \"devDependencies\": {\n    \"@types/node\": \"^24.10.0\",\n    \"@vitejs/plugin-vue\": \"catalog:\",\n    \"@vitejs/plugin-vue-jsx\": \"catalog:\",\n    \"vite-plugin-svg4vue\": \"^4.5.1\",\n    \"@vue/tsconfig\": \"^0.8.1\",\n    \"tailwindcss\": \"^3.4.4\",\n    \"typescript\": \"~5.9.3\",\n    \"vite\": \"catalog:\",\n    \"vue-tsc\": \"^3.1.3\"\n  }\n}\n","frontmatter":{"name":"@rpa/auth-app","private":true,"version":"0.0.0","type":"module","scripts":{"dev":"vite","build":"vue-tsc -b && vite build","preview":"vite preview"},"dependencies":{"@rpa/components":"workspace:*","@rpa/shared":"workspace:*","vue":"catalog:"},"devDependencies":{"@types/node":"^24.10.0","@vitejs/plugin-vue":"catalog:","@vitejs/plugin-vue-jsx":"catalog:","vite-plugin-svg4vue":"^4.5.1","@vue/tsconfig":"^0.8.1","tailwindcss":"^3.4.4","typescript":"~5.9.3","vite":"catalog:","vue-tsc":"^3.1.3"}},"isInternal":false,"tokens":229,"sizeBytes":634},{"name":"tsconfig.app.json","path":"frontend/packages/auth-app/tsconfig.app.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/auth-app/tsconfig.app.json","title":"Auth-app Skill","category":"anthropic-skill","format":"json","content":"{\n  \"extends\": \"@vue/tsconfig/tsconfig.dom.json\",\n  \"compilerOptions\": {\n    \"tsBuildInfoFile\": \"./node_modules/.tmp/tsconfig.app.tsbuildinfo\",\n    \"types\": [\"vite/client\"],\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"@/*\": [\"./src/*\"]\n    },\n\n    /* Linting */\n    \"strict\": true,\n    \"noUnusedLocals\": false,\n    \"noUnusedParameters\": false,\n    \"erasableSyntaxOnly\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"noUncheckedSideEffectImports\": true\n  },\n  \"include\": [\"src/**/*.ts\", \"src/**/*.tsx\", \"src/**/*.vue\", \"../components/src/components/LaunchCarousel/LaunchCarousel.vue\", \"../components/src/components/LaunchCarousel/launch.ts\"]\n}\n","isInternal":false,"tokens":174,"sizeBytes":646},{"name":"tsconfig.json","path":"frontend/packages/auth-app/tsconfig.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/auth-app/tsconfig.json","title":"Auth-app Skill","category":"anthropic-skill","format":"json","content":"{\n  \"files\": [],\n  \"references\": [\n    { \"path\": \"./tsconfig.app.json\" },\n    { \"path\": \"./tsconfig.node.json\" }\n  ]\n}\n","frontmatter":{"files":[],"references":[{"path":"./tsconfig.app.json"},{"path":"./tsconfig.node.json"}]},"isInternal":false,"tokens":38,"sizeBytes":119},{"name":"tsconfig.node.json","path":"frontend/packages/auth-app/tsconfig.node.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/auth-app/tsconfig.node.json","title":"Auth-app Skill","category":"anthropic-skill","format":"json","content":"{\n  \"compilerOptions\": {\n    \"tsBuildInfoFile\": \"./node_modules/.tmp/tsconfig.node.tsbuildinfo\",\n    \"target\": \"ES2023\",\n    \"lib\": [\"ES2023\"],\n    \"module\": \"ESNext\",\n    \"types\": [\"node\"],\n    \"skipLibCheck\": true,\n\n    /* Bundler mode */\n    \"moduleResolution\": \"bundler\",\n    \"allowImportingTsExtensions\": true,\n    \"verbatimModuleSyntax\": true,\n    \"moduleDetection\": \"force\",\n    \"noEmit\": true,\n\n    /* Linting */\n    \"strict\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"erasableSyntaxOnly\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"noUncheckedSideEffectImports\": true\n  },\n  \"include\": [\"vite.config.ts\"]\n}\n","isInternal":false,"tokens":188,"sizeBytes":653},{"name":"API.md","path":"frontend/packages/browser-plugin/API.md","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/browser-plugin/API.md","title":"Browser-plugin Skill","category":"anthropic-skill","format":"markdown","content":"<!-- @format -->\n\n# Astron Browser Plugin API 文档\n\n## 1. 概述\n\n- **插件简介**：Astron Browser Plugin是Astron RPA 在web自动化的重要组成部分，为Astron RPA提供Chrome/Edge/Firefox 等浏览器提供网页自动化能力\n- **主要特性**：\n\n* 浏览器Tab 页操作\n* 网页元素操作\n* Cookie 操作\n* 脚本注入操作\n* iframe 操作\n\n- **版本信息**：5.2.11\n\n## 2. 快速开始\n\n- **安装**：npm run build 打包后使用浏览器插件管理加载插件\n- **基础配置**：Chrome 浏览器，node 环境推荐 node版本 v20+\n\n## 3. API 参考\n\n- **接口：http://127.0.0.1:{port}/browser/transition** 默认port: 9082\n- **类型：POST**\n- **请求体:application/json**\n\n```json\n{\n  \"browser_type\": \"chrome\", // firefox, edge ...\n  \"data\": {\n    \"x\": 854, \"y\": 314\n  },\n  \"key\": \"getElement\"\n}\n```\n\n### 3.1 支持的API列表\n\n#### Tab 页操作 (Tab Operations)\n\n- `reloadTab` - 刷新当前标签页\n- `stopLoad` - 停止加载\n- `openNewTab` - 打开新标签页\n- `closeTab` - 关闭标签页\n- `updateTab` - 更新标签页 URL\n- `activeTab` - 激活标签页\n- `getActiveTab` - 获取活跃标签页\n- `switchTab` - 切换到指定标签页\n- `getAllTabs` - 获取所有标签页\n- `backward` - 后退\n- `forward` - 前进\n- `maxWindow` - 最大化窗口\n- `minWindow` - 最小化窗口\n- `getTitle` - 获取标签页标题\n- `getUrl` - 获取标签页 URL\n- `captureScreen` - 网页可视区域截图\n- `capturePage` - 截取全部网页\n- `loadComplete` - 判断网页是否加载完成\n- `getFrames` - 获取所有帧\n- `getExtFrames` - 获取扩展帧\n- `resetZoom` - 重置缩放\n- `getTabId` - 获取标签页 ID\n- `getFrameTree` - 获取帧树\n- `printPage` - 打印页面\n\n#### 元素操作 (Element Operations)\n\n- `getElement` - 获取元素信息\n- `getElementPos` - 获取元素绝对位置\n- `checkElement` - 校验元素\n- `getOuterHTML` - 获取元素 HTML\n- `scrollIntoView` - 滚动到可视区域\n- `scrollToTop` - 滚动到顶部\n- `elementIsRender` - 等待元素渲染\n- `elementIsReady` - 元素是否准备好（包含页面状态）\n\n#### 元素属性操作 (Element Attribute Operations)\n\n- `getElementText` - 获取元素文本\n- `getElementAttrs` - 获取元素属性\n- `setElementAttr` - 设置元素属性\n- `removeElementAttr` - 移除元素属性\n- `getElementChecked` - 获取元素 checked 状态\n- `setElementChecked` - 设置元素 checked 状态\n- `getElementSelected` - 获取元素 selected 状态\n- `setElementSelected` - 设置元素 selected 状态\n\n#### 元素交互 (Element Interaction)\n\n- `clickElement` - 点击元素\n- `inputElement` - 输入内容\n\n#### 元素选择与导航 (Element Selection & Navigation)\n\n- `similarElement` - 获取相似元素\n- `elementFromSelect` - 通过选择条件获取元素\n- `getSimilarIterator` - 相似元素迭代\n- `getParentElement` - 获取父元素（扩大选区）\n- `getChildElement` - 获取子元素（缩小选区）\n- `getRelativeElement` - 获取关联元素（parent/sibling/child）\n- `generateElement` - 通过 xpath/cssSelector/text 生成元素\n\n#### 数据抓取 (Data Extraction)\n\n- `elementIsTable` - 判断元素是否为表格\n- `tableDataBatch` - 批量抓取表格数据\n- `tableColumnDataBatch` - 批量抓取表格单列数据\n- `tableHeaderBatch` - 批量抓取表头数据\n- `similarBatch` - 批量抓取相似元素数据\n- `simalarListBatch` - 批量抓取相似元素列表\n- `highLightColumn` - 高亮列\n- `getBatchData` - 获取批量数据\n- `scrollWindow` - 滚动窗口\n- `elementShot` - 元素截图\n- `getTableData` - 获取表格数据\n\n#### JavaScript 执行 (JavaScript Execution)\n\n- `runJS` - 注入并执行 JavaScript 代码\n\n#### Cookie 操作 (Cookie Operations)\n\n- `getCookie` - 获取 cookie\n- `setCookies` - 设置 cookie\n- `removeCookie` - 删除 cookie\n\n#### 调试器控制 (Debugger Control)\n\n- `startDebugger` - 启动调试器\n- `stopDebugger` - 停止调试器\n\n#### 网络监听 (Network Monitoring)\n\n- `getRequestInterceptionFilters` - 获取请求拦截过滤器\n- `setRequestInterceptionFilters` - 设置请求拦截过滤器\n- `addRequestInterceptionFilter` - 添加请求拦截过滤器\n- `removeRequestInterceptionFilter` - 移除请求拦截过滤器\n- `startDebugNetworkListen` - 启动网络监听\n- `stopDebugNetworkListen` - 停止网络监听\n- `getDebugNetworkData` - 获取网络监听数据\n- `clearDebugNetworkData` - 清除网络监听数据\n\n#### 其他操作 (Other Operations)\n\n- `currentExtension` - 获取插件信息\n- `backgroundInject` - 后台注入检查 `deprecated`\n- `contentInject` - 内容注入检查 `deprecated`\n\n### 3.2 响应格式\n\n- **返回体:application/json**\n\n```json\n{\n  \"code\": \"0000\", // background code \n  \"msg\": \"ok\",\n  \"data\": {\n    \"code\": \"0000\", // content code \n    \"data\": {\n      \"matchTypes\": [],\n      \"checkType\": \"visualization\",\n      \"xpath\": \"//textarea[@id=\\\"APjFqb\\\"]\",\n      \"cssSelector\": \"#APjFqb\",\n      \"pathDirs\": [\n        {\n          \"tag\": \"textarea\",\n          \"checked\": true,\n          \"value\": \"textarea\",\n          \"attrs\": [\n            {\n              \"name\": \"id\",\n              \"value\": \"APjFqb\",\n              \"checked\": true,\n              \"type\": 0\n            },\n            {\n              \"name\": \"class\",\n              \"value\": \"gLFyf\",\n              \"checked\": false,\n              \"type\": 1\n            },\n            {\n              \"name\": \"title\",\n              \"value\": \"Google 搜索\",\n              \"checked\": false,\n              \"type\": 0\n            }\n          ]\n        }\n      ],\n      \"rect\": {\n        \"left\": 594,\n        \"top\": 268,\n        \"width\": 672,\n        \"height\": 75,\n        \"right\": 1265,\n        \"bottom\": 343,\n        \"x\": 594,\n        \"y\": 268\n      },\n      \"url\": \"https://www.google.com.hk/\",\n      \"shadowRoot\": false,\n      \"tag\": \"输入域\",\n      \"text\": \"unknown\",\n      \"tabTitle\": \"Google\",\n      \"tabUrl\": \"https://www.google.com.hk/\",\n      \"isFrame\": false,\n      \"frameId\": 0\n    },\n    \"msg\": \"success\"\n  }\n}\n```\n\n### 3.3 API 使用示例\n\n#### Tab 页操作示例\n\n```json\n// 获取活跃标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getActiveTab\"\n}\n\n// 打开新标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://www.baidu.com/\" },\n    \"key\": \"openNewTab\"\n}\n\n// 获取标签页 URL\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getUrl\"\n}\n\n// 获取标签页 title\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getTitle\"\n}\n\n// 刷新标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"reloadTab\"\n}\n\n// 停止加载\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"stopLoad\"\n}\n\n// 最大化窗口\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"maxWindow\"\n}\n\n// 最小化窗口\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"minWindow\"\n}\n\n// 后退\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"backward\"\n}\n\n// 前进\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"forward\"\n}\n\n// 关闭标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://developer.mozilla.org/zh-CN/plus\" },\n    \"key\": \"closeTab\"\n}\n\n// 切换到指定标签页（通过URL）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://developer.mozilla.org/zh-CN/plus\" },\n    \"key\": \"switchTab\"\n}\n\n// 切换到指定标签页（通过标题）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"title\": \"MDN Plus\" },\n    \"key\": \"switchTab\"\n}\n\n// 更新标签页 URL\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://www.abc.com\" },\n    \"key\": \"updateTab\"\n}\n\n// 网页可视区域截图\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"captureScreen\"\n}\n\n// 截取全部网页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"capturePage\"\n}\n\n// 页面是否加载完成\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"loadComplete\"\n}\n\n// 获取所有帧\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getFrames\"\n}\n\n// 获取帧树\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getFrameTree\"\n}\n\n// 重置缩放\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"resetZoom\"\n}\n\n// 打印页面\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"orientation\": \"portrait\",\n        \"margins\": { \"left\": 0, \"top\": 0, \"right\": 0, \"bottom\": 0 }\n    },\n    \"key\": \"printPage\"\n}\n```\n\n#### JavaScript 执行示例\n\n```json\n// 注入并执行 JavaScript\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"code\": \"console.log(1);return 1\",\n        \"url\": \"http://192.168.56.1:9010/aa/2.html?a=1\",\n        \"tabUrl\": \"http://192.168.56.1:9010/1.html\",\n        \"iframeXpath\": \"html/body/div[1]/iframe/html/body/div/button\",\n        \"isFrame\": true\n    },\n    \"key\": \"runJS\"\n}\n```\n\n#### 元素选择和获取示例\n\n```json\n// 获取元素信息\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"x\": 854, \"y\": 314 },\n    \"key\": \"getElement\"\n}\n\n// 获取元素绝对位置\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div/div/div[3]\",\n        \"cssSelector\": \"#app>div.arrange>div:nth-child(1)>div:nth-child(3)\"\n    },\n    \"key\": \"getElementPos\"\n}\n\n// 校验元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"checkElement\"\n}\n\n// 滚动元素到可视区域\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"scrollIntoView\"\n}\n\n// 等待元素渲染\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"elementIsRender\"\n}\n\n// 元素是否准备好（包含页面状态）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"container\\\"]/div[3]/div[2]/div/div[2]/div[1]/p[23]\",\n        \"cssSelector\": \"p:nth-child(23)\"\n    },\n    \"key\": \"elementIsReady\"\n}\n\n// 获取元素 HTML\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"x\": 0, \"y\": 0 },\n    \"key\": \"getOuterHTML\"\n}\n\n// 获取相似元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//ul[@id=\\\"hotsearch-content-wrapper\\\"]/li[2]/a/span[2]\",\n        \"cssSelector\": \"#hotsearch-content-wrapper>li:nth-child(2)>a:nth-child(1)>span:nth-child(4)\"\n    },\n    \"key\": \"similarElement\"\n}\n\n// 通过选择条件获取元素信息\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/div[1]/div[1]/section[5]/section[1]/div/div/button/span\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div>div:nth-child(2)>section:nth-child(1)>article>div:nth-child(3)>div:nth-child(1)>section:nth-child(5)>section:nth-child(1)>div>div>button>span\"\n    },\n    \"key\": \"elementFromSelect\"\n}\n\n// 获取父元素（扩大选区）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"spa-mount-point\\\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div/div\",\n        \"cssSelector\": \"#spa-mount-point>div>div.ent-resource>div>div.ent-resource-main>div.ent-resource-body>div.branch-tabs-wrap>div.tabs-container>div.branch-tabs>div.el-tabs__header>div>div\"\n    },\n    \"key\": \"getParentElement\"\n}\n\n// 获取子元素（缩小选区）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"spa-mount-point\\\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div/div\",\n        \"cssSelector\": \"#spa-mount-point>div>div.ent-resource>div>div.ent-resource-main>div.ent-resource-body>div.branch-tabs-wrap>div.tabs-container>div.branch-tabs>div.el-tabs__header>div>div\",\n        \"originXpath\": \"/html/body/div/section/section/main/div/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div/div\"\n    },\n    \"key\": \"getChildElement\"\n}\n\n// 通过 xpath/cssSelector/text 生成元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"type\": \"xpath\",\n        \"value\": \"//div\",\n        \"returnType\": \"single\"\n    },\n    \"key\": \"generateElement\"\n}\n\n// 获取关联元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"element\\\"]\",\n        \"relativeOptions\": {\n            \"relativeType\": \"child\",\n            \"elementGetType\": \"index\",\n            \"index\": 1\n        }\n    },\n    \"key\": \"getRelativeElement\"\n}\n\n// 相似元素迭代\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"index\": 0,\n        \"count\": 5,\n        \"xpath\": \"//nav[@id=\\\"nav\\\"]/ul/li[24]/ul/li/a\",\n        \"cssSelector\": \"#nav>ul>li:nth-child(24)>ul>li>a\"\n    },\n    \"key\": \"getSimilarIterator\"\n}\n```\n\n#### 元素属性操作示例\n\n```json\n// 获取元素文本\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"getElementText\"\n}\n\n// 获取元素属性\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"getElementAttrs\"\n}\n\n// 设置元素属性\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\",\n        \"attrName\": \"data-value\",\n        \"attrValue\": \"test\"\n    },\n    \"key\": \"setElementAttr\"\n}\n\n// 移除元素属性\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\",\n        \"attrName\": \"data-value\"\n    },\n    \"key\": \"removeElementAttr\"\n}\n\n// 获取 checked 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//input[@id=\\\"checkbox\\\"]\",\n        \"cssSelector\": \"#checkbox\"\n    },\n    \"key\": \"getElementChecked\"\n}\n\n// 设置 checked 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//input[@id=\\\"checkbox\\\"]\",\n        \"cssSelector\": \"#checkbox\",\n        \"checked\": true\n    },\n    \"key\": \"setElementChecked\"\n}\n\n// 获取 selected 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//option[@value=\\\"option1\\\"]\",\n        \"cssSelector\": \"option[value='option1']\"\n    },\n    \"key\": \"getElementSelected\"\n}\n\n// 设置 selected 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//option[@value=\\\"option1\\\"]\",\n        \"cssSelector\": \"option[value='option1']\",\n        \"selected\": true\n    },\n    \"key\": \"setElementSelected\"\n}\n```\n\n#### 元素交互示例\n\n```json\n// 点击元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//button[@id=\\\"submit\\\"]\",\n        \"cssSelector\": \"#submit\"\n    },\n    \"key\": \"clickElement\"\n}\n\n// 输入内容\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//input[@id=\\\"username\\\"]\",\n        \"cssSelector\": \"#username\",\n        \"text\": \"test_input\"\n    },\n    \"key\": \"inputElement\"\n}\n```\n\n#### Cookie 操作示例\n\n```json\n// 获取 Cookie\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"url\": \"http://localhost:1420/\",\n        \"name\": \"JSESSIONID\"\n    },\n    \"key\": \"getCookie\"\n}\n\n// 设置 Cookie\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"url\": \"http://localhost:1420/\",\n        \"name\": \"JSESSIONID\",\n        \"value\": \"123\"\n    },\n    \"key\": \"setCookies\"\n}\n\n// 删除 Cookie\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"url\": \"http://localhost:1420/\",\n        \"name\": \"JSESSIONID\"\n    },\n    \"key\": \"removeCookie\"\n}\n```\n\n#### 数据抓取示例\n\n```json\n// 判断元素是否为表格\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//table[@id=\\\"dataTable\\\"]\",\n        \"cssSelector\": \"#dataTable\"\n    },\n    \"key\": \"elementIsTable\"\n}\n\n// 批量抓取表格数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/section[3]/table[1]/tbody/tr[5]/td[1]\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div.ant-row.css-9loccf>div:nth-child(2)>section:nth-child(1)>article>section:nth-child(4)>table:nth-child(4)>tbody>tr:nth-child(5)>td:nth-child(1)\"\n    },\n    \"key\": \"tableDataBatch\"\n}\n\n// 批量抓取表格单列数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/section[3]/table[1]/tbody/tr[5]/td[1]\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div.ant-row.css-9loccf>div:nth-child(2)>section:nth-child(1)>article>section:nth-child(4)>table:nth-child(4)>tbody>tr:nth-child(5)>td:nth-child(1)\"\n    },\n    \"key\": \"tableColumnDataBatch\"\n}\n\n// 批量抓取相似元素数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/section[3]/table[1]/tbody/tr[5]/td[1]\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div.ant-row.css-9loccf>div:nth-child(2)>section:nth-child(1)>article>section:nth-child(4)>table:nth-child(4)>tbody>tr:nth-child(5)>td:nth-child(1)\"\n    },\n    \"key\": \"similarBatch\"\n}\n\n// 元素截图\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"container\\\"]/div[3]/div[2]/div/div[2]/div[1]/p[23]\",\n        \"cssSelector\": \"p:nth-child(23)\"\n    },\n    \"key\": \"elementShot\"\n}\n\n// 滚动窗口\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"scrollX\": 0,\n        \"scrollY\": 100\n    },\n    \"key\": \"scrollWindow\"\n}\n```\n\n#### 调试器和网络监听示例\n\n```json\n// 启动调试器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"startDebugger\"\n}\n\n// 停止调试器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"stopDebugger\"\n}\n\n// 获取请求拦截过滤器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getRequestInterceptionFilters\"\n}\n\n// 设置请求拦截过滤器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"filters\": [\n            { \"urlPattern\": \".*\\\\.js$\", \"pathPattern\": \"static\" }\n        ]\n    },\n    \"key\": \"setRequestInterceptionFilters\"\n}\n\n// 启动网络监听\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"filters\": [\n            { \"urlPattern\": \".*api.*\", \"pathPattern\": \"\" }\n        ]\n    },\n    \"key\": \"startDebugNetworkListen\"\n}\n\n// 停止网络监听\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"stopDebugNetworkListen\"\n}\n\n// 获取网络监听数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getDebugNetworkData\"\n}\n\n// 清除网络监听数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"clearDebugNetworkData\"\n}\n```\n\n#### 其他操作示例\n\n```json\n// 获取插件信息\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"currentExtension\"\n}\n\n// 后台注入检查\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"backgroundInject\"\n}\n\n// 内容注入检查\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"contentInject\"\n}\n```\n\n## 4. 调用示例\n\n```\ncurl -X POST 'http://127.0.0.1:9082/browser/transition' -H 'User-Agent: Reqable/2.30.3' -H 'Content-Type: application/json' -d '{\n  \"browser_type\": \"<<bt>>\",\n  \"data\": {\n    \"x\": 0,\n    \"y\": 0\n  },\n  \"key\": \"getElement\"\n}'\n```\n\n## 5. 高级配置与集成\n\n针对市面常见浏览器，可自行适配对应的浏览器名称与token，一般为浏览器可执行文件的文件名称\n\n## 6. 注意事项\n\n- 插件通信依靠Astron RPA 客户端服务，请先打开Astron RPA 客户端\n- 插件通信依靠注册的token,token 会编码，例如Chrome 浏览器 token=`$chrome$`\n\n## 7. 常见问题解答\n\n- 不同浏览器使用插件执行时需要对应能力支持该浏览器。\n\n## 8. 附录\n\n- **错误码列表**：\n\n```\n  SUCCESS = '0000', // 成功\n  UNKNOWN_ERROR = '5001', // 未知异常\n  ELEMENT_NOT_FOUND = '5002', // 元素未找到\n  EXECUTE_ERROR = '5003', // 执行错误\n  VERSION_ERROR = '5004', // 版本错误\n```\n","isInternal":false,"tokens":6264,"sizeBytes":19631},{"name":"package.json","path":"frontend/packages/browser-plugin/package.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/browser-plugin/package.json","title":"@rpa/extension","category":"anthropic-skill","format":"json","content":"{\n  \"name\": \"@rpa/extension\",\n  \"displayName\": \"RPA-Browser-Plugin\",\n  \"version\": \"5.2.12\",\n  \"description\": \"RPA browser plugin\",\n  \"homepage\": \"\",\n  \"type\": \"commonjs\",\n  \"keywords\": [],\n  \"license\": \"ISC\",\n  \"author\": \"\",\n  \"main\": \"background.js\",\n  \"scripts\": {\n    \"tsc\" : \"tsc --noEmit\",\n    \"test\": \"vitest\",\n    \"build\": \"cross-env BUILD_ENTRY=background vite build && cross-env BUILD_ENTRY=content vite build\",\n    \"build:firefox\": \"cross-env BUILD_ENTRY=background vite build --mode=firefox && cross-env BUILD_ENTRY=content vite build --mode=firefox\",\n    \"build:chromium\": \"cross-env BUILD_ENTRY=background vite build --mode=chromium && cross-env BUILD_ENTRY=content vite build --mode=chromium\",\n    \"test:browser\": \"vitest --config=vitest.browser.config.js\",\n    \"coverage\": \"vitest --config=vitest.browser.config.js run --coverage\",\n    \"build:all\": \"npm run build && npm run build:firefox && npm run build:chromium\",\n    \"lint:fix\": \"eslint --fix \\\"**/*.{ts,js}\\\"\"\n  },\n  \"devDependencies\": {\n    \"@babel/cli\": \"^7.25.6\",\n    \"@babel/core\": \"^7.25.2\",\n    \"@babel/preset-env\": \"^7.25.4\",\n    \"@types/archiver\": \"^6.0.3\",\n    \"@vitest/browser\": \"^3.2.4\",\n    \"@vitest/coverage-v8\": \"^3.2.4\",\n    \"ai-motion\": \"^0.4.8\",\n    \"archiver\": \"^7.0.1\",\n    \"chrome-types\": \"^0.1.290\",\n    \"cross-env\": \"^7.0.3\",\n    \"jsdom\": \"^27.0.0\",\n    \"vite\": \"^5.4.21\",\n    \"vitest\": \"^3.2.4\"\n  }\n}\n","frontmatter":{"name":"@rpa/extension","displayName":"RPA-Browser-Plugin","version":"5.2.12","description":"RPA browser plugin","homepage":"","type":"commonjs","keywords":[],"license":"ISC","author":"","main":"background.js","scripts":{"tsc":"tsc --noEmit","test":"vitest","build":"cross-env BUILD_ENTRY=background vite build && cross-env BUILD_ENTRY=content vite build","build:firefox":"cross-env BUILD_ENTRY=background vite build --mode=firefox && cross-env BUILD_ENTRY=content vite build --mode=firefox","build:chromium":"cross-env BUILD_ENTRY=background vite build --mode=chromium && cross-env BUILD_ENTRY=content vite build --mode=chromium","test:browser":"vitest --config=vitest.browser.config.js","coverage":"vitest --config=vitest.browser.config.js run --coverage","build:all":"npm run build && npm run build:firefox && npm run build:chromium","lint:fix":"eslint --fix \"**/*.{ts,js}\""},"devDependencies":{"@babel/cli":"^7.25.6","@babel/core":"^7.25.2","@babel/preset-env":"^7.25.4","@types/archiver":"^6.0.3","@vitest/browser":"^3.2.4","@vitest/coverage-v8":"^3.2.4","ai-motion":"^0.4.8","archiver":"^7.0.1","chrome-types":"^0.1.290","cross-env":"^7.0.3","jsdom":"^27.0.0","vite":"^5.4.21","vitest":"^3.2.4"}},"isInternal":false,"tokens":454,"sizeBytes":1394},{"name":"manifest.json","path":"frontend/packages/browser-plugin/public/manifest.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/browser-plugin/public/manifest.json","title":"Public Skill","category":"anthropic-skill","format":"json","content":"# Public Skill\n\nPath: `frontend/packages/browser-plugin/public/manifest.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/browser-plugin/public/manifest.json)","tokens":300,"sizeBytes":220},{"name":"README.zh.md","path":"frontend/packages/browser-plugin/README.zh.md","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/browser-plugin/README.zh.md","title":"Browser-plugin Skill","category":"anthropic-skill","format":"markdown","content":"# 简体中文 | [English](./README.md)\n\n# 仓库说明\n\n本仓库为RPA浏览器插件仓库，处理网页相关自动化\n\n# 打包说明\n\n- 打包命令：`npm run build` 即可打包 Chrome/Edge 浏览器通用插件\n- npm run build:`browser` 为打包成对应浏览器的插件，可以是任何Chromium/Firefox 内核的变体浏览器，只需要在`src/3rd/rpa_websocket.js` 中设置 custom_agent，`package.json` 中添加命令即可，`browser` 为该浏览器可执行文件的文件名\n- node 版本说明：v20+\n\n# 部分功能说明\n\n## 1. 插件深度搜索功能\n\n需要悬浮鼠标5秒以上，才能触发深度搜索，深度搜索旨在解决一部分元素遮挡的问题，但有些未遮挡的元素，深度搜索后会导致元素并非是用户想要的元素，所以不是所有的元素都需要触发深度搜索\n\n### 实现方式：\n\n通过获取鼠标 x,y 下所有的元素 `document.elementsFromPoint(x, y)` 来获取元素后，通过每个元素的 left, top, right, bottom 距离 target (x, y) 找到最近的一个元素，若存在多个结果，取第一项。\n\n### 插件 shadowRoot 递归获取元素功能,\n\n具体查看 `shadowRootElement` 函数，递归查找元素是否是 shadowRoot 元素，若是，则继续查找 shadowRoot 下元素，直到找到普通元素，中间拼接 `$shadow$`，方便用户识别元素路径, 通过path获取元素时，也会识别到 `$shadow$`，并经函数 `getElementBySelector`找到目标元素， shadowRoot 元素暂时只支持 css 选择器获取，不支持xpath选择器获取。\n\n### frame 定位功能\n\n#### 跨域/同源iframe 元素位置统一处理办法\n\n#### 1. 跨域iframe元素位置统一处理办法\n\n说明：在跨域iframe元素中，由于同源策略的限制，以及存在iframe 的src 固定，iframe 的url 是会变动的，以及同一个tab下可能存在一摸一样src 的iframe , 通过src 查找所要的iframe 是不准确的。\n解决方法：通过插件主进程获取到iframe 的嵌套关系， parentFrameId , 得到一个嵌套关系的顺序，让后通过传入的 x,y 坐标，通过嵌套关系顺序，逐层查找，x, y 也会逐层减去 iframe 的位置，以及iframe的盒模型borderLeft, paddingLeft 得到准确的iframe content 的位置。\n详细见 getIframeElement 这个函数在backgroundInject 和contentInject 的处理\n\n#### 2. 同源iframe元素位置统一处理办法\n\n说明： 同上，虽然同源限制更小，但是按同一套方法处理，可以避免冗余，减少变量，减少出错。\n\n#### 3. iframe元素定位处理办法\n\n说明：再content中，会标记当前窗口下的所有frame 元素，并通过iframe.contentWindow.postMessage将iframe 的xpath 路径传给对应的iframe, 对应的iframe 中通过window.addEventListener('message', function(e) { }) 接收xpath 路径, 并传给主进程，这时就可以绑定iframe 的xpath 路径和iframe 的id。这样就可以按照 id 的嵌套关系来得到一个总的iframe 的 path 全路径，通过iframeXpath 这个字段即可定位到对应的iframe 以及iframe中的目标元素。\n\n#### 4. 注意\n\niframeXpath 与其他元素定位逻辑相同，统一查找逻辑，也存在动态性问题。\n\n# 构建crx/xpi 包说明\n\n### Chrome\n\n1. chrome 可以选择构建crx 插件包，推荐使用chrome developer dashboard 发布到chrome 插件商店，chrome 开发者账户需要收费，若不发布到插件商店，会被chrome 浏览器的限制启用，需要在安装插件时写入chrome://policy 政策   `ExtensionInstallAllowlist `  Windows 以注册表的方式 `Software\\Policies\\Google\\Chrome\\ExtensionInstallAllowlist` 写入白名单，Linux 写入方式  `/etc/opt/chrome/policies/managed/policy.json  ` 详细可见 [https://chromeenterprise.google/policies/?policy=ExtensionInstallAllowlist]()\n2. 不发布的打包方式：打开chrome浏览器，进入chrome://extensions/ 页， 启用开发者模式，选择打包扩展程序，浏览扩展程序根目录，第一次私钥文件可以不填，然后打包扩展程序，在扩展程序根目录就会生成一个对应的.crx 文件 和 .pem 密钥文件，.pem文件后续在更新插件包的时候需要使用，同一个密钥文件就会生成一样的插件id， 用于更新插件。\n\n### Firefox\n\n1. firefox 可以免费自行申请一个开发者账户，上传打包自己的插件xpi 文件，可以不发布，直接下载下xpi 文件亦可以安装。\n2. firefox 插件请自行打包，使用自己的开发者账户上传，构建自己的xpi 文件\n","isInternal":false,"tokens":1484,"sizeBytes":4585},{"name":"tsconfig.json","path":"frontend/packages/browser-plugin/tsconfig.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/browser-plugin/tsconfig.json","title":"Browser-plugin Skill","category":"anthropic-skill","format":"json","content":"{\n  \"compilerOptions\": {\n    \"target\": \"ES2023\",\n    \"types\": [\"chrome-types/_all.d.ts\"],\n    \"allowJs\": true,\n    \"rootDir\": \"src\",\n    \"outDir\": \"dist\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"noImplicitAny\": false,\n    \"strict\": false\n  },\n  \"include\": [\"src/*\", \"src/**/*\"],\n  \"exclude\": [\"node_modules\", \"dist\", \"src/3rd/*\", \"\"],\n  \"references\": [{ \"path\": \"./tsconfig.node.json\" }]\n}\n","frontmatter":{"compilerOptions":{"target":"ES2023","types":["chrome-types/_all.d.ts"],"allowJs":true,"rootDir":"src","outDir":"dist","module":"ESNext","moduleResolution":"bundler","noImplicitAny":false,"strict":false},"include":["src/*","src/**/*"],"exclude":["node_modules","dist","src/3rd/*",""],"references":[{"path":"./tsconfig.node.json"}]},"isInternal":false,"tokens":133,"sizeBytes":414},{"name":"tsconfig.node.json","path":"frontend/packages/browser-plugin/tsconfig.node.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/browser-plugin/tsconfig.node.json","title":"Browser-plugin Skill","category":"anthropic-skill","format":"json","content":"{\n  \"compilerOptions\": {\n    \"composite\": true,\n    \"skipLibCheck\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"allowSyntheticDefaultImports\": true\n  },\n  \"include\": [\"vite.config.mts\", \"manifest.ts\"]\n}\n","frontmatter":{"compilerOptions":{"composite":true,"skipLibCheck":true,"module":"ESNext","moduleResolution":"bundler","allowSyntheticDefaultImports":true},"include":["vite.config.mts","manifest.ts"]},"isInternal":false,"tokens":66,"sizeBytes":229},{"name":"package.json","path":"frontend/packages/cli/package.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/package.json","title":"Cli Skill","category":"anthropic-skill","format":"json","content":"# Cli Skill\n\nPath: `frontend/packages/cli/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/package.json)","tokens":300,"sizeBytes":179},{"name":"README.zh-CN.md","path":"frontend/packages/cli/README.zh-CN.md","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/README.zh-CN.md","title":"Cli Skill","category":"anthropic-skill","format":"markdown","content":"# Cli Skill\n\nPath: `frontend/packages/cli/README.zh-CN.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/README.zh-CN.md)","tokens":300,"sizeBytes":185},{"name":"package.json","path":"frontend/packages/cli/templates/template-vue/package.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/templates/template-vue/package.json","title":"Template-vue Skill","category":"anthropic-skill","format":"json","content":"# Template-vue Skill\n\nPath: `frontend/packages/cli/templates/template-vue/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/templates/template-vue/package.json)","tokens":300,"sizeBytes":234},{"name":"tsconfig.json","path":"frontend/packages/cli/templates/template-vue/tsconfig.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/templates/template-vue/tsconfig.json","title":"Template-vue Skill","category":"anthropic-skill","format":"json","content":"# Template-vue Skill\n\nPath: `frontend/packages/cli/templates/template-vue/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/templates/template-vue/tsconfig.json)","tokens":300,"sizeBytes":236},{"name":"tsconfig.json","path":"frontend/packages/cli/tsconfig.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/tsconfig.json","title":"Cli Skill","category":"anthropic-skill","format":"json","content":"# Cli Skill\n\nPath: `frontend/packages/cli/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/tsconfig.json)","tokens":300,"sizeBytes":181},{"name":"cdn-info.json","path":"frontend/packages/components/lib/cdn-info.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/lib/cdn-info.json","title":"Lib Skill","category":"anthropic-skill","format":"json","content":"# Lib Skill\n\nPath: `frontend/packages/components/lib/cdn-info.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/lib/cdn-info.json)","tokens":300,"sizeBytes":203},{"name":"package.json","path":"frontend/packages/components/package.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/package.json","title":"Components Skill","category":"anthropic-skill","format":"json","content":"# Components Skill\n\nPath: `frontend/packages/components/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/package.json)","tokens":300,"sizeBytes":200},{"name":"tsconfig.json","path":"frontend/packages/components/tsconfig.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/tsconfig.json","title":"Components Skill","category":"anthropic-skill","format":"json","content":"# Components Skill\n\nPath: `frontend/packages/components/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/tsconfig.json)","tokens":300,"sizeBytes":202},{"name":"electron-builder.json","path":"frontend/packages/electron-app/electron-builder.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/electron-builder.json","title":"Electron-app Skill","category":"anthropic-skill","format":"json","content":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/electron-builder.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/electron-builder.json)","tokens":300,"sizeBytes":224},{"name":"package.json","path":"frontend/packages/electron-app/package.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/package.json","title":"Electron-app Skill","category":"anthropic-skill","format":"json","content":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/package.json)","tokens":300,"sizeBytes":206},{"name":"tsconfig.json","path":"frontend/packages/electron-app/tsconfig.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.json","title":"Electron-app Skill","category":"anthropic-skill","format":"json","content":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.json)","tokens":300,"sizeBytes":208},{"name":"tsconfig.node.json","path":"frontend/packages/electron-app/tsconfig.node.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.node.json","title":"Electron-app Skill","category":"anthropic-skill","format":"json","content":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/tsconfig.node.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.node.json)","tokens":300,"sizeBytes":218},{"name":"tsconfig.web.json","path":"frontend/packages/electron-app/tsconfig.web.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.web.json","title":"Electron-app Skill","category":"anthropic-skill","format":"json","content":"# Electron-app Skill\n\nPath: `frontend/packages/electron-app/tsconfig.web.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.web.json)","tokens":300,"sizeBytes":216},{"name":"package.json","path":"frontend/packages/shared/package.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/shared/package.json","title":"Shared Skill","category":"anthropic-skill","format":"json","content":"# Shared Skill\n\nPath: `frontend/packages/shared/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/shared/package.json)","tokens":300,"sizeBytes":188},{"name":"tsconfig.json","path":"frontend/packages/shared/tsconfig.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/shared/tsconfig.json","title":"Shared Skill","category":"anthropic-skill","format":"json","content":"# Shared Skill\n\nPath: `frontend/packages/shared/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/shared/tsconfig.json)","tokens":300,"sizeBytes":190},{"name":"package.json","path":"frontend/packages/web-app/package.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/package.json","title":"Web-app Skill","category":"anthropic-skill","format":"json","content":"# Web-app Skill\n\nPath: `frontend/packages/web-app/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/package.json)","tokens":300,"sizeBytes":191},{"name":"tsconfig.json","path":"frontend/packages/web-app/tsconfig.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/tsconfig.json","title":"Web-app Skill","category":"anthropic-skill","format":"json","content":"# Web-app Skill\n\nPath: `frontend/packages/web-app/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/tsconfig.json)","tokens":300,"sizeBytes":193},{"name":"tsconfig.node.json","path":"frontend/packages/web-app/tsconfig.node.json","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/tsconfig.node.json","title":"Web-app Skill","category":"anthropic-skill","format":"json","content":"# Web-app Skill\n\nPath: `frontend/packages/web-app/tsconfig.node.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/tsconfig.node.json)","tokens":300,"sizeBytes":203},{"name":"README.md","path":"frontend/packages/auth-app/README.md","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/auth-app/README.md","title":"auth-app Documentation","category":"plugin-manifest","format":"markdown","content":"# Vue 3 + TypeScript + Vite\n\nThis template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.\n\nLearn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).\n","isInternal":false,"tokens":107,"sizeBytes":442},{"name":"README.md","path":"frontend/packages/browser-plugin/README.md","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/browser-plugin/README.md","title":"browser-plugin Documentation","category":"plugin-manifest","format":"markdown","content":"# English | [简体中文](./README.zh.md)\n\n# Repository Description\n\nThis repository is for the RPA browser plugin, which handles web-related automation.\n\n# Build Instructions\n\n- Build command: `npm run build` to package the universal extension for Chrome/Edge browsers\n- `npm run build:browser` is used to package the plugin for a specific browser. It supports any Chromium/Firefox-based browser variant. You only need to set `custom_agent` in `src/3rd/rpa_websocket.js` and add the corresponding command in `package.json`. The `browser` refers to the executable file name of the target browser.\n- Node version requirement: v20+\n\n# Feature Overview\n\n## 1. Deep Search Feature\n\nTo trigger deep search, you need to hover the mouse for more than 5 seconds. Deep search is designed to solve the problem of some elements being covered. However, for some uncovered elements, deep search may result in selecting an element that is not the one the user wants, so not all elements require deep search.\n\n### Implementation:\n\nBy using `document.elementsFromPoint(x, y)` to get all elements under the mouse coordinates (x, y), then for each element, calculate the distance from its left, top, right, and bottom to the target (x, y), and find the closest element. If there are multiple results, take the first one.\n\n### Recursive shadowRoot Element Retrieval\n\nSee the `shadowRootElement` function for details. It recursively checks if an element is a shadowRoot element. If so, it continues to search within the shadowRoot until a normal element is found. The path is concatenated with `$shadow$` for easy identification. When retrieving elements by path, `$shadow$` is also recognized, and the function `getElementBySelector` is used to find the target element. Currently, shadowRoot elements only support CSS selectors, not XPath selectors.\n\n### Frame Positioning Feature\n\n#### Unified Handling for Cross-origin/Same-origin iframe Elements\n\n##### 1. Cross-origin iframe Handling\n\nIn cross-origin iframes, due to the same-origin policy and the fact that iframe src can be fixed but the URL may change, and there may be identical src iframes in the same tab, finding the desired iframe by src is inaccurate. The solution is to obtain the nesting relationship (parentFrameId) from the plugin's main process, get the nesting order, and then, by passing the x, y coordinates and the nesting order, search layer by layer. The x, y coordinates are also reduced layer by layer by the iframe's position and box model (borderLeft, paddingLeft) to get the accurate position in the iframe content. See the `getIframeElement` function in backgroundInject and contentInject for details.\n\n##### 2. Same-origin iframe Handling\n\nSame as above. Although the same-origin restriction is less strict, using the same method avoids redundancy, reduces variables, and minimizes errors.\n\n##### 3. iframe Element Positioning\n\nIn content, all frame elements in the current window are marked, and the iframe's XPath is sent to the corresponding iframe via `iframe.contentWindow.postMessage`. The iframe receives the XPath via `window.addEventListener('message', function(e) { })` and sends it to the main process. This binds the iframe's XPath to its id. Thus, the full iframe path can be obtained according to the id nesting relationship, and the target element in the iframe can be located via the `iframeXpath` field.\n\n##### 4. Note\n\nThe logic for locating iframeXpath is the same as for other elements, and there are also dynamic issues.\n\n# Building crx/xpi Packages\n\n### Chrome\n\n1. Chrome can build crx plugin packages. It is recommended to use the Chrome Developer Dashboard to publish to the Chrome Web Store. A developer account is required (paid). If not published to the store, Chrome will restrict enabling the plugin. You need to add the plugin to the whitelist via the `chrome://policy` policy. On Windows, add to the registry at `Software\\Policies\\Google\\Chrome\\ExtensionInstallAllowlist`. On Linux, add to `/etc/opt/chrome/policies/managed/policy.json`. See [https://chromeenterprise.google/policies/?policy=ExtensionInstallAllowlist]() for details.\n2. For unpublished packaging: Open Chrome, go to chrome://extensions/, enable Developer Mode, select 'Pack extension', browse to the extension root directory. The first time, you can leave the private key file blank. After packing, a .crx file and a .pem key file will be generated in the root directory. The .pem file is needed for future updates. Using the same key file will generate the same plugin id for updates.\n\n### Firefox\n\n1. You can apply for a free developer account on Firefox, upload your packaged xpi file, and install it directly without publishing.\n2. Please package the Firefox extension yourself, upload it using your own developer account, and build your own XPI file.\n","isInternal":false,"tokens":1027,"sizeBytes":4817},{"name":"README.md","path":"frontend/packages/cli/README.md","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/README.md","title":"cli Documentation","category":"plugin-manifest","format":"markdown","content":"# cli Documentation\n\nPath: `frontend/packages/cli/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/README.md)","tokens":300,"sizeBytes":181},{"name":"README.md","path":"frontend/packages/components/README.md","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/README.md","title":"components Documentation","category":"plugin-manifest","format":"markdown","content":"# components Documentation\n\nPath: `frontend/packages/components/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/README.md)","tokens":300,"sizeBytes":202},{"name":"README.md","path":"frontend/packages/components/src/components/Sheet/luckyexcel/README.md","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/src/components/Sheet/luckyexcel/README.md","title":"luckyexcel Documentation","category":"plugin-manifest","format":"markdown","content":"# luckyexcel Documentation\n\nPath: `frontend/packages/components/src/components/Sheet/luckyexcel/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/src/components/Sheet/luckyexcel/README.md)","tokens":300,"sizeBytes":266},{"name":"README.md","path":"frontend/packages/electron-app/README.md","rawUrl":"https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/README.md","title":"electron-app Documentation","category":"plugin-manifest","format":"markdown","content":"# electron-app Documentation\n\nPath: `frontend/packages/electron-app/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/README.md)","tokens":300,"sizeBytes":208}],"systemPromptSnippet":"<yakaai_skills repo=\"iflytek/astron-rpa\">\n<!-- File: AGENTS.md (Tokens: ~1353 | Category: root-instruction) -->\n# AGENTS.md\n\nGuidance for AI coding agents working in the **astron-rpa** (AstronRPA)\nrepository — an agent-ready RPA suite with out-of-the-box automation tools for\ndesktop applications, web systems, and business-process automation.\n\nAstronRPA uses a **server–client** architecture: server components run via\nDocker, and the client (RPA engine + desktop app) is packaged and run on the\nmachine that executes RPA tasks. The client toolchain is Windows-first.\n\n## Project layout\n\nThis is a multi-language monorepo driven by a unified `Makefile` (with modular\nincludes under `makefiles/`).\n\n- `backend/` — server-side microservices (deployed via Docker Compose):\n  - `robot-service/`, `resource-service/`, `rpa-auth/` — Java / Spring Boot\n    services (Maven; each ships `checkstyle.xml`, `pmd-ruleset.xml`,\n    `spotbugs-exclude.xml`).\n  - `ai-service/`, `openapi-service/` — Python services (managed with `uv`).\n- `engine/` — the Python RPA execution engine (managed with `uv`, linted with\n  `ruff`): `main.py`, `components/` (RPA components), `servers/`, `shared/`.\n- `frontend/` — pnpm workspace monorepo (Vue 3 + TypeScript, Vitest, ESLint,\n  i18n under `locales/`). Notable packages under `frontend/packages/`:\n  `electron-app` (desktop client), `web-app` (web console), `browser-plugin`,\n  `auth-app`, `cli`, `components`, `shared`.\n- `docker/` — Docker Compose manifests for the server stack.\n- `makefiles/` — modular Make components (`common.mk`, `python.mk`, `java.mk`,\n  `typescript.mk`, `go.mk`, `git.mk`).\n- `resources/` — packaged client resources. `docs/`, `FAQ.md`, `BUILD_GUIDE.md`\n  — documentation.\n\n## Toolchain\n\n- **Python 3.13.x** + **uv 0.8+** — RPA engine and Python services.\n- **Node.js 22+** + **pnpm 9+** — frontend workspace.\n- **Java JDK 8+** + **Maven** — Java backend services.\n- **Docker & Docker Compose** — server deployment.\n- Windows client packaging also needs **SWIG** (Python↔C/C++ bindings, e.g.\n  `pywinhook`) and **7-Zip** (deployment archives). See `BUILD_GUIDE.md`.\n\n## Common commands\n\nQuality and git workflow are driven by the root `Makefile` (run `make help` to\nsee detected projects and targets):\n\n- `make install-tools` — install the formatting/linting toolchain.\n- `make fmt` — format across languages (`fmt-python`, `fmt-java`, `fmt-ts`, …).\n- `make check` (alias `make lint`) — format check + linters\n  (`check-python`, `check-java`, `check-ts`, …). CI is check-only; it does not\n  auto-fix.\n- `make new-feature name=<short-name>` / `make new-bugfix name=<short-name>` —\n  branch helpers following the project's branch strategy.\n\nPre-commit hooks (install with `pre-commit install`) format the engine with\nruff: `uv run --project engine --dev ruff format ./engine`.\n\n### Run the server (Docker)\n\n```bash\ncd docker\ncp .env.example .env\n# configure the public HTTPS names and copy the certificate/key to docker/certs/\n# see docker/HTTPS_DEPLOYMENT.md for required variables\ndocker compose up -d mysql casdoor\n# wait for Casdoor initialization, then synchronize this deployment's credentials\npython3 scripts/sync-casdoor-credentials.py\ndocker compose up -d\ndocker compose ps\n```\n\nGateway API: https://localhost · Casdoor auth: https://localhost:8443\n\n### Build the client (Windows)\n\n```bash\n# full build (engine + frontend desktop app) from the repo root\n./build.bat --python-exe \"C:\\Program Files\\Python313\\python.exe\"\n./build.bat --skip-frontend   # engine only\n./build.bat --skip-engine     # frontend only\n```\n\nThe packaged installer is written to `frontend/packages/electron-app/dist/`.\n\n### Frontend (pnpm workspace, from `frontend/`)\n\n```bash\npnpm install\npnpm dev:web         # run the web console in dev\npnpm dev:desktop     # run the desktop app in dev\npnpm build:desktop   # build the Windows desktop app\n```\n\n## Testing instructions\n\nThere is no aggregate `make test`; run tests per component:\n\n- **Frontend**: `pnpm test` (Vitest) or `pnpm test:run` for a single run.\n- **Python** (`engine`, `backend/ai-service`, `backend/openapi-service`):\n  `uv run pytest` within the project where tests exist (e.g. `backend/ai-service`\n  has a `tests/` directory).\n- **Java** (`backend/robot-service`, `resource-service`, `rpa-auth`):\n  `mvn test` within the service directory.\n\nRun `make check` and the relevant tests before opening a PR, and add or update\ntests for code you change.\n\n## Code style\n\nFormatting and linting are wired through `make fmt` / `make check`:\n\n| Language        | Format / Lint                                                        |\n| --------------- | -------------------------------------------------------------------- |\n| Python          | `ruff` format + `ruff` check (see `engine/.ruff.toml`)               |\n| Java            | Checkstyle + PMD + SpotBugs (per-service configs)                     |\n| TypeScript/Vue  | ESLint (`frontend/eslint.config.mjs`); `pnpm lint` / `pnpm lint:fix` |\n\n## PR instructions\n\n- Create branches with the Make helpers (`make new-feature name=<…>`).\n- Run `make check` and the relevant component tests before committing; make sure\n  pre-commit hooks pass.\n- Keep PRs focused and write clear, conventional commit messages.\n- For build and deployment details, see `BUILD_GUIDE.md`.\n\n<!-- File: engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Chromium-extension Skill\n\nPath: `engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/chromium-extension/manifest.json)\n\n<!-- File: engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Plugins Skill\n\nPath: `engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/engine/shared/astronverse-browser-plugin/src/astronverse/browser_plugin/plugins/policy.json)\n\n<!-- File: frontend/packages/auth-app/package.json (Tokens: ~229 | Category: anthropic-skill) -->\n{\n  \"name\": \"@rpa/auth-app\",\n  \"private\": true,\n  \"version\": \"0.0.0\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"vite\",\n    \"build\": \"vue-tsc -b && vite build\",\n    \"preview\": \"vite preview\"\n  },\n  \"dependencies\": {\n    \"@rpa/components\": \"workspace:*\",\n    \"@rpa/shared\": \"workspace:*\",\n    \"vue\": \"catalog:\"\n  },  \n  \"devDependencies\": {\n    \"@types/node\": \"^24.10.0\",\n    \"@vitejs/plugin-vue\": \"catalog:\",\n    \"@vitejs/plugin-vue-jsx\": \"catalog:\",\n    \"vite-plugin-svg4vue\": \"^4.5.1\",\n    \"@vue/tsconfig\": \"^0.8.1\",\n    \"tailwindcss\": \"^3.4.4\",\n    \"typescript\": \"~5.9.3\",\n    \"vite\": \"catalog:\",\n    \"vue-tsc\": \"^3.1.3\"\n  }\n}\n\n<!-- File: frontend/packages/auth-app/tsconfig.app.json (Tokens: ~174 | Category: anthropic-skill) -->\n{\n  \"extends\": \"@vue/tsconfig/tsconfig.dom.json\",\n  \"compilerOptions\": {\n    \"tsBuildInfoFile\": \"./node_modules/.tmp/tsconfig.app.tsbuildinfo\",\n    \"types\": [\"vite/client\"],\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"@/*\": [\"./src/*\"]\n    },\n\n    /* Linting */\n    \"strict\": true,\n    \"noUnusedLocals\": false,\n    \"noUnusedParameters\": false,\n    \"erasableSyntaxOnly\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"noUncheckedSideEffectImports\": true\n  },\n  \"include\": [\"src/**/*.ts\", \"src/**/*.tsx\", \"src/**/*.vue\", \"../components/src/components/LaunchCarousel/LaunchCarousel.vue\", \"../components/src/components/LaunchCarousel/launch.ts\"]\n}\n\n<!-- File: frontend/packages/auth-app/tsconfig.json (Tokens: ~38 | Category: anthropic-skill) -->\n{\n  \"files\": [],\n  \"references\": [\n    { \"path\": \"./tsconfig.app.json\" },\n    { \"path\": \"./tsconfig.node.json\" }\n  ]\n}\n\n<!-- File: frontend/packages/auth-app/tsconfig.node.json (Tokens: ~188 | Category: anthropic-skill) -->\n{\n  \"compilerOptions\": {\n    \"tsBuildInfoFile\": \"./node_modules/.tmp/tsconfig.node.tsbuildinfo\",\n    \"target\": \"ES2023\",\n    \"lib\": [\"ES2023\"],\n    \"module\": \"ESNext\",\n    \"types\": [\"node\"],\n    \"skipLibCheck\": true,\n\n    /* Bundler mode */\n    \"moduleResolution\": \"bundler\",\n    \"allowImportingTsExtensions\": true,\n    \"verbatimModuleSyntax\": true,\n    \"moduleDetection\": \"force\",\n    \"noEmit\": true,\n\n    /* Linting */\n    \"strict\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"erasableSyntaxOnly\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"noUncheckedSideEffectImports\": true\n  },\n  \"include\": [\"vite.config.ts\"]\n}\n\n<!-- File: frontend/packages/browser-plugin/API.md (Tokens: ~6264 | Category: anthropic-skill) -->\n<!-- @format -->\n\n# Astron Browser Plugin API 文档\n\n## 1. 概述\n\n- **插件简介**：Astron Browser Plugin是Astron RPA 在web自动化的重要组成部分，为Astron RPA提供Chrome/Edge/Firefox 等浏览器提供网页自动化能力\n- **主要特性**：\n\n* 浏览器Tab 页操作\n* 网页元素操作\n* Cookie 操作\n* 脚本注入操作\n* iframe 操作\n\n- **版本信息**：5.2.11\n\n## 2. 快速开始\n\n- **安装**：npm run build 打包后使用浏览器插件管理加载插件\n- **基础配置**：Chrome 浏览器，node 环境推荐 node版本 v20+\n\n## 3. API 参考\n\n- **接口：http://127.0.0.1:{port}/browser/transition** 默认port: 9082\n- **类型：POST**\n- **请求体:application/json**\n\n```json\n{\n  \"browser_type\": \"chrome\", // firefox, edge ...\n  \"data\": {\n    \"x\": 854, \"y\": 314\n  },\n  \"key\": \"getElement\"\n}\n```\n\n### 3.1 支持的API列表\n\n#### Tab 页操作 (Tab Operations)\n\n- `reloadTab` - 刷新当前标签页\n- `stopLoad` - 停止加载\n- `openNewTab` - 打开新标签页\n- `closeTab` - 关闭标签页\n- `updateTab` - 更新标签页 URL\n- `activeTab` - 激活标签页\n- `getActiveTab` - 获取活跃标签页\n- `switchTab` - 切换到指定标签页\n- `getAllTabs` - 获取所有标签页\n- `backward` - 后退\n- `forward` - 前进\n- `maxWindow` - 最大化窗口\n- `minWindow` - 最小化窗口\n- `getTitle` - 获取标签页标题\n- `getUrl` - 获取标签页 URL\n- `captureScreen` - 网页可视区域截图\n- `capturePage` - 截取全部网页\n- `loadComplete` - 判断网页是否加载完成\n- `getFrames` - 获取所有帧\n- `getExtFrames` - 获取扩展帧\n- `resetZoom` - 重置缩放\n- `getTabId` - 获取标签页 ID\n- `getFrameTree` - 获取帧树\n- `printPage` - 打印页面\n\n#### 元素操作 (Element Operations)\n\n- `getElement` - 获取元素信息\n- `getElementPos` - 获取元素绝对位置\n- `checkElement` - 校验元素\n- `getOuterHTML` - 获取元素 HTML\n- `scrollIntoView` - 滚动到可视区域\n- `scrollToTop` - 滚动到顶部\n- `elementIsRender` - 等待元素渲染\n- `elementIsReady` - 元素是否准备好（包含页面状态）\n\n#### 元素属性操作 (Element Attribute Operations)\n\n- `getElementText` - 获取元素文本\n- `getElementAttrs` - 获取元素属性\n- `setElementAttr` - 设置元素属性\n- `removeElementAttr` - 移除元素属性\n- `getElementChecked` - 获取元素 checked 状态\n- `setElementChecked` - 设置元素 checked 状态\n- `getElementSelected` - 获取元素 selected 状态\n- `setElementSelected` - 设置元素 selected 状态\n\n#### 元素交互 (Element Interaction)\n\n- `clickElement` - 点击元素\n- `inputElement` - 输入内容\n\n#### 元素选择与导航 (Element Selection & Navigation)\n\n- `similarElement` - 获取相似元素\n- `elementFromSelect` - 通过选择条件获取元素\n- `getSimilarIterator` - 相似元素迭代\n- `getParentElement` - 获取父元素（扩大选区）\n- `getChildElement` - 获取子元素（缩小选区）\n- `getRelativeElement` - 获取关联元素（parent/sibling/child）\n- `generateElement` - 通过 xpath/cssSelector/text 生成元素\n\n#### 数据抓取 (Data Extraction)\n\n- `elementIsTable` - 判断元素是否为表格\n- `tableDataBatch` - 批量抓取表格数据\n- `tableColumnDataBatch` - 批量抓取表格单列数据\n- `tableHeaderBatch` - 批量抓取表头数据\n- `similarBatch` - 批量抓取相似元素数据\n- `simalarListBatch` - 批量抓取相似元素列表\n- `highLightColumn` - 高亮列\n- `getBatchData` - 获取批量数据\n- `scrollWindow` - 滚动窗口\n- `elementShot` - 元素截图\n- `getTableData` - 获取表格数据\n\n#### JavaScript 执行 (JavaScript Execution)\n\n- `runJS` - 注入并执行 JavaScript 代码\n\n#### Cookie 操作 (Cookie Operations)\n\n- `getCookie` - 获取 cookie\n- `setCookies` - 设置 cookie\n- `removeCookie` - 删除 cookie\n\n#### 调试器控制 (Debugger Control)\n\n- `startDebugger` - 启动调试器\n- `stopDebugger` - 停止调试器\n\n#### 网络监听 (Network Monitoring)\n\n- `getRequestInterceptionFilters` - 获取请求拦截过滤器\n- `setRequestInterceptionFilters` - 设置请求拦截过滤器\n- `addRequestInterceptionFilter` - 添加请求拦截过滤器\n- `removeRequestInterceptionFilter` - 移除请求拦截过滤器\n- `startDebugNetworkListen` - 启动网络监听\n- `stopDebugNetworkListen` - 停止网络监听\n- `getDebugNetworkData` - 获取网络监听数据\n- `clearDebugNetworkData` - 清除网络监听数据\n\n#### 其他操作 (Other Operations)\n\n- `currentExtension` - 获取插件信息\n- `backgroundInject` - 后台注入检查 `deprecated`\n- `contentInject` - 内容注入检查 `deprecated`\n\n### 3.2 响应格式\n\n- **返回体:application/json**\n\n```json\n{\n  \"code\": \"0000\", // background code \n  \"msg\": \"ok\",\n  \"data\": {\n    \"code\": \"0000\", // content code \n    \"data\": {\n      \"matchTypes\": [],\n      \"checkType\": \"visualization\",\n      \"xpath\": \"//textarea[@id=\\\"APjFqb\\\"]\",\n      \"cssSelector\": \"#APjFqb\",\n      \"pathDirs\": [\n        {\n          \"tag\": \"textarea\",\n          \"checked\": true,\n          \"value\": \"textarea\",\n          \"attrs\": [\n            {\n              \"name\": \"id\",\n              \"value\": \"APjFqb\",\n              \"checked\": true,\n              \"type\": 0\n            },\n            {\n              \"name\": \"class\",\n              \"value\": \"gLFyf\",\n              \"checked\": false,\n              \"type\": 1\n            },\n            {\n              \"name\": \"title\",\n              \"value\": \"Google 搜索\",\n              \"checked\": false,\n              \"type\": 0\n            }\n          ]\n        }\n      ],\n      \"rect\": {\n        \"left\": 594,\n        \"top\": 268,\n        \"width\": 672,\n        \"height\": 75,\n        \"right\": 1265,\n        \"bottom\": 343,\n        \"x\": 594,\n        \"y\": 268\n      },\n      \"url\": \"https://www.google.com.hk/\",\n      \"shadowRoot\": false,\n      \"tag\": \"输入域\",\n      \"text\": \"unknown\",\n      \"tabTitle\": \"Google\",\n      \"tabUrl\": \"https://www.google.com.hk/\",\n      \"isFrame\": false,\n      \"frameId\": 0\n    },\n    \"msg\": \"success\"\n  }\n}\n```\n\n### 3.3 API 使用示例\n\n#### Tab 页操作示例\n\n```json\n// 获取活跃标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getActiveTab\"\n}\n\n// 打开新标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://www.baidu.com/\" },\n    \"key\": \"openNewTab\"\n}\n\n// 获取标签页 URL\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getUrl\"\n}\n\n// 获取标签页 title\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getTitle\"\n}\n\n// 刷新标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"reloadTab\"\n}\n\n// 停止加载\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"stopLoad\"\n}\n\n// 最大化窗口\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"maxWindow\"\n}\n\n// 最小化窗口\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"minWindow\"\n}\n\n// 后退\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"backward\"\n}\n\n// 前进\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"forward\"\n}\n\n// 关闭标签页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://developer.mozilla.org/zh-CN/plus\" },\n    \"key\": \"closeTab\"\n}\n\n// 切换到指定标签页（通过URL）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://developer.mozilla.org/zh-CN/plus\" },\n    \"key\": \"switchTab\"\n}\n\n// 切换到指定标签页（通过标题）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"title\": \"MDN Plus\" },\n    \"key\": \"switchTab\"\n}\n\n// 更新标签页 URL\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"url\": \"https://www.abc.com\" },\n    \"key\": \"updateTab\"\n}\n\n// 网页可视区域截图\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"captureScreen\"\n}\n\n// 截取全部网页\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"capturePage\"\n}\n\n// 页面是否加载完成\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"loadComplete\"\n}\n\n// 获取所有帧\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getFrames\"\n}\n\n// 获取帧树\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getFrameTree\"\n}\n\n// 重置缩放\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"resetZoom\"\n}\n\n// 打印页面\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"orientation\": \"portrait\",\n        \"margins\": { \"left\": 0, \"top\": 0, \"right\": 0, \"bottom\": 0 }\n    },\n    \"key\": \"printPage\"\n}\n```\n\n#### JavaScript 执行示例\n\n```json\n// 注入并执行 JavaScript\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"code\": \"console.log(1);return 1\",\n        \"url\": \"http://192.168.56.1:9010/aa/2.html?a=1\",\n        \"tabUrl\": \"http://192.168.56.1:9010/1.html\",\n        \"iframeXpath\": \"html/body/div[1]/iframe/html/body/div/button\",\n        \"isFrame\": true\n    },\n    \"key\": \"runJS\"\n}\n```\n\n#### 元素选择和获取示例\n\n```json\n// 获取元素信息\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"x\": 854, \"y\": 314 },\n    \"key\": \"getElement\"\n}\n\n// 获取元素绝对位置\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div/div/div[3]\",\n        \"cssSelector\": \"#app>div.arrange>div:nth-child(1)>div:nth-child(3)\"\n    },\n    \"key\": \"getElementPos\"\n}\n\n// 校验元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"checkElement\"\n}\n\n// 滚动元素到可视区域\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"scrollIntoView\"\n}\n\n// 等待元素渲染\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"elementIsRender\"\n}\n\n// 元素是否准备好（包含页面状态）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"container\\\"]/div[3]/div[2]/div/div[2]/div[1]/p[23]\",\n        \"cssSelector\": \"p:nth-child(23)\"\n    },\n    \"key\": \"elementIsReady\"\n}\n\n// 获取元素 HTML\n{\n    \"browser_type\": \"chrome\",\n    \"data\": { \"x\": 0, \"y\": 0 },\n    \"key\": \"getOuterHTML\"\n}\n\n// 获取相似元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//ul[@id=\\\"hotsearch-content-wrapper\\\"]/li[2]/a/span[2]\",\n        \"cssSelector\": \"#hotsearch-content-wrapper>li:nth-child(2)>a:nth-child(1)>span:nth-child(4)\"\n    },\n    \"key\": \"similarElement\"\n}\n\n// 通过选择条件获取元素信息\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/div[1]/div[1]/section[5]/section[1]/div/div/button/span\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div>div:nth-child(2)>section:nth-child(1)>article>div:nth-child(3)>div:nth-child(1)>section:nth-child(5)>section:nth-child(1)>div>div>button>span\"\n    },\n    \"key\": \"elementFromSelect\"\n}\n\n// 获取父元素（扩大选区）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"spa-mount-point\\\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div/div\",\n        \"cssSelector\": \"#spa-mount-point>div>div.ent-resource>div>div.ent-resource-main>div.ent-resource-body>div.branch-tabs-wrap>div.tabs-container>div.branch-tabs>div.el-tabs__header>div>div\"\n    },\n    \"key\": \"getParentElement\"\n}\n\n// 获取子元素（缩小选区）\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"spa-mount-point\\\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div/div\",\n        \"cssSelector\": \"#spa-mount-point>div>div.ent-resource>div>div.ent-resource-main>div.ent-resource-body>div.branch-tabs-wrap>div.tabs-container>div.branch-tabs>div.el-tabs__header>div>div\",\n        \"originXpath\": \"/html/body/div/section/section/main/div/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div/div\"\n    },\n    \"key\": \"getChildElement\"\n}\n\n// 通过 xpath/cssSelector/text 生成元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"type\": \"xpath\",\n        \"value\": \"//div\",\n        \"returnType\": \"single\"\n    },\n    \"key\": \"generateElement\"\n}\n\n// 获取关联元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"element\\\"]\",\n        \"relativeOptions\": {\n            \"relativeType\": \"child\",\n            \"elementGetType\": \"index\",\n            \"index\": 1\n        }\n    },\n    \"key\": \"getRelativeElement\"\n}\n\n// 相似元素迭代\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"index\": 0,\n        \"count\": 5,\n        \"xpath\": \"//nav[@id=\\\"nav\\\"]/ul/li[24]/ul/li/a\",\n        \"cssSelector\": \"#nav>ul>li:nth-child(24)>ul>li>a\"\n    },\n    \"key\": \"getSimilarIterator\"\n}\n```\n\n#### 元素属性操作示例\n\n```json\n// 获取元素文本\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"getElementText\"\n}\n\n// 获取元素属性\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\"\n    },\n    \"key\": \"getElementAttrs\"\n}\n\n// 设置元素属性\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\",\n        \"attrName\": \"data-value\",\n        \"attrValue\": \"test\"\n    },\n    \"key\": \"setElementAttr\"\n}\n\n// 移除元素属性\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"abc\\\"]\",\n        \"cssSelector\": \"#abc\",\n        \"attrName\": \"data-value\"\n    },\n    \"key\": \"removeElementAttr\"\n}\n\n// 获取 checked 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//input[@id=\\\"checkbox\\\"]\",\n        \"cssSelector\": \"#checkbox\"\n    },\n    \"key\": \"getElementChecked\"\n}\n\n// 设置 checked 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//input[@id=\\\"checkbox\\\"]\",\n        \"cssSelector\": \"#checkbox\",\n        \"checked\": true\n    },\n    \"key\": \"setElementChecked\"\n}\n\n// 获取 selected 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//option[@value=\\\"option1\\\"]\",\n        \"cssSelector\": \"option[value='option1']\"\n    },\n    \"key\": \"getElementSelected\"\n}\n\n// 设置 selected 状态\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//option[@value=\\\"option1\\\"]\",\n        \"cssSelector\": \"option[value='option1']\",\n        \"selected\": true\n    },\n    \"key\": \"setElementSelected\"\n}\n```\n\n#### 元素交互示例\n\n```json\n// 点击元素\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//button[@id=\\\"submit\\\"]\",\n        \"cssSelector\": \"#submit\"\n    },\n    \"key\": \"clickElement\"\n}\n\n// 输入内容\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//input[@id=\\\"username\\\"]\",\n        \"cssSelector\": \"#username\",\n        \"text\": \"test_input\"\n    },\n    \"key\": \"inputElement\"\n}\n```\n\n#### Cookie 操作示例\n\n```json\n// 获取 Cookie\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"url\": \"http://localhost:1420/\",\n        \"name\": \"JSESSIONID\"\n    },\n    \"key\": \"getCookie\"\n}\n\n// 设置 Cookie\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"url\": \"http://localhost:1420/\",\n        \"name\": \"JSESSIONID\",\n        \"value\": \"123\"\n    },\n    \"key\": \"setCookies\"\n}\n\n// 删除 Cookie\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"url\": \"http://localhost:1420/\",\n        \"name\": \"JSESSIONID\"\n    },\n    \"key\": \"removeCookie\"\n}\n```\n\n#### 数据抓取示例\n\n```json\n// 判断元素是否为表格\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//table[@id=\\\"dataTable\\\"]\",\n        \"cssSelector\": \"#dataTable\"\n    },\n    \"key\": \"elementIsTable\"\n}\n\n// 批量抓取表格数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/section[3]/table[1]/tbody/tr[5]/td[1]\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div.ant-row.css-9loccf>div:nth-child(2)>section:nth-child(1)>article>section:nth-child(4)>table:nth-child(4)>tbody>tr:nth-child(5)>td:nth-child(1)\"\n    },\n    \"key\": \"tableDataBatch\"\n}\n\n// 批量抓取表格单列数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/section[3]/table[1]/tbody/tr[5]/td[1]\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div.ant-row.css-9loccf>div:nth-child(2)>section:nth-child(1)>article>section:nth-child(4)>table:nth-child(4)>tbody>tr:nth-child(5)>td:nth-child(1)\"\n    },\n    \"key\": \"tableColumnDataBatch\"\n}\n\n// 批量抓取相似元素数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"app\\\"]/div[2]/div/div[2]/section[1]/article/section[3]/table[1]/tbody/tr[5]/td[1]\",\n        \"cssSelector\": \"#app>div:nth-child(3)>div.ant-row.css-9loccf>div:nth-child(2)>section:nth-child(1)>article>section:nth-child(4)>table:nth-child(4)>tbody>tr:nth-child(5)>td:nth-child(1)\"\n    },\n    \"key\": \"similarBatch\"\n}\n\n// 元素截图\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"xpath\": \"//div[@id=\\\"container\\\"]/div[3]/div[2]/div/div[2]/div[1]/p[23]\",\n        \"cssSelector\": \"p:nth-child(23)\"\n    },\n    \"key\": \"elementShot\"\n}\n\n// 滚动窗口\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"scrollX\": 0,\n        \"scrollY\": 100\n    },\n    \"key\": \"scrollWindow\"\n}\n```\n\n#### 调试器和网络监听示例\n\n```json\n// 启动调试器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"startDebugger\"\n}\n\n// 停止调试器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"stopDebugger\"\n}\n\n// 获取请求拦截过滤器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getRequestInterceptionFilters\"\n}\n\n// 设置请求拦截过滤器\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"filters\": [\n            { \"urlPattern\": \".*\\\\.js$\", \"pathPattern\": \"static\" }\n        ]\n    },\n    \"key\": \"setRequestInterceptionFilters\"\n}\n\n// 启动网络监听\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {\n        \"filters\": [\n            { \"urlPattern\": \".*api.*\", \"pathPattern\": \"\" }\n        ]\n    },\n    \"key\": \"startDebugNetworkListen\"\n}\n\n// 停止网络监听\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"stopDebugNetworkListen\"\n}\n\n// 获取网络监听数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"getDebugNetworkData\"\n}\n\n// 清除网络监听数据\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"clearDebugNetworkData\"\n}\n```\n\n#### 其他操作示例\n\n```json\n// 获取插件信息\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"currentExtension\"\n}\n\n// 后台注入检查\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"backgroundInject\"\n}\n\n// 内容注入检查\n{\n    \"browser_type\": \"chrome\",\n    \"data\": {},\n    \"key\": \"contentInject\"\n}\n```\n\n## 4. 调用示例\n\n```\ncurl -X POST 'http://127.0.0.1:9082/browser/transition' -H 'User-Agent: Reqable/2.30.3' -H 'Content-Type: application/json' -d '{\n  \"browser_type\": \"<<bt>>\",\n  \"data\": {\n    \"x\": 0,\n    \"y\": 0\n  },\n  \"key\": \"getElement\"\n}'\n```\n\n## 5. 高级配置与集成\n\n针对市面常见浏览器，可自行适配对应的浏览器名称与token，一般为浏览器可执行文件的文件名称\n\n## 6. 注意事项\n\n- 插件通信依靠Astron RPA 客户端服务，请先打开Astron RPA 客户端\n- 插件通信依靠注册的token,token 会编码，例如Chrome 浏览器 token=`$chrome$`\n\n## 7. 常见问题解答\n\n- 不同浏览器使用插件执行时需要对应能力支持该浏览器。\n\n## 8. 附录\n\n- **错误码列表**：\n\n```\n  SUCCESS = '0000', // 成功\n  UNKNOWN_ERROR = '5001', // 未知异常\n  ELEMENT_NOT_FOUND = '5002', // 元素未找到\n  EXECUTE_ERROR = '5003', // 执行错误\n  VERSION_ERROR = '5004', // 版本错误\n```\n\n<!-- File: frontend/packages/browser-plugin/package.json (Tokens: ~454 | Category: anthropic-skill) -->\n{\n  \"name\": \"@rpa/extension\",\n  \"displayName\": \"RPA-Browser-Plugin\",\n  \"version\": \"5.2.12\",\n  \"description\": \"RPA browser plugin\",\n  \"homepage\": \"\",\n  \"type\": \"commonjs\",\n  \"keywords\": [],\n  \"license\": \"ISC\",\n  \"author\": \"\",\n  \"main\": \"background.js\",\n  \"scripts\": {\n    \"tsc\" : \"tsc --noEmit\",\n    \"test\": \"vitest\",\n    \"build\": \"cross-env BUILD_ENTRY=background vite build && cross-env BUILD_ENTRY=content vite build\",\n    \"build:firefox\": \"cross-env BUILD_ENTRY=background vite build --mode=firefox && cross-env BUILD_ENTRY=content vite build --mode=firefox\",\n    \"build:chromium\": \"cross-env BUILD_ENTRY=background vite build --mode=chromium && cross-env BUILD_ENTRY=content vite build --mode=chromium\",\n    \"test:browser\": \"vitest --config=vitest.browser.config.js\",\n    \"coverage\": \"vitest --config=vitest.browser.config.js run --coverage\",\n    \"build:all\": \"npm run build && npm run build:firefox && npm run build:chromium\",\n    \"lint:fix\": \"eslint --fix \\\"**/*.{ts,js}\\\"\"\n  },\n  \"devDependencies\": {\n    \"@babel/cli\": \"^7.25.6\",\n    \"@babel/core\": \"^7.25.2\",\n    \"@babel/preset-env\": \"^7.25.4\",\n    \"@types/archiver\": \"^6.0.3\",\n    \"@vitest/browser\": \"^3.2.4\",\n    \"@vitest/coverage-v8\": \"^3.2.4\",\n    \"ai-motion\": \"^0.4.8\",\n    \"archiver\": \"^7.0.1\",\n    \"chrome-types\": \"^0.1.290\",\n    \"cross-env\": \"^7.0.3\",\n    \"jsdom\": \"^27.0.0\",\n    \"vite\": \"^5.4.21\",\n    \"vitest\": \"^3.2.4\"\n  }\n}\n\n<!-- File: frontend/packages/browser-plugin/public/manifest.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Public Skill\n\nPath: `frontend/packages/browser-plugin/public/manifest.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/browser-plugin/public/manifest.json)\n\n<!-- File: frontend/packages/browser-plugin/README.zh.md (Tokens: ~1484 | Category: anthropic-skill) -->\n# 简体中文 | [English](./README.md)\n\n# 仓库说明\n\n本仓库为RPA浏览器插件仓库，处理网页相关自动化\n\n# 打包说明\n\n- 打包命令：`npm run build` 即可打包 Chrome/Edge 浏览器通用插件\n- npm run build:`browser` 为打包成对应浏览器的插件，可以是任何Chromium/Firefox 内核的变体浏览器，只需要在`src/3rd/rpa_websocket.js` 中设置 custom_agent，`package.json` 中添加命令即可，`browser` 为该浏览器可执行文件的文件名\n- node 版本说明：v20+\n\n# 部分功能说明\n\n## 1. 插件深度搜索功能\n\n需要悬浮鼠标5秒以上，才能触发深度搜索，深度搜索旨在解决一部分元素遮挡的问题，但有些未遮挡的元素，深度搜索后会导致元素并非是用户想要的元素，所以不是所有的元素都需要触发深度搜索\n\n### 实现方式：\n\n通过获取鼠标 x,y 下所有的元素 `document.elementsFromPoint(x, y)` 来获取元素后，通过每个元素的 left, top, right, bottom 距离 target (x, y) 找到最近的一个元素，若存在多个结果，取第一项。\n\n### 插件 shadowRoot 递归获取元素功能,\n\n具体查看 `shadowRootElement` 函数，递归查找元素是否是 shadowRoot 元素，若是，则继续查找 shadowRoot 下元素，直到找到普通元素，中间拼接 `$shadow$`，方便用户识别元素路径, 通过path获取元素时，也会识别到 `$shadow$`，并经函数 `getElementBySelector`找到目标元素， shadowRoot 元素暂时只支持 css 选择器获取，不支持xpath选择器获取。\n\n### frame 定位功能\n\n#### 跨域/同源iframe 元素位置统一处理办法\n\n#### 1. 跨域iframe元素位置统一处理办法\n\n说明：在跨域iframe元素中，由于同源策略的限制，以及存在iframe 的src 固定，iframe 的url 是会变动的，以及同一个tab下可能存在一摸一样src 的iframe , 通过src 查找所要的iframe 是不准确的。\n解决方法：通过插件主进程获取到iframe 的嵌套关系， parentFrameId , 得到一个嵌套关系的顺序，让后通过传入的 x,y 坐标，通过嵌套关系顺序，逐层查找，x, y 也会逐层减去 iframe 的位置，以及iframe的盒模型borderLeft, paddingLeft 得到准确的iframe content 的位置。\n详细见 getIframeElement 这个函数在backgroundInject 和contentInject 的处理\n\n#### 2. 同源iframe元素位置统一处理办法\n\n说明： 同上，虽然同源限制更小，但是按同一套方法处理，可以避免冗余，减少变量，减少出错。\n\n#### 3. iframe元素定位处理办法\n\n说明：再content中，会标记当前窗口下的所有frame 元素，并通过iframe.contentWindow.postMessage将iframe 的xpath 路径传给对应的iframe, 对应的iframe 中通过window.addEventListener('message', function(e) { }) 接收xpath 路径, 并传给主进程，这时就可以绑定iframe 的xpath 路径和iframe 的id。这样就可以按照 id 的嵌套关系来得到一个总的iframe 的 path 全路径，通过iframeXpath 这个字段即可定位到对应的iframe 以及iframe中的目标元素。\n\n#### 4. 注意\n\niframeXpath 与其他元素定位逻辑相同，统一查找逻辑，也存在动态性问题。\n\n# 构建crx/xpi 包说明\n\n### Chrome\n\n1. chrome 可以选择构建crx 插件包，推荐使用chrome developer dashboard 发布到chrome 插件商店，chrome 开发者账户需要收费，若不发布到插件商店，会被chrome 浏览器的限制启用，需要在安装插件时写入chrome://policy 政策   `ExtensionInstallAllowlist `  Windows 以注册表的方式 `Software\\Policies\\Google\\Chrome\\ExtensionInstallAllowlist` 写入白名单，Linux 写入方式  `/etc/opt/chrome/policies/managed/policy.json  ` 详细可见 [https://chromeenterprise.google/policies/?policy=ExtensionInstallAllowlist]()\n2. 不发布的打包方式：打开chrome浏览器，进入chrome://extensions/ 页， 启用开发者模式，选择打包扩展程序，浏览扩展程序根目录，第一次私钥文件可以不填，然后打包扩展程序，在扩展程序根目录就会生成一个对应的.crx 文件 和 .pem 密钥文件，.pem文件后续在更新插件包的时候需要使用，同一个密钥文件就会生成一样的插件id， 用于更新插件。\n\n### Firefox\n\n1. firefox 可以免费自行申请一个开发者账户，上传打包自己的插件xpi 文件，可以不发布，直接下载下xpi 文件亦可以安装。\n2. firefox 插件请自行打包，使用自己的开发者账户上传，构建自己的xpi 文件\n\n<!-- File: frontend/packages/browser-plugin/tsconfig.json (Tokens: ~133 | Category: anthropic-skill) -->\n{\n  \"compilerOptions\": {\n    \"target\": \"ES2023\",\n    \"types\": [\"chrome-types/_all.d.ts\"],\n    \"allowJs\": true,\n    \"rootDir\": \"src\",\n    \"outDir\": \"dist\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"noImplicitAny\": false,\n    \"strict\": false\n  },\n  \"include\": [\"src/*\", \"src/**/*\"],\n  \"exclude\": [\"node_modules\", \"dist\", \"src/3rd/*\", \"\"],\n  \"references\": [{ \"path\": \"./tsconfig.node.json\" }]\n}\n\n<!-- File: frontend/packages/browser-plugin/tsconfig.node.json (Tokens: ~66 | Category: anthropic-skill) -->\n{\n  \"compilerOptions\": {\n    \"composite\": true,\n    \"skipLibCheck\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"allowSyntheticDefaultImports\": true\n  },\n  \"include\": [\"vite.config.mts\", \"manifest.ts\"]\n}\n\n<!-- File: frontend/packages/cli/package.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Cli Skill\n\nPath: `frontend/packages/cli/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/package.json)\n\n<!-- File: frontend/packages/cli/README.zh-CN.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Cli Skill\n\nPath: `frontend/packages/cli/README.zh-CN.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/README.zh-CN.md)\n\n<!-- File: frontend/packages/cli/templates/template-vue/package.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Template-vue Skill\n\nPath: `frontend/packages/cli/templates/template-vue/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/templates/template-vue/package.json)\n\n<!-- File: frontend/packages/cli/templates/template-vue/tsconfig.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Template-vue Skill\n\nPath: `frontend/packages/cli/templates/template-vue/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/templates/template-vue/tsconfig.json)\n\n<!-- File: frontend/packages/cli/tsconfig.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Cli Skill\n\nPath: `frontend/packages/cli/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/cli/tsconfig.json)\n\n<!-- File: frontend/packages/components/lib/cdn-info.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Lib Skill\n\nPath: `frontend/packages/components/lib/cdn-info.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/lib/cdn-info.json)\n\n<!-- File: frontend/packages/components/package.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Components Skill\n\nPath: `frontend/packages/components/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/package.json)\n\n<!-- File: frontend/packages/components/tsconfig.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Components Skill\n\nPath: `frontend/packages/components/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/components/tsconfig.json)\n\n<!-- File: frontend/packages/electron-app/electron-builder.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Electron-app Skill\n\nPath: `frontend/packages/electron-app/electron-builder.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/electron-builder.json)\n\n<!-- File: frontend/packages/electron-app/package.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Electron-app Skill\n\nPath: `frontend/packages/electron-app/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/package.json)\n\n<!-- File: frontend/packages/electron-app/tsconfig.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Electron-app Skill\n\nPath: `frontend/packages/electron-app/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.json)\n\n<!-- File: frontend/packages/electron-app/tsconfig.node.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Electron-app Skill\n\nPath: `frontend/packages/electron-app/tsconfig.node.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.node.json)\n\n<!-- File: frontend/packages/electron-app/tsconfig.web.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Electron-app Skill\n\nPath: `frontend/packages/electron-app/tsconfig.web.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/electron-app/tsconfig.web.json)\n\n<!-- File: frontend/packages/shared/package.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Shared Skill\n\nPath: `frontend/packages/shared/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/shared/package.json)\n\n<!-- File: frontend/packages/shared/tsconfig.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Shared Skill\n\nPath: `frontend/packages/shared/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/shared/tsconfig.json)\n\n<!-- File: frontend/packages/web-app/package.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Web-app Skill\n\nPath: `frontend/packages/web-app/package.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/package.json)\n\n<!-- File: frontend/packages/web-app/tsconfig.json (Tokens: ~300 | Category: anthropic-skill) -->\n# Web-app Skill\n\nPath: `frontend/packages/web-app/tsconfig.json`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/iflytek/astron-rpa/HEAD/frontend/packages/web-app/tsconfig.json)\n\n<!-- ... +7 more modular skills available via /api/skills/iflytek/astron-rpa?path={path} -->\n</yakaai_skills>"}