@liang-hz/agent-in-chrome 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ext-id.txt +4 -0
- package/LICENSE +202 -0
- package/NOTICE +5 -0
- package/PRIVACY.md +86 -0
- package/README.en.md +419 -0
- package/README.md +406 -0
- package/bin/agent-in-chrome.mjs +97 -0
- package/commands/agent-in-chrome.md +18 -0
- package/commands/install-agent-in-chrome.md +22 -0
- package/docs/AGENTS.md +94 -0
- package/docs/CLI.md +297 -0
- package/docs/client-compat.json +23 -0
- package/extension/about-toc.js +25 -0
- package/extension/about.html +240 -0
- package/extension/about.js +44 -0
- package/extension/agent-window.html +100 -0
- package/extension/icons/icon-128.png +0 -0
- package/extension/icons/icon-16.png +0 -0
- package/extension/icons/icon-24.png +0 -0
- package/extension/icons/icon-32.png +0 -0
- package/extension/icons/icon-48.png +0 -0
- package/extension/icons/icon-64.png +0 -0
- package/extension/icons/icon-attention-128.png +0 -0
- package/extension/icons/icon-attention-16.png +0 -0
- package/extension/icons/icon-attention-24.png +0 -0
- package/extension/icons/icon-attention-32.png +0 -0
- package/extension/icons/icon-attention-48.png +0 -0
- package/extension/icons/icon-attention-64.png +0 -0
- package/extension/icons/icon-attention.svg +18 -0
- package/extension/icons/icon-failed-128.png +0 -0
- package/extension/icons/icon-failed-16.png +0 -0
- package/extension/icons/icon-failed-24.png +0 -0
- package/extension/icons/icon-failed-32.png +0 -0
- package/extension/icons/icon-failed-48.png +0 -0
- package/extension/icons/icon-failed-64.png +0 -0
- package/extension/icons/icon-failed.svg +18 -0
- package/extension/icons/icon-idle-128.png +0 -0
- package/extension/icons/icon-idle-16.png +0 -0
- package/extension/icons/icon-idle-24.png +0 -0
- package/extension/icons/icon-idle-32.png +0 -0
- package/extension/icons/icon-idle-48.png +0 -0
- package/extension/icons/icon-idle-64.png +0 -0
- package/extension/icons/icon-idle.svg +18 -0
- package/extension/icons/icon-mark.svg +10 -0
- package/extension/icons/icon-running-128.png +0 -0
- package/extension/icons/icon-running-16.png +0 -0
- package/extension/icons/icon-running-24.png +0 -0
- package/extension/icons/icon-running-32.png +0 -0
- package/extension/icons/icon-running-48.png +0 -0
- package/extension/icons/icon-running-64.png +0 -0
- package/extension/icons/icon-running.svg +18 -0
- package/extension/icons/icon.svg +18 -0
- package/extension/manifest.json +44 -0
- package/extension/popup-ui.js +38 -0
- package/extension/popup.html +350 -0
- package/extension/popup.js +741 -0
- package/extension/sw.js +11127 -0
- package/extension/update-check.js +66 -0
- package/extension/welcome.html +110 -0
- package/extension/welcome.js +18 -0
- package/mcp/agent-identity.mjs +1007 -0
- package/mcp/cdp/bridge.mjs +239 -0
- package/mcp/cdp/browser-launch.mjs +1127 -0
- package/mcp/cdp/chrome-shim.mjs +1124 -0
- package/mcp/cdp/client.mjs +443 -0
- package/mcp/cli-invocation.mjs +67 -0
- package/mcp/config.mjs +191 -0
- package/mcp/foreground-guard.mjs +295 -0
- package/mcp/proc-win.mjs +112 -0
- package/mcp/secret-shape.mjs +155 -0
- package/mcp/server.mjs +3437 -0
- package/mcp/session-id.mjs +281 -0
- package/mcp/token.mjs +260 -0
- package/mcp/tool-tiers.mjs +84 -0
- package/mcp/trace.mjs +528 -0
- package/mcp/update-cli.mjs +163 -0
- package/mcp/update-notice.mjs +194 -0
- package/native-host/host.mjs +356 -0
- package/native-host/mac-foreground/aic-fg.swift +114 -0
- package/native-host/mac-foreground/build.mjs +43 -0
- package/package.json +46 -0
- package/scripts/agents.mjs +921 -0
- package/scripts/borrow-login.mjs +935 -0
- package/scripts/cli-browser.mjs +148 -0
- package/scripts/e2e-sweep.mjs +192 -0
- package/scripts/e2e.mjs +3911 -0
- package/scripts/fixture-server.mjs +1419 -0
- package/scripts/guard-publish.mjs +175 -0
- package/scripts/install.mjs +1383 -0
- package/scripts/launcher-provenance.mjs +74 -0
- package/scripts/pack-crx.mjs +82 -0
- package/scripts/pick.mjs +114 -0
- package/scripts/test-agents.mjs +968 -0
- package/scripts/test-borrow.mjs +289 -0
- package/scripts/test-config.mjs +618 -0
- package/scripts/test-e2e-sweep.mjs +251 -0
- package/scripts/test-foreground-guard.mjs +383 -0
- package/scripts/test-identity.mjs +1141 -0
- package/scripts/test-install-skill.mjs +378 -0
- package/scripts/test-protocol.mjs +712 -0
- package/scripts/test-security.mjs +1360 -0
- package/scripts/test-sw.mjs +14526 -0
- package/scripts/test-update.mjs +301 -0
- package/skills/agent-in-chrome/SKILL.md +60 -0
- package/skills/agent-in-chrome/references/actions-and-waits.md +136 -0
- package/skills/agent-in-chrome/references/amap-dir-dropdown.md +66 -0
- package/skills/agent-in-chrome/references/geetest-click-captcha.md +55 -0
- package/skills/agent-in-chrome/references/network-debugging.md +20 -0
- package/skills/agent-in-chrome/references/reading-pages.md +30 -0
- package/skills/agent-in-chrome/references/recovery.md +25 -0
- package/skills/agent-in-chrome/references/tabs-and-sessions.md +34 -0
- package/skills/install-agent-in-chrome/SKILL.md +252 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<meta charset="utf-8" />
|
|
3
|
+
<title>Agent in Chrome — 属性与本机位置</title>
|
|
4
|
+
<!-- 扩展的属性页(chrome-extension://<id>/about.html):说明这个扩展是什么、
|
|
5
|
+
要哪些权限各做什么用、在本机写下哪些文件、以及此刻的版本与连接状态。
|
|
6
|
+
纯静态说明页,动态那几处(版本、扩展 ID、连接状态、更新提示)由 about.js 填,
|
|
7
|
+
左侧目录高亮与状态胶囊配色由 about-toc.js 管。 -->
|
|
8
|
+
<style>
|
|
9
|
+
:root {
|
|
10
|
+
color-scheme: light dark;
|
|
11
|
+
--bg: #fbfbfc;
|
|
12
|
+
--surf: #ffffff;
|
|
13
|
+
--fg: #14161a;
|
|
14
|
+
--mut: #6b7280;
|
|
15
|
+
--bd: #e6e8ec;
|
|
16
|
+
--bd2: #eef0f3;
|
|
17
|
+
--acc: #2563eb;
|
|
18
|
+
--ok: #16a34a;
|
|
19
|
+
--ok-bg: rgba(22, 163, 74, 0.1);
|
|
20
|
+
--warn: #b45309;
|
|
21
|
+
--warn-bg: #fdf6ec;
|
|
22
|
+
--warn-bd: #f0dcbd;
|
|
23
|
+
--note-bg: #f4f7fe;
|
|
24
|
+
--note-bd: #dbe5fb;
|
|
25
|
+
--code: #f2f3f5;
|
|
26
|
+
--thead: #fafbfc;
|
|
27
|
+
--navhi: #eef1f6;
|
|
28
|
+
--glass: rgba(251, 251, 252, 0.86);
|
|
29
|
+
--ring: rgba(37, 99, 235, 0.35);
|
|
30
|
+
}
|
|
31
|
+
@media (prefers-color-scheme: dark) {
|
|
32
|
+
:root {
|
|
33
|
+
--bg: #15171a;
|
|
34
|
+
--surf: #1c1f23;
|
|
35
|
+
--fg: #e8eaed;
|
|
36
|
+
--mut: #9aa0a8;
|
|
37
|
+
--bd: #383d45;
|
|
38
|
+
--bd2: #2d3137;
|
|
39
|
+
--acc: #5b93f7;
|
|
40
|
+
--ok: #4ade80;
|
|
41
|
+
--ok-bg: rgba(74, 222, 128, 0.12);
|
|
42
|
+
--warn: #f0b445;
|
|
43
|
+
--warn-bg: rgba(240, 180, 69, 0.09);
|
|
44
|
+
--warn-bd: rgba(240, 180, 69, 0.28);
|
|
45
|
+
--note-bg: rgba(91, 147, 247, 0.09);
|
|
46
|
+
--note-bd: rgba(91, 147, 247, 0.28);
|
|
47
|
+
--code: #262a30;
|
|
48
|
+
--thead: #1f2328;
|
|
49
|
+
--navhi: #282d34;
|
|
50
|
+
--glass: rgba(21, 23, 26, 0.82);
|
|
51
|
+
--ring: rgba(91, 147, 247, 0.45);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
* { box-sizing: border-box; }
|
|
55
|
+
body {
|
|
56
|
+
margin: 0;
|
|
57
|
+
background: var(--bg);
|
|
58
|
+
color: var(--fg);
|
|
59
|
+
font: 14px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
|
|
60
|
+
}
|
|
61
|
+
a { color: var(--acc); text-decoration: none; }
|
|
62
|
+
a:hover { text-decoration: underline; }
|
|
63
|
+
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
|
|
64
|
+
code {
|
|
65
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
66
|
+
font-size: 12px;
|
|
67
|
+
background: var(--code);
|
|
68
|
+
border-radius: 5px;
|
|
69
|
+
padding: 1px 5px;
|
|
70
|
+
word-break: break-all;
|
|
71
|
+
}
|
|
72
|
+
.muted { color: var(--mut); }
|
|
73
|
+
|
|
74
|
+
.topbar { position: sticky; top: 0; z-index: 5; background: var(--glass); backdrop-filter: blur(10px); border-bottom: 1px solid var(--bd); }
|
|
75
|
+
.topbar .inner { max-width: 1080px; margin: 0 auto; padding: 14px 32px; display: flex; align-items: center; gap: 12px; }
|
|
76
|
+
.topbar img { width: 24px; height: 24px; flex: none; }
|
|
77
|
+
.brand { flex: 1; min-width: 0; }
|
|
78
|
+
.brand .name { font-size: 14.5px; font-weight: 650; }
|
|
79
|
+
.brand .where { font-size: 12px; color: var(--mut); }
|
|
80
|
+
.pill { flex: none; font-size: 12px; color: var(--mut); background: var(--code); border-radius: 99px; padding: 3px 10px; }
|
|
81
|
+
.pill.state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ok); background: var(--ok-bg); }
|
|
82
|
+
.pill.state .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
|
|
83
|
+
|
|
84
|
+
.wrap { max-width: 1080px; margin: 0 auto; padding: 36px 32px 96px; display: grid; grid-template-columns: 200px 1fr; gap: 48px; align-items: start; }
|
|
85
|
+
@media (max-width: 860px) {
|
|
86
|
+
.wrap { grid-template-columns: 1fr; gap: 28px; padding: 24px 20px 72px; }
|
|
87
|
+
nav.toc { position: static; }
|
|
88
|
+
}
|
|
89
|
+
nav.toc { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
|
|
90
|
+
nav.toc .t { padding: 0 10px 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; color: var(--mut); }
|
|
91
|
+
nav.toc a { padding: 6px 10px; border-radius: 7px; color: var(--mut); }
|
|
92
|
+
nav.toc a:hover { background: var(--navhi); color: var(--fg); text-decoration: none; }
|
|
93
|
+
nav.toc a.on { background: var(--navhi); color: var(--fg); font-weight: 600; }
|
|
94
|
+
nav.toc .id { margin: 14px 10px 0; padding-top: 14px; border-top: 1px solid var(--bd); font-size: 11.5px; line-height: 1.6; color: var(--mut); }
|
|
95
|
+
nav.toc .id code { background: none; padding: 0; font-size: 10.5px; color: var(--fg); }
|
|
96
|
+
|
|
97
|
+
.body { min-width: 0; }
|
|
98
|
+
h1 { margin: 0; font-size: 30px; line-height: 1.25; letter-spacing: -0.3px; }
|
|
99
|
+
.lede { margin: 10px 0 0; font-size: 15px; line-height: 1.7; color: var(--mut); max-width: 60ch; text-wrap: pretty; }
|
|
100
|
+
h2 { margin: 44px 0 4px; font-size: 19px; letter-spacing: -0.2px; scroll-margin-top: 96px; }
|
|
101
|
+
h2 + .say { margin: 0 0 16px; font-size: 13.5px; color: var(--mut); }
|
|
102
|
+
p { text-wrap: pretty; }
|
|
103
|
+
.prose { font-size: 14px; line-height: 1.75; max-width: 66ch; }
|
|
104
|
+
|
|
105
|
+
.note { margin: 22px 0 0; padding: 14px 16px; border: 1px solid var(--note-bd); background: var(--note-bg); border-radius: 10px; font-size: 13px; line-height: 1.65; }
|
|
106
|
+
.note code { background: var(--surf); border: 1px solid var(--note-bd); }
|
|
107
|
+
.warn { border-color: var(--warn-bd); background: var(--warn-bg); }
|
|
108
|
+
.warn b { color: var(--warn); }
|
|
109
|
+
.warn code { border-color: var(--warn-bd); }
|
|
110
|
+
|
|
111
|
+
.card { border: 1px solid var(--bd); border-radius: 12px; background: var(--surf); overflow: hidden; }
|
|
112
|
+
table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
113
|
+
th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: 0.4px; color: var(--mut); padding: 9px 16px; background: var(--thead); border-bottom: 1px solid var(--bd); white-space: nowrap; }
|
|
114
|
+
td { padding: 11px 16px; border-bottom: 1px solid var(--bd2); vertical-align: top; }
|
|
115
|
+
tr:last-child td { border-bottom: none; }
|
|
116
|
+
td.keep { white-space: nowrap; color: var(--mut); }
|
|
117
|
+
td.keep.forever { color: var(--warn); font-weight: 600; }
|
|
118
|
+
td code { white-space: nowrap; }
|
|
119
|
+
|
|
120
|
+
.rows > div { display: grid; grid-template-columns: 190px 1fr; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--bd2); }
|
|
121
|
+
.rows > div:last-child { border-bottom: none; }
|
|
122
|
+
.rows code { background: none; padding: 0; }
|
|
123
|
+
.rows .why { font-size: 13px; line-height: 1.6; }
|
|
124
|
+
|
|
125
|
+
ul { padding-left: 1.2em; margin: 12px 0 0; }
|
|
126
|
+
li { margin: 6px 0; }
|
|
127
|
+
.aside { margin: 12px 0 0; padding: 12px 14px; border-left: 2px solid var(--bd); font-size: 13px; line-height: 1.65; color: var(--mut); max-width: 66ch; }
|
|
128
|
+
|
|
129
|
+
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
|
|
130
|
+
@media (max-width: 640px) { .duo { grid-template-columns: 1fr; } }
|
|
131
|
+
.duo .card { padding: 16px 18px; }
|
|
132
|
+
.duo .k { font-size: 12px; color: var(--mut); }
|
|
133
|
+
.duo .v { margin-top: 6px; font-size: 12.5px; line-height: 1.7; }
|
|
134
|
+
.links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; font-size: 13px; }
|
|
135
|
+
</style>
|
|
136
|
+
|
|
137
|
+
<div class="topbar">
|
|
138
|
+
<div class="inner">
|
|
139
|
+
<img src="icons/icon-32.png" alt="" />
|
|
140
|
+
<div class="brand">
|
|
141
|
+
<div class="name">Agent in Chrome</div>
|
|
142
|
+
<div class="where">属性与本机位置</div>
|
|
143
|
+
</div>
|
|
144
|
+
<span class="pill state"><span class="dot"></span><span id="state">检查中…</span></span>
|
|
145
|
+
<span class="pill">v<span id="version">…</span></span>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<div class="wrap">
|
|
150
|
+
<nav class="toc">
|
|
151
|
+
<div class="t">本页内容</div>
|
|
152
|
+
<a class="on" href="#files">它在你本机写什么</a>
|
|
153
|
+
<a href="#perms">扩展权限逐条</a>
|
|
154
|
+
<a href="#net">网络出站</a>
|
|
155
|
+
<a href="#blind">哪些东西读不到</a>
|
|
156
|
+
<a href="#update">更新与来源</a>
|
|
157
|
+
<div class="id">扩展 ID<br /><code id="extid">…</code></div>
|
|
158
|
+
</nav>
|
|
159
|
+
|
|
160
|
+
<div class="body">
|
|
161
|
+
<h1>它在你电脑上动了什么</h1>
|
|
162
|
+
<p class="lede">全部摊开讲:写到哪些文件、要哪些权限、什么时候联网、哪些内容它读不到。</p>
|
|
163
|
+
|
|
164
|
+
<div class="note">
|
|
165
|
+
<b>想看你机器上的真实绝对路径?</b>终端跑 <code>npx @liang-hz/agent-in-chrome check</code>,
|
|
166
|
+
它会打印本机实际解析出的每个路径、权限位、以及连接令牌是否就位(不会打印令牌本身)。
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<h2 id="files">它在你本机写什么</h2>
|
|
170
|
+
<p class="say">八处,全部在你的 home 目录和 agent 自己的配置里。</p>
|
|
171
|
+
<div class="card">
|
|
172
|
+
<table>
|
|
173
|
+
<tr><th>位置</th><th>内容</th><th>保留</th></tr>
|
|
174
|
+
<tr><td><code>~/.agent-in-chrome/</code></td><td>运行时代码副本、启动脚本</td><td class="keep">卸载时删除</td></tr>
|
|
175
|
+
<tr><td><code>~/.agent-in-chrome/token</code></td><td>本机连接令牌(<code>0600</code>)。没有它的本地进程连不上你的浏览器</td><td class="keep">卸载时删除</td></tr>
|
|
176
|
+
<tr><td><code>~/.agent-in-chrome/traces/</code></td><td>操作留痕:每步工具名、打码后入参、当时页面 URL 与标题</td><td class="keep">40 会话 / 7 天</td></tr>
|
|
177
|
+
<tr><td><code>~/.agent-in-chrome/screenshots/</code></td><td>agent 要求的截图</td><td class="keep">最近 100 张</td></tr>
|
|
178
|
+
<tr><td><code>~/.agent-in-chrome/cookies/</code></td><td>你显式要求导出的 cookie(目录 <code>0700</code>、文件 <code>0600</code>)</td><td class="keep forever">不自动清理</td></tr>
|
|
179
|
+
<tr><td><code>~/.agent-in-chrome/*.log</code></td><td>连接日志(不含页面内容)</td><td class="keep">不自动清理</td></tr>
|
|
180
|
+
<tr><td>各浏览器 <code>NativeMessagingHosts/</code></td><td>一份 host 注册清单 <code id="hostname">…</code></td><td class="keep">卸载时删除</td></tr>
|
|
181
|
+
<tr><td>你的 agent 的 MCP 配置</td><td>一条 server 注册(写前自动备份原文件)</td><td class="keep">卸载时移除</td></tr>
|
|
182
|
+
</table>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<div class="note warn" style="margin-top: 16px">
|
|
186
|
+
<b>cookie 导出是明文凭据</b><br />
|
|
187
|
+
只有你(或你让 agent)显式调用 <code>browser_cookies_export</code> 才会产生,用途是把登录态搬到另一个浏览器实例。默认只把文件路径返回给模型,不返回明文。<b>用完请自己删掉那个文件</b>——它不会自动过期。
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<h2 id="perms">扩展权限逐条</h2>
|
|
191
|
+
<p class="say">manifest 里申请的每一项,以及它到底用来干什么。</p>
|
|
192
|
+
<div class="card rows">
|
|
193
|
+
<div><code>debugger</code><div class="why">核心机制:通过 Chrome 调试协议读页面、发可信输入事件。<b>接管期间页面顶部有关不掉的提示条</b>,这是 Chrome 的安全设计。</div></div>
|
|
194
|
+
<div><code>nativeMessaging</code><div class="why">与本机 MCP server 之间的唯一通道。</div></div>
|
|
195
|
+
<div><code>tabs</code> / <code>tabGroups</code><div class="why">列标签页;把 agent 开的页收进可见的彩色标签组。</div></div>
|
|
196
|
+
<div><code>scripting</code><div class="why">页面快照与元素定位的注入式管线。</div></div>
|
|
197
|
+
<div><code>storage</code><div class="why">会话-标签页归属表(浏览器会话存储,关浏览器即清)。</div></div>
|
|
198
|
+
<div><code>alarms</code><div class="why">service worker 被回收后自动拉起重连。</div></div>
|
|
199
|
+
<div><code><all_urls></code><div class="why">agent 要能操作你指定的任意站点;去哪由你的指令决定。</div></div>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<h2 id="net">网络出站</h2>
|
|
203
|
+
<p class="prose">产品自身<b>不向任何服务器发送数据</b>:没有遥测、没有统计、没有崩溃上报,全部是本机进程间通信。唯一例外是版本更新检查(向 npm 查询最新版本号),不携带任何本机信息,设 <code>AGENT_IN_CHROME_NO_UPDATE_NOTIFIER=1</code> 可关闭。agent 访问哪些网页,完全由你的指令决定。</p>
|
|
204
|
+
|
|
205
|
+
<h2 id="blind">哪些东西读不到</h2>
|
|
206
|
+
<ul class="prose">
|
|
207
|
+
<li>密码框、信用卡号、CVV、短信验证码的<b>值</b>不会出现在任何页面读取结果里,只报「已填写(N 字符)」。</li>
|
|
208
|
+
<li>操作留痕里输入的文本<b>只记长度</b>;Cookie、Authorization、token、api key 等字段一律打码。</li>
|
|
209
|
+
</ul>
|
|
210
|
+
<p class="aside">如实告知的边界:打码认的是「字段名像凭据」。agent 主动执行 JS 把 <code>document.cookie</code> 读进普通变量时,打码认不出来。</p>
|
|
211
|
+
|
|
212
|
+
<h2 id="update">更新与来源</h2>
|
|
213
|
+
<div class="duo">
|
|
214
|
+
<div class="card">
|
|
215
|
+
<div class="k">版本状态</div>
|
|
216
|
+
<p class="v muted" id="updateLine">检查中…</p>
|
|
217
|
+
</div>
|
|
218
|
+
<div class="card">
|
|
219
|
+
<div class="k">怎么更新</div>
|
|
220
|
+
<div class="v">
|
|
221
|
+
Git / npm 装的:跑 <code>npx @liang-hz/agent-in-chrome@latest install</code>。<br />
|
|
222
|
+
商店装的:走商店的常规更新。
|
|
223
|
+
<div style="margin-top: 8px; font-weight: 600">我们不会自动更新,由你决定。</div>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
<div class="links">
|
|
228
|
+
<a href="https://github.com/Liang-HZ/agent-in-chrome" target="_blank">源码仓库 ↗</a>
|
|
229
|
+
<a href="https://agent-in-chrome.liangai.org/privacy" target="_blank">完整隐私政策 ↗</a>
|
|
230
|
+
<a href="https://github.com/Liang-HZ/agent-in-chrome/releases" target="_blank">更新说明 / Releases ↗</a>
|
|
231
|
+
<a href="https://github.com/Liang-HZ/agent-in-chrome/issues" target="_blank">报告问题 ↗</a>
|
|
232
|
+
</div>
|
|
233
|
+
<p class="muted" style="margin-top: 14px; font-size: 12px">Apache-2.0,全部开源可审计。 · by Liang ·
|
|
234
|
+
<a href="https://liangai.org" target="_blank">liangai.org</a></p>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
|
|
238
|
+
<script src="update-check.js"></script>
|
|
239
|
+
<script src="about.js"></script>
|
|
240
|
+
<script src="about-toc.js"></script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// 属性页:把「它现在是什么状态、有没有新版」填进静态说明里。
|
|
2
|
+
// 路径类信息不在这里现算——扩展进程看不到文件系统,真实绝对路径让用户跑
|
|
3
|
+
// `npx @liang-hz/agent-in-chrome check` 去拿,页面上只写约定位置(~/.agent-in-chrome/…)。
|
|
4
|
+
|
|
5
|
+
const $ = (id) => document.getElementById(id);
|
|
6
|
+
|
|
7
|
+
$("extid").textContent = chrome.runtime.id;
|
|
8
|
+
$("version").textContent = chrome.runtime.getManifest().version;
|
|
9
|
+
|
|
10
|
+
chrome.runtime.sendMessage({ type: "popup-status" }, (s) => {
|
|
11
|
+
if (chrome.runtime.lastError || !s) {
|
|
12
|
+
$("state").textContent = "service worker 未响应(点扩展图标可唤醒)";
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
$("state").textContent = s.connected ? "已连接 agent" : "未连接(agent 未运行或链路未通)";
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
$("hostname").textContent = "org.liangai.agent_in_chrome.json";
|
|
19
|
+
|
|
20
|
+
(async () => {
|
|
21
|
+
const current = chrome.runtime.getManifest().version;
|
|
22
|
+
const { latest, hasUpdate, channel } = await window.aicUpdateCheck.check(current);
|
|
23
|
+
const el = $("updateLine");
|
|
24
|
+
if (hasUpdate) {
|
|
25
|
+
el.innerHTML = "";
|
|
26
|
+
const b = document.createElement("b");
|
|
27
|
+
b.textContent =
|
|
28
|
+
channel === "store"
|
|
29
|
+
? `有新版本 ${latest}(当前 ${current},落后较多)。商店更新可能卡住了:去 chrome://extensions 确认开启了自动更新,或从商店页重装。`
|
|
30
|
+
: `有新版本 ${latest}(当前 ${current})。`;
|
|
31
|
+
const a = document.createElement("a");
|
|
32
|
+
a.href = "https://github.com/Liang-HZ/agent-in-chrome/releases";
|
|
33
|
+
a.target = "_blank";
|
|
34
|
+
a.textContent = "查看更新说明 →";
|
|
35
|
+
el.append(b, " ", a);
|
|
36
|
+
el.classList.remove("muted");
|
|
37
|
+
} else if (latest && channel === "store") {
|
|
38
|
+
el.textContent = `当前 ${current}(商店版,自动更新)。`;
|
|
39
|
+
} else if (latest) {
|
|
40
|
+
el.textContent = `当前 ${current},已是最新。`;
|
|
41
|
+
} else {
|
|
42
|
+
el.textContent = `当前 ${current}。(没查到最新版本号:联不上 npm,可能是离线或代理拦截;重开这页会再试)`;
|
|
43
|
+
}
|
|
44
|
+
})();
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<meta charset="utf-8" />
|
|
3
|
+
<title>Agent in Chrome — 专属窗口</title>
|
|
4
|
+
<!-- agent 专属窗口的锚点页。在扩展弹窗里开启「agent 标签页开在独立窗口」后,
|
|
5
|
+
agent 新开的页都落进那个窗口,这一张钉在最左边不关:它在窗口就在,agent 的页
|
|
6
|
+
全关掉时窗口也不会被浏览器回收。页面本身只解释这个窗口是什么、怎么切过来、
|
|
7
|
+
不想要了怎么关。纯静态,没有脚本。 -->
|
|
8
|
+
<style>
|
|
9
|
+
:root {
|
|
10
|
+
color-scheme: light dark;
|
|
11
|
+
--bg: #fbfbfc;
|
|
12
|
+
--surf: #ffffff;
|
|
13
|
+
--fg: #14161a;
|
|
14
|
+
--mut: #6b7280;
|
|
15
|
+
--bd: #e6e8ec;
|
|
16
|
+
--bd2: #eef0f3;
|
|
17
|
+
--acc: #2563eb;
|
|
18
|
+
--code: #f2f3f5;
|
|
19
|
+
--sh: 0 1px 2px rgba(16, 24, 40, 0.05);
|
|
20
|
+
}
|
|
21
|
+
@media (prefers-color-scheme: dark) {
|
|
22
|
+
:root {
|
|
23
|
+
--bg: #15171a;
|
|
24
|
+
--surf: #1c1f23;
|
|
25
|
+
--fg: #e8eaed;
|
|
26
|
+
--mut: #9aa0a8;
|
|
27
|
+
--bd: #383d45;
|
|
28
|
+
--bd2: #2d3137;
|
|
29
|
+
--acc: #5b93f7;
|
|
30
|
+
--code: #262a30;
|
|
31
|
+
--sh: none;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
* { box-sizing: border-box; }
|
|
35
|
+
body {
|
|
36
|
+
margin: 0;
|
|
37
|
+
min-height: 100vh;
|
|
38
|
+
display: grid;
|
|
39
|
+
place-items: center;
|
|
40
|
+
padding: 40px 24px;
|
|
41
|
+
background: var(--bg);
|
|
42
|
+
color: var(--fg);
|
|
43
|
+
font: 14px/1.7 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
|
|
44
|
+
}
|
|
45
|
+
main {
|
|
46
|
+
max-width: 34rem;
|
|
47
|
+
padding: 28px 32px 30px;
|
|
48
|
+
background: var(--surf);
|
|
49
|
+
border: 1px solid var(--bd);
|
|
50
|
+
border-radius: 14px;
|
|
51
|
+
box-shadow: var(--sh);
|
|
52
|
+
}
|
|
53
|
+
.head { display: flex; align-items: center; gap: 12px; }
|
|
54
|
+
.head img { width: 28px; height: 28px; flex: none; }
|
|
55
|
+
h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.1px; }
|
|
56
|
+
.sub { margin: 2px 0 0; font-size: 12.5px; color: var(--mut); }
|
|
57
|
+
p { margin: 16px 0 0; text-wrap: pretty; }
|
|
58
|
+
.why {
|
|
59
|
+
margin-top: 18px;
|
|
60
|
+
padding: 14px 16px;
|
|
61
|
+
border-radius: 10px;
|
|
62
|
+
background: var(--bg);
|
|
63
|
+
border: 1px solid var(--bd2);
|
|
64
|
+
font-size: 13px;
|
|
65
|
+
line-height: 1.7;
|
|
66
|
+
color: var(--mut);
|
|
67
|
+
}
|
|
68
|
+
.why b { color: var(--fg); }
|
|
69
|
+
kbd {
|
|
70
|
+
font: inherit;
|
|
71
|
+
font-size: 12px;
|
|
72
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
73
|
+
background: var(--code);
|
|
74
|
+
border-radius: 5px;
|
|
75
|
+
padding: 1px 6px;
|
|
76
|
+
}
|
|
77
|
+
.off { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bd2); font-size: 13px; color: var(--mut); }
|
|
78
|
+
</style>
|
|
79
|
+
<main>
|
|
80
|
+
<div class="head">
|
|
81
|
+
<img src="icons/icon-48.png" alt="" />
|
|
82
|
+
<div>
|
|
83
|
+
<h1>这个窗口归 Agent in Chrome</h1>
|
|
84
|
+
<p class="sub">agent 开的页都来这里,不挤你自己的标签条</p>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<p>
|
|
89
|
+
你在扩展弹窗里打开了「agent 标签页开在独立窗口」。这个窗口铺满整个屏幕,
|
|
90
|
+
<kbd>Cmd</kbd> <kbd>`</kbd> 或者在弹窗里点「打开 agent 窗口」就能切过来看进度、直接接管。
|
|
91
|
+
</p>
|
|
92
|
+
|
|
93
|
+
<div class="why">
|
|
94
|
+
<b>这一张是窗口的锚点页,钉在最左边。</b>
|
|
95
|
+
留着它,是为了 agent 的页全关掉之后这个窗口不会被 Chrome 顺手回收——否则下次就得重新建一个。
|
|
96
|
+
它在,窗口就一直在,agent 开多少页都只是往里加,你那边一点感觉都没有。
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div class="off">不想要独立窗口了:在扩展弹窗里关掉那个开关,然后直接关掉本窗口。</div>
|
|
100
|
+
</main>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
|
|
2
|
+
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="c" x1="0" y1="0" x2="0.55" y2="1">
|
|
5
|
+
<stop offset="0" stop-color="#FBBF24"></stop><stop offset="1" stop-color="#B45309"></stop>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="sheen" x1="0" y1="0" x2="0" y2="1">
|
|
8
|
+
<stop offset="0" stop-color="#fff" stop-opacity="0.24"></stop><stop offset="1" stop-color="#fff" stop-opacity="0"></stop>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
<filter id="dp" x="-20%" y="-20%" width="140%" height="145%">
|
|
11
|
+
<feDropShadow dx="0" dy="3" stdDeviation="2.6" flood-color="#0F172A" flood-opacity="0.30"></feDropShadow>
|
|
12
|
+
</filter>
|
|
13
|
+
</defs>
|
|
14
|
+
<g filter="url(#dp)"><rect x="4" y="10" width="120" height="108" rx="26" fill="url(#c)"></rect></g>
|
|
15
|
+
<path d="M4 36 a26 26 0 0 1 26 -26 h68 a26 26 0 0 1 26 26 Z" fill="url(#sheen)"></path>
|
|
16
|
+
<path d="M 56 26 A 32 32 0 1 0 56 90" fill="none" stroke="#fff" stroke-width="14" stroke-linecap="round"></path>
|
|
17
|
+
<g transform="rotate(180 64 64)"><path d="M 56 26 A 32 32 0 1 0 56 90" fill="none" stroke="#fff" stroke-width="14" stroke-linecap="round"></path></g>
|
|
18
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
|
|
2
|
+
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="c" x1="0" y1="0" x2="0.55" y2="1">
|
|
5
|
+
<stop offset="0" stop-color="#F87171"></stop><stop offset="1" stop-color="#B91C1C"></stop>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="sheen" x1="0" y1="0" x2="0" y2="1">
|
|
8
|
+
<stop offset="0" stop-color="#fff" stop-opacity="0.24"></stop><stop offset="1" stop-color="#fff" stop-opacity="0"></stop>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
<filter id="dp" x="-20%" y="-20%" width="140%" height="145%">
|
|
11
|
+
<feDropShadow dx="0" dy="3" stdDeviation="2.6" flood-color="#0F172A" flood-opacity="0.30"></feDropShadow>
|
|
12
|
+
</filter>
|
|
13
|
+
</defs>
|
|
14
|
+
<g filter="url(#dp)"><rect x="4" y="10" width="120" height="108" rx="26" fill="url(#c)"></rect></g>
|
|
15
|
+
<path d="M4 36 a26 26 0 0 1 26 -26 h68 a26 26 0 0 1 26 26 Z" fill="url(#sheen)"></path>
|
|
16
|
+
<path d="M 56 26 A 32 32 0 1 0 56 90" fill="none" stroke="#fff" stroke-width="14" stroke-linecap="round"></path>
|
|
17
|
+
<g transform="rotate(180 64 64)"><path d="M 56 26 A 32 32 0 1 0 56 90" fill="none" stroke="#fff" stroke-width="14" stroke-linecap="round"></path></g>
|
|
18
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
|
|
2
|
+
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="c" x1="0" y1="0" x2="0.55" y2="1">
|
|
5
|
+
<stop offset="0" stop-color="#8E959E"></stop><stop offset="1" stop-color="#3F4650"></stop>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="sheen" x1="0" y1="0" x2="0" y2="1">
|
|
8
|
+
<stop offset="0" stop-color="#fff" stop-opacity="0.24"></stop><stop offset="1" stop-color="#fff" stop-opacity="0"></stop>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
<filter id="dp" x="-20%" y="-20%" width="140%" height="145%">
|
|
11
|
+
<feDropShadow dx="0" dy="3" stdDeviation="2.6" flood-color="#0F172A" flood-opacity="0.30"></feDropShadow>
|
|
12
|
+
</filter>
|
|
13
|
+
</defs>
|
|
14
|
+
<g filter="url(#dp)"><rect x="4" y="10" width="120" height="108" rx="26" fill="url(#c)"></rect></g>
|
|
15
|
+
<path d="M4 36 a26 26 0 0 1 26 -26 h68 a26 26 0 0 1 26 26 Z" fill="url(#sheen)"></path>
|
|
16
|
+
<path d="M 56 26 A 32 32 0 1 0 56 90" fill="none" stroke="#fff" stroke-width="14" stroke-linecap="round"></path>
|
|
17
|
+
<g transform="rotate(180 64 64)"><path d="M 56 26 A 32 32 0 1 0 56 90" fill="none" stroke="#fff" stroke-width="14" stroke-linecap="round"></path></g>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
|
|
2
|
+
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="c" x1="0" y1="0" x2="0.55" y2="1">
|
|
5
|
+
<stop offset="0" stop-color="#60A5FA"></stop><stop offset="1" stop-color="#1D4ED8"></stop>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<path d="M 56 26 A 32 32 0 1 0 56 90" fill="none" stroke="url(#c)" stroke-width="15" stroke-linecap="round"></path>
|
|
9
|
+
<g transform="rotate(180 64 64)"><path d="M 56 26 A 32 32 0 1 0 56 90" fill="none" stroke="url(#c)" stroke-width="15" stroke-linecap="round"></path></g>
|
|
10
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
|
|
2
|
+
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="c" x1="0" y1="0" x2="0.55" y2="1">
|
|
5
|
+
<stop offset="0" stop-color="#60A5FA"></stop><stop offset="1" stop-color="#1D4ED8"></stop>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="sheen" x1="0" y1="0" x2="0" y2="1">
|
|
8
|
+
<stop offset="0" stop-color="#fff" stop-opacity="0.24"></stop><stop offset="1" stop-color="#fff" stop-opacity="0"></stop>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
<filter id="dp" x="-20%" y="-20%" width="140%" height="145%">
|
|
11
|
+
<feDropShadow dx="0" dy="3" stdDeviation="2.6" flood-color="#0F172A" flood-opacity="0.30"></feDropShadow>
|
|
12
|
+
</filter>
|
|
13
|
+
</defs>
|
|
14
|
+
<g filter="url(#dp)"><rect x="4" y="10" width="120" height="108" rx="26" fill="url(#c)"></rect></g>
|
|
15
|
+
<path d="M4 36 a26 26 0 0 1 26 -26 h68 a26 26 0 0 1 26 26 Z" fill="url(#sheen)"></path>
|
|
16
|
+
<path d="M 56 26 A 32 32 0 1 0 56 90" fill="none" stroke="#fff" stroke-width="14" stroke-linecap="round"></path>
|
|
17
|
+
<g transform="rotate(180 64 64)"><path d="M 56 26 A 32 32 0 1 0 56 90" fill="none" stroke="#fff" stroke-width="14" stroke-linecap="round"></path></g>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
|
|
2
|
+
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="c" x1="0" y1="0" x2="0.55" y2="1">
|
|
5
|
+
<stop offset="0" stop-color="#60A5FA"></stop><stop offset="1" stop-color="#1D4ED8"></stop>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="sheen" x1="0" y1="0" x2="0" y2="1">
|
|
8
|
+
<stop offset="0" stop-color="#fff" stop-opacity="0.24"></stop><stop offset="1" stop-color="#fff" stop-opacity="0"></stop>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
<filter id="dp" x="-20%" y="-20%" width="140%" height="145%">
|
|
11
|
+
<feDropShadow dx="0" dy="3" stdDeviation="2.6" flood-color="#0F172A" flood-opacity="0.30"></feDropShadow>
|
|
12
|
+
</filter>
|
|
13
|
+
</defs>
|
|
14
|
+
<g filter="url(#dp)"><rect x="4" y="10" width="120" height="108" rx="26" fill="url(#c)"></rect></g>
|
|
15
|
+
<path d="M4 36 a26 26 0 0 1 26 -26 h68 a26 26 0 0 1 26 26 Z" fill="url(#sheen)"></path>
|
|
16
|
+
<path d="M 56 26 A 32 32 0 1 0 56 90" fill="none" stroke="#fff" stroke-width="14" stroke-linecap="round"></path>
|
|
17
|
+
<g transform="rotate(180 64 64)"><path d="M 56 26 A 32 32 0 1 0 56 90" fill="none" stroke="#fff" stroke-width="14" stroke-linecap="round"></path></g>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 3,
|
|
3
|
+
"name": "Agent in Chrome",
|
|
4
|
+
"version": "0.55.0",
|
|
5
|
+
"description": "让 AI agent 操作你已经登录的那个 Chrome 标签页,复用你现有的登录态。 · by Liang (liangai.org)",
|
|
6
|
+
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6Jtdbvmd/bUVxIn9YXdLBw9idVVJwXfCHCGYkPZ0Wp8YcIRBPj10a6L4tTF6h78cLjvgowiZmCAdiUZekjBdPrKJT9nhkGIX9yER3DfRpk0NOkTxum95Eb/K6Y4U/3q1TbhFkebBFZAcPG6O5/Nh8qnTiEuN/EFB3PqlODh4UInLxYbGsHV5vp4WXxfGOt1fF3VkekS7T1gPndijbBBeriv61eb7KguMNrEbid+p07kBPDZ6D3mp4JT6eqsfoPgK01QISBMrJgou0ra9Z4t+bhPvsoe2xAkr8X5iojSAVKUs1UKyKueV2WJ1JPqdAFIRckWwZ4sqEpk/LenKFljTiQIDAQAB",
|
|
7
|
+
"minimum_chrome_version": "125",
|
|
8
|
+
"background": {
|
|
9
|
+
"service_worker": "sw.js",
|
|
10
|
+
"type": "module"
|
|
11
|
+
},
|
|
12
|
+
"action": {
|
|
13
|
+
"default_title": "Agent in Chrome",
|
|
14
|
+
"default_popup": "popup.html",
|
|
15
|
+
"default_icon": {
|
|
16
|
+
"16": "icons/icon-16.png",
|
|
17
|
+
"24": "icons/icon-24.png",
|
|
18
|
+
"32": "icons/icon-32.png",
|
|
19
|
+
"48": "icons/icon-48.png",
|
|
20
|
+
"64": "icons/icon-64.png",
|
|
21
|
+
"128": "icons/icon-128.png"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"icons": {
|
|
25
|
+
"16": "icons/icon-16.png",
|
|
26
|
+
"24": "icons/icon-24.png",
|
|
27
|
+
"32": "icons/icon-32.png",
|
|
28
|
+
"48": "icons/icon-48.png",
|
|
29
|
+
"64": "icons/icon-64.png",
|
|
30
|
+
"128": "icons/icon-128.png"
|
|
31
|
+
},
|
|
32
|
+
"permissions": [
|
|
33
|
+
"debugger",
|
|
34
|
+
"nativeMessaging",
|
|
35
|
+
"tabs",
|
|
36
|
+
"tabGroups",
|
|
37
|
+
"scripting",
|
|
38
|
+
"storage",
|
|
39
|
+
"alarms"
|
|
40
|
+
],
|
|
41
|
+
"host_permissions": [
|
|
42
|
+
"<all_urls>"
|
|
43
|
+
]
|
|
44
|
+
}
|