dsh-chrome-use 0.7.0 → 0.7.1
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/CHANGELOG.md +7 -0
- package/extension/manifest.json +1 -1
- package/extension/popup.css +2 -1
- package/extension/popup.html +1 -1
- package/package.json +1 -1
- package/src/bridge.js +2 -2
- package/src/client.js +3 -3
- package/src/settings-client.js +1 -1
- package/src/settings-contract.js +1 -1
- package/src/skill.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
- README 的「当前限制」从长段落改成逐条列表,每条以加粗短标签开头。只调整排版,事实和技术结论没有变化;扩展与插件功能与 0.6.7 完全相同,没有行为变化。
|
|
12
12
|
=======
|
|
13
|
+
## [0.7.1] - 2026-11-12
|
|
14
|
+
|
|
15
|
+
### 变更
|
|
16
|
+
|
|
17
|
+
- 配对码有效期从 2 分钟延长到 10 分钟,生成新码仍会让旧码立即失效。
|
|
18
|
+
- 扩展弹窗的连接错误提示移到配对码输入框正下方,不用滚到弹窗底部才能看到。
|
|
19
|
+
|
|
13
20
|
## [0.7.0] - 2026-11-12
|
|
14
21
|
|
|
15
22
|
### 新增
|
package/extension/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "dsh-chrome-use",
|
|
4
4
|
"description": "Let DeepSeek Harness control Chrome tabs, with several agent sessions working in parallel.",
|
|
5
|
-
"version": "0.7.
|
|
5
|
+
"version": "0.7.1",
|
|
6
6
|
"minimum_chrome_version": "120",
|
|
7
7
|
"permissions": [
|
|
8
8
|
"debugger",
|
package/extension/popup.css
CHANGED
|
@@ -30,7 +30,8 @@ li { padding: 5px 0; overflow-wrap: anywhere; }
|
|
|
30
30
|
.secondary:hover:not(:disabled) { background: #edf3fc; }
|
|
31
31
|
.mode-row { display: flex; align-items: center; gap: 7px; margin: 6px 0 8px; font-size: 13px; font-weight: 600; }
|
|
32
32
|
.mode-row input { width: auto; margin: 0; padding: 0; letter-spacing: 0; }
|
|
33
|
-
#error { color: #a22331; font-size: 12px; overflow-wrap: anywhere; }
|
|
33
|
+
#error { color: #a22331; font-size: 12px; overflow-wrap: anywhere; margin: 8px 0 0; }
|
|
34
|
+
#error:empty { display: none; }
|
|
34
35
|
footer { padding: 12px 22px 18px; color: #657083; font-size: 11px; }
|
|
35
36
|
footer p { margin: 0; }
|
|
36
37
|
footer .star { margin-bottom: 6px; font-size: 12px; }
|
package/extension/popup.html
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
<input id="code" aria-label="配对码" inputmode="text" autocapitalize="characters" autocomplete="off" spellcheck="false" maxlength="8" placeholder="粘贴 8 位配对码">
|
|
13
13
|
<button type="submit">连接</button>
|
|
14
14
|
</div>
|
|
15
|
+
<p id="error" role="alert"></p>
|
|
15
16
|
</form>
|
|
16
17
|
<section>
|
|
17
18
|
<p class="help">连接后,AI 自动选择网页,无需逐页授权。点击“断开全部连接”可以停止全部操作。</p>
|
|
@@ -24,7 +25,6 @@
|
|
|
24
25
|
<p class="help" id="foreground-off">关:只在浏览器窗口内切换标签页,不抢焦点;窗口被最小化或完全遮挡时,操作会返回 PAGE_HIDDEN。改完立即生效,不用重新连接。</p>
|
|
25
26
|
</section>
|
|
26
27
|
<button id="disconnect" class="secondary">断开全部连接</button>
|
|
27
|
-
<p id="error" role="alert"></p>
|
|
28
28
|
</main>
|
|
29
29
|
<footer>
|
|
30
30
|
<p class="star"><a href="https://github.com/tao1020/dsh-chrome-use" target="_blank" rel="noreferrer">喜欢这个插件?点个 Star,让更多人发现它 ⭐</a></p>
|
package/package.json
CHANGED
package/src/bridge.js
CHANGED
|
@@ -152,12 +152,12 @@ export class Bridge {
|
|
|
152
152
|
if (this.peer) throw new Error('ALREADY_CONNECTED: disconnect in the extension before pairing again');
|
|
153
153
|
const code = String(randomInt(10000000, 100000000));
|
|
154
154
|
const pairingCode = generatePairingCode(this.port, () => randomInt(0, 0x1000000));
|
|
155
|
-
this.pairing = { code, pairingCode, expires: Date.now() +
|
|
155
|
+
this.pairing = { code, pairingCode, expires: Date.now() + 600000, attempts: 0 };
|
|
156
156
|
return {
|
|
157
157
|
code,
|
|
158
158
|
pairingCode,
|
|
159
159
|
port: this.port,
|
|
160
|
-
expiresInSeconds:
|
|
160
|
+
expiresInSeconds: 600,
|
|
161
161
|
instructions: `Open dsh-chrome-use in the Chrome toolbar and enter the 8-character pairing code for port ${this.port}. New extensions read the port from the code; older extensions use the 8-digit compatibility code only on port 18791. Connecting permits access to all normal tabs in this Chrome. Do not enter the code into a website or post it publicly.`,
|
|
162
162
|
};
|
|
163
163
|
}
|
package/src/client.js
CHANGED
|
@@ -17,7 +17,7 @@ function parsePairing(value) {
|
|
|
17
17
|
if (typeof value.pairingCode !== 'string' || !PAIRING_CODE_RE.test(value.pairingCode) || !/[A-Z]/.test(value.pairingCode)) throw new Error('Invalid pairing code');
|
|
18
18
|
}
|
|
19
19
|
if (!Number.isSafeInteger(value.port) || value.port < 1 || value.port > 65535) throw new Error('Invalid pairing port');
|
|
20
|
-
if (!Number.isSafeInteger(value.expiresInSeconds) || value.expiresInSeconds < 1 || value.expiresInSeconds >
|
|
20
|
+
if (!Number.isSafeInteger(value.expiresInSeconds) || value.expiresInSeconds < 1 || value.expiresInSeconds > 3600) throw new Error('Invalid pairing lifetime');
|
|
21
21
|
if (typeof value.instructions !== 'string' || value.instructions.length > 2000) throw new Error('Invalid pairing instructions');
|
|
22
22
|
return { code: value.code, ...(value.pairingCode === undefined ? {} : { pairingCode: value.pairingCode }), port: value.port, expiresInSeconds: value.expiresInSeconds, instructions: value.instructions };
|
|
23
23
|
}
|
|
@@ -68,7 +68,7 @@ async function checkRelease(current, fetcher = fetch) {
|
|
|
68
68
|
} finally { clearTimeout(timer); }
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
const packageVersion = "0.7.
|
|
71
|
+
const packageVersion = "0.7.1";
|
|
72
72
|
// Wrapped by scripts/build-client.mjs for the Harness browser module loader.
|
|
73
73
|
const React = require('react');
|
|
74
74
|
const { createElement: h, useState, useEffect, useRef } = React;
|
|
@@ -157,7 +157,7 @@ function StatusPage({ read, pair }) {
|
|
|
157
157
|
h('button', { onClick: refresh, disabled: state.loading, style: buttonStyle }, state.loading ? '刷新中…' : '刷新状态'));
|
|
158
158
|
const pairBlock = h('div', { key: 'pair' },
|
|
159
159
|
h('h3', null, '配对 Chrome 扩展'),
|
|
160
|
-
h('p', null, '点击下面的按钮生成 8 位配对码,然后在 Chrome 工具栏打开 dsh-chrome-use 扩展,粘贴配对码并点击“连接”。新配对码已经包含端口,扩展会自动识别,不需要手填端口。配对码
|
|
160
|
+
h('p', null, '点击下面的按钮生成 8 位配对码,然后在 Chrome 工具栏打开 dsh-chrome-use 扩展,粘贴配对码并点击“连接”。新配对码已经包含端口,扩展会自动识别,不需要手填端口。配对码 10 分钟内有效,生成新码会让旧码立即失效。'),
|
|
161
161
|
h('button', { onClick: requestPairing, disabled: pairing.loading, style: buttonStyle }, pairing.loading ? '正在生成…' : pairing.code || expired ? '重新生成配对码' : '生成配对码'),
|
|
162
162
|
pairing.error && h('p', { role: 'alert', style: { color: 'var(--dsh-danger, #d9534f)' } }, pairing.error),
|
|
163
163
|
pairing.code && !expired && h('div', { style: { marginTop: 12 } },
|
package/src/settings-client.js
CHANGED
|
@@ -86,7 +86,7 @@ function StatusPage({ read, pair }) {
|
|
|
86
86
|
h('button', { onClick: refresh, disabled: state.loading, style: buttonStyle }, state.loading ? '刷新中…' : '刷新状态'));
|
|
87
87
|
const pairBlock = h('div', { key: 'pair' },
|
|
88
88
|
h('h3', null, '配对 Chrome 扩展'),
|
|
89
|
-
h('p', null, '点击下面的按钮生成 8 位配对码,然后在 Chrome 工具栏打开 dsh-chrome-use 扩展,粘贴配对码并点击“连接”。新配对码已经包含端口,扩展会自动识别,不需要手填端口。配对码
|
|
89
|
+
h('p', null, '点击下面的按钮生成 8 位配对码,然后在 Chrome 工具栏打开 dsh-chrome-use 扩展,粘贴配对码并点击“连接”。新配对码已经包含端口,扩展会自动识别,不需要手填端口。配对码 10 分钟内有效,生成新码会让旧码立即失效。'),
|
|
90
90
|
h('button', { onClick: requestPairing, disabled: pairing.loading, style: buttonStyle }, pairing.loading ? '正在生成…' : pairing.code || expired ? '重新生成配对码' : '生成配对码'),
|
|
91
91
|
pairing.error && h('p', { role: 'alert', style: { color: 'var(--dsh-danger, #d9534f)' } }, pairing.error),
|
|
92
92
|
pairing.code && !expired && h('div', { style: { marginTop: 12 } },
|
package/src/settings-contract.js
CHANGED
|
@@ -16,7 +16,7 @@ export function parsePairing(value) {
|
|
|
16
16
|
if (typeof value.pairingCode !== 'string' || !PAIRING_CODE_RE.test(value.pairingCode) || !/[A-Z]/.test(value.pairingCode)) throw new Error('Invalid pairing code');
|
|
17
17
|
}
|
|
18
18
|
if (!Number.isSafeInteger(value.port) || value.port < 1 || value.port > 65535) throw new Error('Invalid pairing port');
|
|
19
|
-
if (!Number.isSafeInteger(value.expiresInSeconds) || value.expiresInSeconds < 1 || value.expiresInSeconds >
|
|
19
|
+
if (!Number.isSafeInteger(value.expiresInSeconds) || value.expiresInSeconds < 1 || value.expiresInSeconds > 3600) throw new Error('Invalid pairing lifetime');
|
|
20
20
|
if (typeof value.instructions !== 'string' || value.instructions.length > 2000) throw new Error('Invalid pairing instructions');
|
|
21
21
|
return { code: value.code, ...(value.pairingCode === undefined ? {} : { pairingCode: value.pairingCode }), port: value.port, expiresInSeconds: value.expiresInSeconds, instructions: value.instructions };
|
|
22
22
|
}
|
package/src/skill.js
CHANGED
|
@@ -16,7 +16,7 @@ export const chromeUseSkill = {
|
|
|
16
16
|
## 连接
|
|
17
17
|
|
|
18
18
|
1. 先调用 chrome_status 检查连接。
|
|
19
|
-
2. 未连接时调用 chrome_pair 生成 8 位配对码(
|
|
19
|
+
2. 未连接时调用 chrome_pair 生成 8 位配对码(10 分钟内有效)。返回里有 pairingCode 时优先把 pairingCode 给用户;它已经包含端口,新扩展会自动识别,不要要求用户再填端口。没有 pairingCode 时使用纯数字 code(旧桥/旧扩展,只在 18791 可用)。让用户在 Chrome 工具栏打开 dsh-chrome-use 扩展,粘贴配对码并点击“连接”。扩展还没安装时,让用户到 Harness 设置 → dsh-chrome-use 点商店链接安装。不要要求用户重装或手动加载文件夹。
|
|
20
20
|
3. 配对成功后,重启 Harness、Chrome 或扩展自动更新都会自动重连。用户主动断开后,留空配对码点“连接”即可。
|
|
21
21
|
|
|
22
22
|
## 操作流程
|