dsh-browser-cdp 1.14.9 → 1.14.11
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 +39 -0
- package/bin/cdp-cast-worker.mjs +88 -18
- package/dsh-plugin.json +1 -1
- package/lib/client.js +965 -151
- package/lib/index.js +205 -65
- package/lib/{launcher-DfE6ivh_.js → launcher-BnxRC9AU.js} +59 -11
- package/lib/launcher-y5sx1g6M.js +3 -0
- package/package.json +1 -1
- package/skills/bcdp-browser/SKILL.md +105 -68
- package/lib/launcher-YRO_KCPS.js +0 -3
package/lib/client.js
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
window.__ModuleLoader__.load({ id: "dsh-browser-cdp", factory: (require) => {
|
|
2
2
|
var module = { exports: {} }; var exports = module.exports;
|
|
3
|
+
//#region rolldown:runtime
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
+
value: mod,
|
|
22
|
+
enumerable: true
|
|
23
|
+
}) : target, mod));
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
let react = require("react");
|
|
27
|
+
react = __toESM(react);
|
|
28
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
react_jsx_runtime = __toESM(react_jsx_runtime);
|
|
3
30
|
|
|
4
31
|
//#region src/client/fam-links.ts
|
|
5
32
|
/**
|
|
@@ -314,6 +341,364 @@ function shouldShowGen1SettingsGear(hasConfigForms, hasOpenSettingsDocument) {
|
|
|
314
341
|
return !hasConfigForms && !hasOpenSettingsDocument;
|
|
315
342
|
}
|
|
316
343
|
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/client/guide.tsx
|
|
346
|
+
/** 生态通用的十个语言码(与各插件 `locale/*.json`、README 的十语镜像同口径)。 */
|
|
347
|
+
const GUIDE_LOCALES = [
|
|
348
|
+
"zh",
|
|
349
|
+
"en",
|
|
350
|
+
"ja",
|
|
351
|
+
"ko",
|
|
352
|
+
"fr",
|
|
353
|
+
"de",
|
|
354
|
+
"it",
|
|
355
|
+
"ru",
|
|
356
|
+
"es",
|
|
357
|
+
"pt"
|
|
358
|
+
];
|
|
359
|
+
/**
|
|
360
|
+
* 引导外壳词表(10 语)。
|
|
361
|
+
*
|
|
362
|
+
* 为什么不塞进各插件 locales:这七个词是**跨插件同一套**,塞进九个字典要重复翻译
|
|
363
|
+
* 9×10 次,且一旦措辞调整就得动九个仓。外壳留在本文件,正文留各插件。
|
|
364
|
+
*/
|
|
365
|
+
const GUIDE_COPY = {
|
|
366
|
+
zh: {
|
|
367
|
+
title: "快速上手",
|
|
368
|
+
skip: "跳过引导",
|
|
369
|
+
next: "下一步",
|
|
370
|
+
prev: "上一步",
|
|
371
|
+
done: "开始使用",
|
|
372
|
+
restart: "重新查看引导",
|
|
373
|
+
stepOf: (current, total) => `第 ${current} / ${total} 步`
|
|
374
|
+
},
|
|
375
|
+
en: {
|
|
376
|
+
title: "Quick start",
|
|
377
|
+
skip: "Skip guide",
|
|
378
|
+
next: "Next",
|
|
379
|
+
prev: "Back",
|
|
380
|
+
done: "Get started",
|
|
381
|
+
restart: "Show guide again",
|
|
382
|
+
stepOf: (current, total) => `Step ${current} of ${total}`
|
|
383
|
+
},
|
|
384
|
+
ja: {
|
|
385
|
+
title: "クイックスタート",
|
|
386
|
+
skip: "ガイドをスキップ",
|
|
387
|
+
next: "次へ",
|
|
388
|
+
prev: "戻る",
|
|
389
|
+
done: "はじめる",
|
|
390
|
+
restart: "ガイドをもう一度表示",
|
|
391
|
+
stepOf: (current, total) => `ステップ ${current} / ${total}`
|
|
392
|
+
},
|
|
393
|
+
ko: {
|
|
394
|
+
title: "빠른 시작",
|
|
395
|
+
skip: "가이드 건너뛰기",
|
|
396
|
+
next: "다음",
|
|
397
|
+
prev: "이전",
|
|
398
|
+
done: "시작하기",
|
|
399
|
+
restart: "가이드 다시 보기",
|
|
400
|
+
stepOf: (current, total) => `${current} / ${total} 단계`
|
|
401
|
+
},
|
|
402
|
+
fr: {
|
|
403
|
+
title: "Démarrage rapide",
|
|
404
|
+
skip: "Ignorer le guide",
|
|
405
|
+
next: "Suivant",
|
|
406
|
+
prev: "Retour",
|
|
407
|
+
done: "Commencer",
|
|
408
|
+
restart: "Revoir le guide",
|
|
409
|
+
stepOf: (current, total) => `Étape ${current} sur ${total}`
|
|
410
|
+
},
|
|
411
|
+
de: {
|
|
412
|
+
title: "Schnellstart",
|
|
413
|
+
skip: "Anleitung überspringen",
|
|
414
|
+
next: "Weiter",
|
|
415
|
+
prev: "Zurück",
|
|
416
|
+
done: "Loslegen",
|
|
417
|
+
restart: "Anleitung erneut anzeigen",
|
|
418
|
+
stepOf: (current, total) => `Schritt ${current} von ${total}`
|
|
419
|
+
},
|
|
420
|
+
it: {
|
|
421
|
+
title: "Avvio rapido",
|
|
422
|
+
skip: "Salta la guida",
|
|
423
|
+
next: "Avanti",
|
|
424
|
+
prev: "Indietro",
|
|
425
|
+
done: "Inizia",
|
|
426
|
+
restart: "Rivedi la guida",
|
|
427
|
+
stepOf: (current, total) => `Passo ${current} di ${total}`
|
|
428
|
+
},
|
|
429
|
+
ru: {
|
|
430
|
+
title: "Быстрый старт",
|
|
431
|
+
skip: "Пропустить руководство",
|
|
432
|
+
next: "Далее",
|
|
433
|
+
prev: "Назад",
|
|
434
|
+
done: "Начать",
|
|
435
|
+
restart: "Показать руководство снова",
|
|
436
|
+
stepOf: (current, total) => `Шаг ${current} из ${total}`
|
|
437
|
+
},
|
|
438
|
+
es: {
|
|
439
|
+
title: "Inicio rápido",
|
|
440
|
+
skip: "Omitir la guía",
|
|
441
|
+
next: "Siguiente",
|
|
442
|
+
prev: "Atrás",
|
|
443
|
+
done: "Empezar",
|
|
444
|
+
restart: "Ver la guía de nuevo",
|
|
445
|
+
stepOf: (current, total) => `Paso ${current} de ${total}`
|
|
446
|
+
},
|
|
447
|
+
pt: {
|
|
448
|
+
title: "Início rápido",
|
|
449
|
+
skip: "Ignorar o guia",
|
|
450
|
+
next: "Próximo",
|
|
451
|
+
prev: "Voltar",
|
|
452
|
+
done: "Começar",
|
|
453
|
+
restart: "Ver o guia novamente",
|
|
454
|
+
stepOf: (current, total) => `Passo ${current} de ${total}`
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
/** 语言标签 → 语言码:只认主标签,认不出的落 null(由调用方回退 en)。 */
|
|
458
|
+
function normalizeGuideLocale(tag) {
|
|
459
|
+
const primary = tag.toLowerCase().trim().split(/[-_]/)[0] ?? "";
|
|
460
|
+
return GUIDE_LOCALES.includes(primary) ? primary : null;
|
|
461
|
+
}
|
|
462
|
+
function htmlLang() {
|
|
463
|
+
try {
|
|
464
|
+
return typeof document === "undefined" ? "" : document.documentElement?.lang ?? "";
|
|
465
|
+
} catch {
|
|
466
|
+
return "";
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* 当前引导语言:以宿主 `<html lang>` 为准(语言切换会改写这个属性)。
|
|
471
|
+
*
|
|
472
|
+
* 认不出 → en:引导是「帮助」面,宁可给英文也不能给空白或中文硬串。
|
|
473
|
+
*/
|
|
474
|
+
function currentGuideLocale() {
|
|
475
|
+
return normalizeGuideLocale(htmlLang()) ?? "en";
|
|
476
|
+
}
|
|
477
|
+
/** 引导外壳取词。 */
|
|
478
|
+
function guideLabels(locale = currentGuideLocale()) {
|
|
479
|
+
return GUIDE_COPY[locale] ?? GUIDE_COPY.en;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* 步骤正文取词:本语 → en → zh → 表里第一个可用。
|
|
483
|
+
*
|
|
484
|
+
* 为什么需要回退链:九插件分批补语种,某个插件可能只有 zh/en 而宿主是 ru;
|
|
485
|
+
* 这时给英文是可用的,给空白等于「引导坏了」。`undefined` 步骤表按空表处理。
|
|
486
|
+
*/
|
|
487
|
+
function guideSteps(map) {
|
|
488
|
+
if (map === void 0) return [];
|
|
489
|
+
const order = [
|
|
490
|
+
currentGuideLocale(),
|
|
491
|
+
"en",
|
|
492
|
+
"zh"
|
|
493
|
+
];
|
|
494
|
+
for (const key of order) {
|
|
495
|
+
const hit = key === void 0 ? void 0 : map[key];
|
|
496
|
+
if (hit !== void 0 && hit.length > 0) return hit;
|
|
497
|
+
}
|
|
498
|
+
for (const key of GUIDE_LOCALES) {
|
|
499
|
+
const hit = map[key];
|
|
500
|
+
if (hit !== void 0 && hit.length > 0) return hit;
|
|
501
|
+
}
|
|
502
|
+
return [];
|
|
503
|
+
}
|
|
504
|
+
function guideStorageKey(ns) {
|
|
505
|
+
return `dsh.guide.${ns}.skipped`;
|
|
506
|
+
}
|
|
507
|
+
/** 是否已跳过(存储不可用时按「未跳过」处理:宁可多教一次,不要静默不教)。 */
|
|
508
|
+
function isGuideSkipped(ns) {
|
|
509
|
+
try {
|
|
510
|
+
return typeof localStorage !== "undefined" && localStorage.getItem(guideStorageKey(ns)) === "1";
|
|
511
|
+
} catch {
|
|
512
|
+
return false;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
/** 记下跳过;写失败不抛(隐私模式 / 存储禁用)。 */
|
|
516
|
+
function skipGuide(ns) {
|
|
517
|
+
try {
|
|
518
|
+
localStorage?.setItem(guideStorageKey(ns), "1");
|
|
519
|
+
} catch {}
|
|
520
|
+
}
|
|
521
|
+
/** 清标记 = 允许重新教学。 */
|
|
522
|
+
function resetGuide(ns) {
|
|
523
|
+
try {
|
|
524
|
+
localStorage?.removeItem(guideStorageKey(ns));
|
|
525
|
+
} catch {}
|
|
526
|
+
}
|
|
527
|
+
const GUIDE_CSS = `
|
|
528
|
+
.sgGuide{border:1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.28));background:var(--dsw-alias-bg-layer-2, rgba(127,127,127,.06));border-radius:12px;padding:14px 16px;margin:0 0 12px}
|
|
529
|
+
.sgGuideHead{display:flex;align-items:center;gap:8px;margin:0 0 10px}
|
|
530
|
+
.sgGuideTitle{font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary, currentColor)}
|
|
531
|
+
.sgGuideStep{font-size:12px;color:var(--dsw-alias-label-tertiary, rgba(127,127,127,.9));margin-left:auto}
|
|
532
|
+
.sgGuideBody{font-size:13px;line-height:1.6;color:var(--dsw-alias-label-secondary, currentColor);min-height:52px}
|
|
533
|
+
.sgGuideBody b{color:var(--dsw-alias-label-primary, currentColor);font-weight:600}
|
|
534
|
+
.sgGuideDots{display:flex;gap:6px;margin:10px 0 0}
|
|
535
|
+
.sgGuideDot{width:6px;height:6px;border-radius:50%;background:var(--dsw-alias-border-l2, rgba(127,127,127,.3))}
|
|
536
|
+
.sgGuideDot-on{background:var(--dsw-alias-button-primary-fill, #4d6bfe)}
|
|
537
|
+
.sgGuideFoot{display:flex;align-items:center;gap:8px;margin:12px 0 0}
|
|
538
|
+
.sgGuideBtn{appearance:none;font:inherit;font-size:12px;padding:5px 12px;border-radius:8px;border:1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.3));background:transparent;color:var(--dsw-alias-label-primary, currentColor);cursor:pointer}
|
|
539
|
+
.sgGuideBtn-primary{background:var(--dsw-alias-button-primary-fill, #4d6bfe);border-color:transparent;color:#fff}
|
|
540
|
+
.sgGuideBtn-skip{margin-right:auto;color:var(--dsw-alias-label-tertiary, rgba(127,127,127,.9));border-color:transparent;text-decoration:underline}
|
|
541
|
+
.sgGuideRestart{appearance:none;font:inherit;font-size:12px;padding:0;border:0;background:transparent;color:var(--dsw-alias-link-primary, #4d6bfe);cursor:pointer;text-decoration:underline}
|
|
542
|
+
`;
|
|
543
|
+
function injectGuideCss() {
|
|
544
|
+
try {
|
|
545
|
+
if (typeof document === "undefined") return;
|
|
546
|
+
if (typeof document.querySelector !== "function") return;
|
|
547
|
+
if (typeof document.createElement !== "function") return;
|
|
548
|
+
if (!document.head) return;
|
|
549
|
+
if (document.querySelector("style[data-plugin-css=\"guide-kit\"]") !== null) return;
|
|
550
|
+
const tag = document.createElement("style");
|
|
551
|
+
tag.dataset.pluginCss = "guide-kit";
|
|
552
|
+
tag.textContent = GUIDE_CSS;
|
|
553
|
+
document.head.appendChild(tag);
|
|
554
|
+
} catch {}
|
|
555
|
+
}
|
|
556
|
+
/** 语言变更订阅:语言切换后重渲染词表(引导是短生命周期,直接跟随 <html lang>)。 */
|
|
557
|
+
function useLangTick() {
|
|
558
|
+
const [, setTick] = (0, react.useState)(0);
|
|
559
|
+
(0, react.useEffect)(() => {
|
|
560
|
+
try {
|
|
561
|
+
if (typeof MutationObserver === "undefined" || typeof document === "undefined") return;
|
|
562
|
+
if (!document.documentElement) return;
|
|
563
|
+
const observer = new MutationObserver(() => setTick((n) => n + 1));
|
|
564
|
+
observer.observe(document.documentElement, {
|
|
565
|
+
attributes: true,
|
|
566
|
+
attributeFilter: ["lang"]
|
|
567
|
+
});
|
|
568
|
+
return () => observer.disconnect();
|
|
569
|
+
} catch {
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
}, []);
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* 引导主体:3 步以内的小教学 + 恒定可见的 Skip。
|
|
576
|
+
*
|
|
577
|
+
* `onClose` 由宿主卡面传:Skip/Done 都会调用它(Skip 同时写标记)。
|
|
578
|
+
*/
|
|
579
|
+
function GuidePanel(props) {
|
|
580
|
+
const { ns, steps, onClose } = props;
|
|
581
|
+
const [index, setIndex] = (0, react.useState)(0);
|
|
582
|
+
useLangTick();
|
|
583
|
+
const labels = guideLabels();
|
|
584
|
+
(0, react.useEffect)(() => {
|
|
585
|
+
injectGuideCss();
|
|
586
|
+
}, []);
|
|
587
|
+
if (steps.length === 0) return null;
|
|
588
|
+
const current = steps[Math.min(index, steps.length - 1)];
|
|
589
|
+
const last = index >= steps.length - 1;
|
|
590
|
+
const finish = () => {
|
|
591
|
+
skipGuide(ns);
|
|
592
|
+
onClose();
|
|
593
|
+
};
|
|
594
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
595
|
+
className: "sgGuide",
|
|
596
|
+
"aria-label": labels.title,
|
|
597
|
+
children: [
|
|
598
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
|
|
599
|
+
className: "sgGuideHead",
|
|
600
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
601
|
+
className: "sgGuideTitle",
|
|
602
|
+
children: labels.title
|
|
603
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
604
|
+
className: "sgGuideStep",
|
|
605
|
+
children: labels.stepOf(index + 1, steps.length)
|
|
606
|
+
})]
|
|
607
|
+
}),
|
|
608
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
609
|
+
className: "sgGuideBody",
|
|
610
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: current.title }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: current.body })]
|
|
611
|
+
}),
|
|
612
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
613
|
+
className: "sgGuideDots",
|
|
614
|
+
"aria-hidden": "true",
|
|
615
|
+
children: steps.map((step, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "sgGuideDot" + (i === index ? " sgGuideDot-on" : "") }, step.title))
|
|
616
|
+
}),
|
|
617
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("footer", {
|
|
618
|
+
className: "sgGuideFoot",
|
|
619
|
+
children: [
|
|
620
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
621
|
+
type: "button",
|
|
622
|
+
className: "sgGuideBtn sgGuideBtn-skip",
|
|
623
|
+
onClick: () => finish(),
|
|
624
|
+
children: labels.skip
|
|
625
|
+
}),
|
|
626
|
+
index > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
627
|
+
type: "button",
|
|
628
|
+
className: "sgGuideBtn",
|
|
629
|
+
onClick: () => setIndex(index - 1),
|
|
630
|
+
children: labels.prev
|
|
631
|
+
}),
|
|
632
|
+
last ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
633
|
+
type: "button",
|
|
634
|
+
className: "sgGuideBtn sgGuideBtn-primary",
|
|
635
|
+
onClick: () => finish(),
|
|
636
|
+
children: labels.done
|
|
637
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
638
|
+
type: "button",
|
|
639
|
+
className: "sgGuideBtn sgGuideBtn-primary",
|
|
640
|
+
onClick: () => setIndex(index + 1),
|
|
641
|
+
children: labels.next
|
|
642
|
+
})
|
|
643
|
+
]
|
|
644
|
+
})
|
|
645
|
+
]
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* 重启入口:清标记 + 就地重开引导。
|
|
650
|
+
*
|
|
651
|
+
* 统一件,避免九插件各写一份(措辞/样式/清标记时机容易走样)。跳过之后
|
|
652
|
+
* 用户想再看一次,不需要去清浏览器存储。
|
|
653
|
+
*/
|
|
654
|
+
function GuideRestartButton(props) {
|
|
655
|
+
const { ns, onOpen, style } = props;
|
|
656
|
+
useLangTick();
|
|
657
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
658
|
+
type: "button",
|
|
659
|
+
className: "sgGuideRestart",
|
|
660
|
+
style,
|
|
661
|
+
onClick: () => {
|
|
662
|
+
resetGuide(ns);
|
|
663
|
+
onOpen();
|
|
664
|
+
},
|
|
665
|
+
children: guideLabels().restart
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
//#endregion
|
|
670
|
+
//#region src/client/guide-steps.ts
|
|
671
|
+
const BROWSER_CDP_GUIDE_STEPS = {
|
|
672
|
+
zh: [
|
|
673
|
+
{
|
|
674
|
+
title: "先连上一个浏览器",
|
|
675
|
+
body: "「工具封印」下面的连接目标决定每一次 bcdp_* 调用打谁,顺序即优先级。ego / Tabbit / 本机 Chrome / 远端 CDP 任选其一,先探测再激活;列表为空时点「新建」填端点。"
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
title: "工具是懒注入的,不要以为没装上",
|
|
679
|
+
body: "默认只常驻 bcdp_status(它是解锁入口),其余工具在你第一次调用 bcdp_* 之后才铺开;闲置回收后又收起。想一挂载就全给,把「工具注入模式」改成 always。"
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
title: "agent 在动页面时你能看见",
|
|
683
|
+
body: "右侧浮窗逐个页面显示网址、标题和实时截图;被驱动页面的右上角还会出现淡出角标。看到「检测到人机验证」就转人工处理,别硬刷。"
|
|
684
|
+
}
|
|
685
|
+
],
|
|
686
|
+
en: [
|
|
687
|
+
{
|
|
688
|
+
title: "Attach a browser first",
|
|
689
|
+
body: "Under \"Tool sealing\", the connection targets decide who every bcdp_* call hits; order is priority. Pick ego / Tabbit / local Chrome / remote CDP, probe then activate; an empty list means \"New\" with an endpoint."
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
title: "Tools are lazily injected, not missing",
|
|
693
|
+
body: "Only bcdp_status stays resident by default (it is the unlock entry); the rest arrive after your first bcdp_* call and are sealed back on idle reaping. Want everything at mount? Set \"Injection mode\" to always."
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
title: "You can watch the agent drive pages",
|
|
697
|
+
body: "The right-hand bubble lists every live page with URL, title and a live thumbnail; the driven page also shows a fading corner badge. If you see \"captcha detected\", hand it back to a human instead of retrying."
|
|
698
|
+
}
|
|
699
|
+
]
|
|
700
|
+
};
|
|
701
|
+
|
|
317
702
|
//#endregion
|
|
318
703
|
//#region src/client/build.ts
|
|
319
704
|
/**
|
|
@@ -326,7 +711,195 @@ function shouldShowGen1SettingsGear(hasConfigForms, hasOpenSettingsDocument) {
|
|
|
326
711
|
*
|
|
327
712
|
* Keep in sync with package.json — `node scripts/bump.mjs <version>` writes both.
|
|
328
713
|
*/
|
|
329
|
-
const CLIENT_BUILD = "1.
|
|
714
|
+
const CLIENT_BUILD = "1.14.11";
|
|
715
|
+
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region src/client/locales.ts
|
|
718
|
+
/**
|
|
719
|
+
* src/client/locales.ts — 侧栏元数据行的词条(zh/en 双份)。
|
|
720
|
+
*
|
|
721
|
+
* 为什么单独一个文件,而不直接写进 index.ts 的 `watchZh`/`watchEn`:
|
|
722
|
+
* 本仓的 locale 守卫(`tests/locale-guard.test.ts`)对客户端源码做**硬编码中文
|
|
723
|
+
* 棘轮**,`watchZh` 里每一条中文字面量都计入基线。把新词条搬进一个**字典文件**
|
|
724
|
+
* (守卫约定:文件名含 `locale`/`i18n`/`copy` 或位于 `locales/` 目录即视为译文
|
|
725
|
+
* 所在处)既不抬高基线,也不丢词条——index.ts 在启动时把它们 `Object.assign`
|
|
726
|
+
* 进两个字典,`wt()` 取词路径完全不变。
|
|
727
|
+
*
|
|
728
|
+
* 键名与 spec §7 一致;`{n}` 由 `wt(key, {n})` 的占位符替换填充。
|
|
729
|
+
*/
|
|
730
|
+
/** 英文词条(缺 zh 时 `wt` 的最后回退)。 */
|
|
731
|
+
const SPACE_META_EN = {
|
|
732
|
+
capturingOff: "not capturing",
|
|
733
|
+
agoJustNow: "just now",
|
|
734
|
+
agoSeconds: "{n}s ago",
|
|
735
|
+
agoMinutes: "{n}m ago",
|
|
736
|
+
agoHours: "{n}h ago",
|
|
737
|
+
ownerAgent: "agent",
|
|
738
|
+
ownerYou: "you",
|
|
739
|
+
ownerSession: "session {n}",
|
|
740
|
+
zoomSuffix: "{n}%",
|
|
741
|
+
dprSuffix: "@{n}",
|
|
742
|
+
readyLoading: "loading",
|
|
743
|
+
captchaTabBadge: "⚠",
|
|
744
|
+
pagesCount: "{n} pages"
|
|
745
|
+
};
|
|
746
|
+
/** 中文词条。 */
|
|
747
|
+
const SPACE_META_ZH = {
|
|
748
|
+
capturingOff: "未截流",
|
|
749
|
+
agoJustNow: "刚刚",
|
|
750
|
+
agoSeconds: "{n}s 前",
|
|
751
|
+
agoMinutes: "{n}m 前",
|
|
752
|
+
agoHours: "{n}h 前",
|
|
753
|
+
ownerAgent: "agent",
|
|
754
|
+
ownerYou: "你",
|
|
755
|
+
ownerSession: "会话 {n}",
|
|
756
|
+
zoomSuffix: "{n}%",
|
|
757
|
+
dprSuffix: "@{n}",
|
|
758
|
+
readyLoading: "加载中",
|
|
759
|
+
captchaTabBadge: "⚠",
|
|
760
|
+
pagesCount: "{n} 页"
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
//#endregion
|
|
764
|
+
//#region src/client/space-meta.ts
|
|
765
|
+
/**
|
|
766
|
+
* 「最后动作距今」。四档:<3s 刚刚|<60s Ns 前|<1h Nm 前|其余 Nh 前。
|
|
767
|
+
*
|
|
768
|
+
* `lastActive <= 0` 返回 null:0 是「不知道」(worker 没采到帧),不是 1970 ——
|
|
769
|
+
* 显示「54 年前」比不显示更糟。
|
|
770
|
+
*/
|
|
771
|
+
function formatElapsed(lastActive, now, t) {
|
|
772
|
+
const at = Number(lastActive);
|
|
773
|
+
if (!Number.isFinite(at) || at <= 0) return null;
|
|
774
|
+
const seconds = Math.max(0, now - at) / 1e3;
|
|
775
|
+
if (seconds < 3) return t("agoJustNow");
|
|
776
|
+
if (seconds < 60) return t("agoSeconds", { n: Math.floor(seconds) });
|
|
777
|
+
if (seconds < 3600) return t("agoMinutes", { n: Math.floor(seconds / 60) });
|
|
778
|
+
return t("agoHours", { n: Math.floor(seconds / 3600) });
|
|
779
|
+
}
|
|
780
|
+
/** `1280×720`。两个值都得是正整数,否则这一段缺席(不显示 0×0)。 */
|
|
781
|
+
function formatViewport(row) {
|
|
782
|
+
const w = Math.round(Number(row?.viewportW));
|
|
783
|
+
const h = Math.round(Number(row?.viewportH));
|
|
784
|
+
if (!Number.isInteger(w) || !Number.isInteger(h) || w <= 0 || h <= 0) return null;
|
|
785
|
+
return w + "×" + h;
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* `@1.25 · 80%`(DPR 与 zoom,任一缺席就只出另一半)。
|
|
789
|
+
*
|
|
790
|
+
* 只报「非常规」:100% 缩放与 DPR=1 是默认态,写出来只是噪声。
|
|
791
|
+
*/
|
|
792
|
+
function formatZoom(dpr, zoom, t) {
|
|
793
|
+
const parts = [];
|
|
794
|
+
const ratio = Number(dpr);
|
|
795
|
+
if (Number.isFinite(ratio) && ratio > 0 && Math.abs(ratio - 1) >= .005) parts.push(t("dprSuffix", { n: Math.round(ratio * 100) / 100 }));
|
|
796
|
+
const percent = Number(zoom);
|
|
797
|
+
if (Number.isFinite(percent) && percent > 0 && Math.round(percent) !== 100) parts.push(t("zoomSuffix", { n: Math.round(percent) }));
|
|
798
|
+
return parts.length === 0 ? null : parts.join(" · ");
|
|
799
|
+
}
|
|
800
|
+
/** 加载态:只有 `loading` 值得说;interactive/complete 是正常态,不占位。 */
|
|
801
|
+
function formatReadyState(state, t) {
|
|
802
|
+
return state === "loading" ? t("readyLoading") : null;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* 谁在驱动:`agent` / `你`,带会话时追加 `· 会话 a1b2`(会话 id 只取前 4 位——
|
|
806
|
+
* 全 id 会把这行撑爆,而侧栏要的是「是不是我刚发起的那轮」,不是可复制的句柄)。
|
|
807
|
+
*/
|
|
808
|
+
function formatOwner(owner, t) {
|
|
809
|
+
const source = owner?.source;
|
|
810
|
+
const who = source === "agent" ? t("ownerAgent") : source === "operator" ? t("ownerYou") : null;
|
|
811
|
+
const raw = typeof owner?.sessionId === "string" ? owner.sessionId.trim() : "";
|
|
812
|
+
const session = raw === "" ? null : t("ownerSession", { n: raw.slice(0, 4) });
|
|
813
|
+
if (who === null && session === null) return null;
|
|
814
|
+
return [who, session].filter((part) => part !== null).join(" · ");
|
|
815
|
+
}
|
|
816
|
+
/** 该 tab 是否在被截流:只有明确的 `false` 值得说(`true`/未知都是常态)。 */
|
|
817
|
+
function formatCapturing(capturing, t) {
|
|
818
|
+
return capturing === false ? t("capturingOff") : null;
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* 一整行:viewport · 设备 · 距今 · 加载态 · 未截流 · 谁在驱动。
|
|
822
|
+
*
|
|
823
|
+
* 顺序是刻意的:越靠左越是「这页是什么」,越靠右越是「谁在动它」;窄面板下
|
|
824
|
+
* 尾部先被省略号吃掉,用户仍能读到尺寸与时间。
|
|
825
|
+
*/
|
|
826
|
+
function formatSpaceMeta(input, now, t) {
|
|
827
|
+
const row = input.row ?? null;
|
|
828
|
+
const segments = [];
|
|
829
|
+
const viewport = formatViewport(row);
|
|
830
|
+
if (viewport !== null) segments.push({
|
|
831
|
+
key: "viewport",
|
|
832
|
+
text: viewport
|
|
833
|
+
});
|
|
834
|
+
const device = formatZoom(row?.dpr, row?.zoom, t);
|
|
835
|
+
if (device !== null) segments.push({
|
|
836
|
+
key: "device",
|
|
837
|
+
text: device
|
|
838
|
+
});
|
|
839
|
+
const elapsed = formatElapsed(row?.lastActive, now, t);
|
|
840
|
+
if (elapsed !== null) segments.push({
|
|
841
|
+
key: "elapsed",
|
|
842
|
+
text: elapsed
|
|
843
|
+
});
|
|
844
|
+
const ready = formatReadyState(row?.readyState, t);
|
|
845
|
+
if (ready !== null) segments.push({
|
|
846
|
+
key: "ready",
|
|
847
|
+
text: ready
|
|
848
|
+
});
|
|
849
|
+
const capturing = formatCapturing(row?.capturing, t);
|
|
850
|
+
if (capturing !== null) segments.push({
|
|
851
|
+
key: "capturing",
|
|
852
|
+
text: capturing
|
|
853
|
+
});
|
|
854
|
+
const owner = formatOwner(input.owner, t);
|
|
855
|
+
if (owner !== null) segments.push({
|
|
856
|
+
key: "owner",
|
|
857
|
+
text: owner
|
|
858
|
+
});
|
|
859
|
+
return segments;
|
|
860
|
+
}
|
|
861
|
+
/** 分段拼成一行(两处渲染共用,保证浮窗与 Tab 逐字一致)。 */
|
|
862
|
+
function joinMeta(segments) {
|
|
863
|
+
return segments.map((segment) => segment.text).filter((text) => text !== "").join(" · ");
|
|
864
|
+
}
|
|
865
|
+
/** tab 条尾部的 `N 页`。0 页时不显示(空态已经有自己的文案)。 */
|
|
866
|
+
function formatPageCount(count, t) {
|
|
867
|
+
const n = Math.floor(Number(count));
|
|
868
|
+
if (!Number.isFinite(n) || n <= 0) return null;
|
|
869
|
+
return t("pagesCount", { n });
|
|
870
|
+
}
|
|
871
|
+
/** `lastActive` 归一化到秒:spaces 每 ~500ms 一推,毫秒尾数只会让渲染白白比出差异。 */
|
|
872
|
+
function truncateLastActive(rows) {
|
|
873
|
+
for (const row of rows) {
|
|
874
|
+
const value = Number(row?.lastActive);
|
|
875
|
+
row.lastActive = Number.isFinite(value) && value > 0 ? Math.floor(value / 1e3) * 1e3 : 0;
|
|
876
|
+
}
|
|
877
|
+
return rows;
|
|
878
|
+
}
|
|
879
|
+
function createSpacesCoalescer(flush, delayMs = 300) {
|
|
880
|
+
let timer = null;
|
|
881
|
+
let pending = null;
|
|
882
|
+
const stop = () => {
|
|
883
|
+
if (timer !== null) clearTimeout(timer);
|
|
884
|
+
timer = null;
|
|
885
|
+
};
|
|
886
|
+
return {
|
|
887
|
+
push(rows) {
|
|
888
|
+
pending = rows;
|
|
889
|
+
stop();
|
|
890
|
+
timer = setTimeout(() => {
|
|
891
|
+
timer = null;
|
|
892
|
+
const next = pending;
|
|
893
|
+
pending = null;
|
|
894
|
+
if (next !== null) flush(next);
|
|
895
|
+
}, delayMs);
|
|
896
|
+
},
|
|
897
|
+
cancel() {
|
|
898
|
+
stop();
|
|
899
|
+
pending = null;
|
|
900
|
+
}
|
|
901
|
+
};
|
|
902
|
+
}
|
|
330
903
|
|
|
331
904
|
//#endregion
|
|
332
905
|
//#region src/client/index.ts
|
|
@@ -422,6 +995,9 @@ var watchEn = {
|
|
|
422
995
|
noScreenshot: "(no screenshot — about:blank or browser not rendering)",
|
|
423
996
|
engineUnsupportedBanner: "(live view unsupported on this engine — Lightpanda renders text; use bcdp_snapshot / bcdp_screenshot instead)",
|
|
424
997
|
engineUnsupportedPick: "picking is unsupported on this engine (no Overlay / no live view) — use bcdp_snapshot to locate elements",
|
|
998
|
+
streamMseUnsupported: "This browser can't play this H.264 stream (MSE unsupported)",
|
|
999
|
+
streamDisconnected: "Video stream disconnected",
|
|
1000
|
+
streamConnectFailed: "Video stream connect failed",
|
|
425
1001
|
noActivePages: "No active browser pages",
|
|
426
1002
|
noActiveHint: "Pages will appear here as the agent browses with bcdp_*",
|
|
427
1003
|
openExternal: "Open real page",
|
|
@@ -433,9 +1009,11 @@ var watchEn = {
|
|
|
433
1009
|
picked: "Element captured",
|
|
434
1010
|
pickFailed: "Pick failed",
|
|
435
1011
|
pickQuoted: "✓ Quoted to composer",
|
|
1012
|
+
pickBarQuote: "Quote to chat Ctrl+J",
|
|
436
1013
|
pickDeliverFailed: "Delivery failed",
|
|
437
1014
|
noUrl: "No URL to open",
|
|
438
1015
|
closeTab: "Close tab",
|
|
1016
|
+
closeFailed: "Close failed: ",
|
|
439
1017
|
newTab: "(new tab)",
|
|
440
1018
|
history: "Browsing history",
|
|
441
1019
|
historyHide: "Hide history",
|
|
@@ -466,6 +1044,7 @@ var watchEn = {
|
|
|
466
1044
|
loginSelfPersist: "This browser keeps the login in its own profile — nothing to save here.",
|
|
467
1045
|
captchaDismiss: "Dismiss",
|
|
468
1046
|
hintReset: "Reset · scroll to pan · Ctrl+scroll to zoom · double-click to reset",
|
|
1047
|
+
liveImgHint: "Wheel zooms · hold-drag pans · zoom all the way out or double-click to reset",
|
|
469
1048
|
hintPan: "Ctrl+scroll to zoom · Ctrl+drag to pan · double-click to reset",
|
|
470
1049
|
hintScroll: "Ctrl+drag to pan · scroll to pan",
|
|
471
1050
|
hintNotCaptured: "Not captured · operation not delivered · click again to recover",
|
|
@@ -484,6 +1063,7 @@ var watchEn = {
|
|
|
484
1063
|
linksEmpty: "No targets yet — add the first one with the form below",
|
|
485
1064
|
linksEnabled: "Enabled",
|
|
486
1065
|
linksActive: "active",
|
|
1066
|
+
badgeLpHeadless: "LP·headless",
|
|
487
1067
|
linksAddCdp: "Add CDP endpoint",
|
|
488
1068
|
linksAddCli: "Add local ego CLI",
|
|
489
1069
|
linksAddLp: "Add Lightpanda (managed)",
|
|
@@ -543,139 +1123,158 @@ var watchEn = {
|
|
|
543
1123
|
sizeApiOutdated: "Size API not ready — restart DSH to load the new host build",
|
|
544
1124
|
actionFailed: "Action failed"
|
|
545
1125
|
};
|
|
1126
|
+
var watchZh = {
|
|
1127
|
+
title: "CDP 浏览器",
|
|
1128
|
+
titleLive: "CDP 浏览器 · 实时",
|
|
1129
|
+
liveView: "只读观察窗",
|
|
1130
|
+
pinned: "已固定查看",
|
|
1131
|
+
realtime: "正在实时浏览",
|
|
1132
|
+
noScreenshot: "(暂无截图 — about:blank 或浏览器未渲染)",
|
|
1133
|
+
engineUnsupportedBanner: "(当前引擎不支持实时画面 — Lightpanda 为文本渲染,可用 bcdp_snapshot / bcdp_screenshot 查看)",
|
|
1134
|
+
engineUnsupportedPick: "当前引擎不支持面板点选(无 Overlay/无实时画面)— 请用 bcdp_snapshot 定位元素",
|
|
1135
|
+
streamMseUnsupported: "当前浏览器不支持此 H.264 流",
|
|
1136
|
+
streamDisconnected: "视频流已断开",
|
|
1137
|
+
streamConnectFailed: "视频流连接失败",
|
|
1138
|
+
noActivePages: "暂无活跃浏览器页",
|
|
1139
|
+
noActiveHint: "当 agent 开始用 bcdp_* 操作网页时,这里会实时显示",
|
|
1140
|
+
openExternal: "⧉ 打开真实页",
|
|
1141
|
+
raiseWindow: "弹出窗口",
|
|
1142
|
+
raiseWindowHint: "把 agent 浏览器弹出为真实窗口(无头实例会被同 Profile 的有头实例替换,标签页保留)",
|
|
1143
|
+
pickMode: "选择元素",
|
|
1144
|
+
pickModeHint: "在实时页面里点选一个元素,引用到对话",
|
|
1145
|
+
picking: "点选中…请点击页面里的元素",
|
|
1146
|
+
picked: "已捕获元素",
|
|
1147
|
+
pickFailed: "点选失败",
|
|
1148
|
+
pickQuoted: "✓ 已引用到输入框",
|
|
1149
|
+
pickBarQuote: "引用到对话 Ctrl+J",
|
|
1150
|
+
pickDeliverFailed: "投递失败",
|
|
1151
|
+
noUrl: "无可打开的地址",
|
|
1152
|
+
closeTab: "关闭标签",
|
|
1153
|
+
closeFailed: "关闭失败:",
|
|
1154
|
+
newTab: "(新标签页)",
|
|
1155
|
+
history: "历史浏览轨迹",
|
|
1156
|
+
historyHide: "收起历史轨迹",
|
|
1157
|
+
historyShow: "历史浏览轨迹",
|
|
1158
|
+
noHistory: "暂无浏览记录",
|
|
1159
|
+
current: "当前",
|
|
1160
|
+
atQuote: "将整页引用为锚点报告(@)",
|
|
1161
|
+
atQuoted: "✓ 整页锚点报告已引用",
|
|
1162
|
+
atQuoteFailed: "锚点报告失败",
|
|
1163
|
+
refresh: "刷新",
|
|
1164
|
+
backToLive: "← 返回实时",
|
|
1165
|
+
dragHint: "拖动移动面板",
|
|
1166
|
+
loginTitle: "需要账号登录时,请到桌面上那个 {where} 完成登录。",
|
|
1167
|
+
loginBtn: "已登录,保存",
|
|
1168
|
+
loginSaving: "保存中…",
|
|
1169
|
+
loginSaved: "已保存 {n} 条会话",
|
|
1170
|
+
loginNotConnected: "未连接浏览器",
|
|
1171
|
+
loginFailed: "保存失败",
|
|
1172
|
+
loginDismiss: "关闭提示",
|
|
1173
|
+
captchaTitle: "⚠️ 检测到人机验证",
|
|
1174
|
+
captchaHint: "请在桌面那个 {where} 手动完成验证,agent 会继续。",
|
|
1175
|
+
whereCdp: "「{label}」浏览器窗口",
|
|
1176
|
+
whereEgo: "ego 浏览器窗口",
|
|
1177
|
+
whereTabbit: "Tabbit 浏览器窗口",
|
|
1178
|
+
whereLocal: "本机 Chrome 窗口(受管启动)",
|
|
1179
|
+
whereGeneric: "agent 浏览器窗口",
|
|
1180
|
+
loginHeadless: "当前激活的是 Lightpanda(无头引擎),没有可登录/验证的窗口;请切换到有头目标(CDP 端点 / 本机 Chrome / ego CLI / Tabbit)。",
|
|
1181
|
+
loginSelfPersist: "登录态保存在该浏览器自己的 profile 里,无需手动落盘。",
|
|
1182
|
+
captchaDismiss: "关闭提示",
|
|
1183
|
+
hintReset: "已复位 · 滚轮滚动页面 · Ctrl+滚轮缩放 · 双击复位",
|
|
1184
|
+
liveImgHint: "滚轮缩放 · 按住拖动平移 · 缩小到最小或双击复位",
|
|
1185
|
+
hintPan: "Ctrl+滚轮缩放 · Ctrl+拖动平移 · 双击复位",
|
|
1186
|
+
hintScroll: "Ctrl+拖动平移 · 滚轮滚动页面",
|
|
1187
|
+
hintNotCaptured: "画面未接管 · 本次操作未送达 · 再点一次即可恢复",
|
|
1188
|
+
failed: "失败",
|
|
1189
|
+
stale: "⚠ 未接管",
|
|
1190
|
+
captured: "已接管",
|
|
1191
|
+
fabTitle: "CDP 浏览器实时视图",
|
|
1192
|
+
settingsTitle: "展开设置",
|
|
1193
|
+
settingsHide: "收起设置",
|
|
1194
|
+
famTitle: "CDP 浏览器",
|
|
1195
|
+
famIsolate: "空间隔离",
|
|
1196
|
+
famIsolateDesc: "关 = 持久化配置(重启保留登录态);开 = 每次隔离沙箱",
|
|
1197
|
+
famIdle: "空闲自动停止(分钟,0 = 不停)",
|
|
1198
|
+
famIdleDesc: "超过 N 分钟没有 bcdp_* 调用即停止后台浏览器,下次调用按需重启",
|
|
1199
|
+
linksTitle: "连接目标(顺序即优先级)",
|
|
1200
|
+
linksEmpty: "暂无目标——用下方表单添加第一个连接目标",
|
|
1201
|
+
linksEnabled: "启用",
|
|
1202
|
+
linksActive: "已激活",
|
|
1203
|
+
badgeLpHeadless: "LP·无头",
|
|
1204
|
+
linksAddCdp: "添加 CDP 端点",
|
|
1205
|
+
linksAddCli: "添加本机 ego CLI",
|
|
1206
|
+
linksAddLp: "添加 Lightpanda(受管)",
|
|
1207
|
+
linksAddLpExists: "Lightpanda 连接已存在——仅限本机,一台机器只允许一条",
|
|
1208
|
+
linksAddTabbit: "添加 Tabbit CLI",
|
|
1209
|
+
linksAddTabbitExists: "Tabbit 连接已存在——仅限本机,一台机器只允许一条",
|
|
1210
|
+
linksTabbitPathHint: "留空 = 自动检测 (%LOCALAPPDATA%\\Tabbit\\LocalAgent\\bin)",
|
|
1211
|
+
linksLpPathHint: "留空 = 自动检测(PATH → ~/.local/bin;Windows 经 WSL2)",
|
|
1212
|
+
linksLpHeadlessHint: "无头快速试验引擎:无法人工兜底(登录/验证码)。排前面 = 快速场景优先用它;排在有头类型(CDP/本机 Chrome/ego CLI)后 = 兜底优先。",
|
|
1213
|
+
linksLpRemoteWarn: "cdpMode=remote 时激活 Lightpanda 行会报 mode-kind-mismatch",
|
|
1214
|
+
linksAddCliExists: "本机 ego CLI 连接已存在——仅限本机,一台机器只允许一条",
|
|
1215
|
+
linksEndpoint: "端点",
|
|
1216
|
+
linksEndpointHint: "http(s)://主机:端口 或 ws(s)://…",
|
|
1217
|
+
linksEndpointInvalid: "端点无效,未保存",
|
|
1218
|
+
linksCliPath: "ego CLI 路径",
|
|
1219
|
+
linksCliPathHint: "留空 = 自动检测(PATH → 应用包 → 内置运行时)",
|
|
1220
|
+
linksLabel: "标签",
|
|
1221
|
+
linksRemove: "删除",
|
|
1222
|
+
linksMoveUp: "上移",
|
|
1223
|
+
linksMoveDown: "下移",
|
|
1224
|
+
linksProbe: "探测",
|
|
1225
|
+
linksProbing: "探测中…",
|
|
1226
|
+
linksProbeOk: "可达",
|
|
1227
|
+
linksProbeFail: "不可达",
|
|
1228
|
+
linksLimitReached: "连接序列最多 {n} 条",
|
|
1229
|
+
linksWriteFailed: "保存失败——设置层拒绝了这次写入",
|
|
1230
|
+
linksCliRemoteWarn: "cdpMode=remote 时激活 ego CLI 会报 mode-kind-mismatch",
|
|
1231
|
+
linksCliSdk: "使用内置 harness",
|
|
1232
|
+
linksDisabledHint: "已停用——先勾选启用才能激活",
|
|
1233
|
+
linksActivate: "激活",
|
|
1234
|
+
linksLocalRow: "本机 Chrome(受管启动)",
|
|
1235
|
+
linksLocalEnableHint: "勾选 = 允许 auto 模式在激活目标不可达时回落本机启动",
|
|
1236
|
+
pickCardTitle: "浏览器点选内容",
|
|
1237
|
+
pickCardElements: "已选 {n} 个元素",
|
|
1238
|
+
pickCardRemove: "移除这段点选",
|
|
1239
|
+
pickCardSnapshotTag: "(点击时快照)",
|
|
1240
|
+
pickCardRecapture: "重抓快照",
|
|
1241
|
+
pickCardRecaptureHint: "重新读取这个 tab 并覆盖引用的报告(@ token 不变)",
|
|
1242
|
+
pickCardLive: "实时",
|
|
1243
|
+
trackAllOn: "全模式 · 全部 tab",
|
|
1244
|
+
trackAllOff: "仅激活 tab",
|
|
1245
|
+
trackAllHintOn: "全模式:space 内每个 tab 都单独出图,外框标出当前激活的那个;再点一下回到仅激活。",
|
|
1246
|
+
trackAllHintOff: "仅激活:只出激活 tab 的图;点一下切到全模式(所有 tab 都跟踪)。",
|
|
1247
|
+
pageRefresh: "刷新页面",
|
|
1248
|
+
pageRefreshHint: "重新加载 agent 当前页面(Page.reload)",
|
|
1249
|
+
openUrl: "打开网址",
|
|
1250
|
+
openUrlHint: "让 agent 页面跳转到指定网址",
|
|
1251
|
+
openUrlPrompt: "要在 agent 浏览器里打开的网址",
|
|
1252
|
+
sizeSyncOff: "🔒 锁定尺寸",
|
|
1253
|
+
sizeSyncOn: "🔓 尺寸同步",
|
|
1254
|
+
sizeSyncHint: "解锁后拖动面板会直接改变 agent 浏览器真实窗口大小;再点一下锁定。",
|
|
1255
|
+
sizePresets: "尺寸预设",
|
|
1256
|
+
sizePresetsHint: "按固定比例设置 agent 浏览器窗口",
|
|
1257
|
+
maximizeWindow: "最大化",
|
|
1258
|
+
maximizeHint: "最大化真实 agent 浏览器窗口",
|
|
1259
|
+
resizeHint: "拖动调整 agent 浏览器窗口大小",
|
|
1260
|
+
sizeApiOutdated: "尺寸接口未就绪:请重启 DSH 以加载最新 host 构建",
|
|
1261
|
+
actionFailed: "操作失败"
|
|
1262
|
+
};
|
|
546
1263
|
var watchDict = {
|
|
547
1264
|
en: watchEn,
|
|
548
|
-
zh:
|
|
549
|
-
title: "CDP 浏览器",
|
|
550
|
-
titleLive: "CDP 浏览器 · 实时",
|
|
551
|
-
liveView: "只读观察窗",
|
|
552
|
-
pinned: "已固定查看",
|
|
553
|
-
realtime: "正在实时浏览",
|
|
554
|
-
noScreenshot: "(暂无截图 — about:blank 或浏览器未渲染)",
|
|
555
|
-
engineUnsupportedBanner: "(当前引擎不支持实时画面 — Lightpanda 为文本渲染,可用 bcdp_snapshot / bcdp_screenshot 查看)",
|
|
556
|
-
engineUnsupportedPick: "当前引擎不支持面板点选(无 Overlay/无实时画面)— 请用 bcdp_snapshot 定位元素",
|
|
557
|
-
noActivePages: "暂无活跃浏览器页",
|
|
558
|
-
noActiveHint: "当 agent 开始用 bcdp_* 操作网页时,这里会实时显示",
|
|
559
|
-
openExternal: "⧉ 打开真实页",
|
|
560
|
-
raiseWindow: "弹出窗口",
|
|
561
|
-
raiseWindowHint: "把 agent 浏览器弹出为真实窗口(无头实例会被同 Profile 的有头实例替换,标签页保留)",
|
|
562
|
-
pickMode: "选择元素",
|
|
563
|
-
pickModeHint: "在实时页面里点选一个元素,引用到对话",
|
|
564
|
-
picking: "点选中…请点击页面里的元素",
|
|
565
|
-
picked: "已捕获元素",
|
|
566
|
-
pickFailed: "点选失败",
|
|
567
|
-
pickQuoted: "✓ 已引用到输入框",
|
|
568
|
-
pickDeliverFailed: "投递失败",
|
|
569
|
-
noUrl: "无可打开的地址",
|
|
570
|
-
closeTab: "关闭标签",
|
|
571
|
-
newTab: "(新标签页)",
|
|
572
|
-
history: "历史浏览轨迹",
|
|
573
|
-
historyHide: "收起历史轨迹",
|
|
574
|
-
historyShow: "历史浏览轨迹",
|
|
575
|
-
noHistory: "暂无浏览记录",
|
|
576
|
-
current: "当前",
|
|
577
|
-
atQuote: "将整页引用为锚点报告(@)",
|
|
578
|
-
atQuoted: "✓ 整页锚点报告已引用",
|
|
579
|
-
atQuoteFailed: "锚点报告失败",
|
|
580
|
-
refresh: "刷新",
|
|
581
|
-
backToLive: "← 返回实时",
|
|
582
|
-
dragHint: "拖动移动面板",
|
|
583
|
-
loginTitle: "需要账号登录时,请到桌面上那个 {where} 完成登录。",
|
|
584
|
-
loginBtn: "已登录,保存",
|
|
585
|
-
loginSaving: "保存中…",
|
|
586
|
-
loginSaved: "已保存 {n} 条会话",
|
|
587
|
-
loginNotConnected: "未连接浏览器",
|
|
588
|
-
loginFailed: "保存失败",
|
|
589
|
-
loginDismiss: "关闭提示",
|
|
590
|
-
captchaTitle: "⚠️ 检测到人机验证",
|
|
591
|
-
captchaHint: "请在桌面那个 {where} 手动完成验证,agent 会继续。",
|
|
592
|
-
whereCdp: "「{label}」浏览器窗口",
|
|
593
|
-
whereEgo: "ego 浏览器窗口",
|
|
594
|
-
whereTabbit: "Tabbit 浏览器窗口",
|
|
595
|
-
whereLocal: "本机 Chrome 窗口(受管启动)",
|
|
596
|
-
whereGeneric: "agent 浏览器窗口",
|
|
597
|
-
loginHeadless: "当前激活的是 Lightpanda(无头引擎),没有可登录/验证的窗口;请切换到有头目标(CDP 端点 / 本机 Chrome / ego CLI / Tabbit)。",
|
|
598
|
-
loginSelfPersist: "登录态保存在该浏览器自己的 profile 里,无需手动落盘。",
|
|
599
|
-
captchaDismiss: "关闭提示",
|
|
600
|
-
hintReset: "已复位 · 滚轮滚动页面 · Ctrl+滚轮缩放 · 双击复位",
|
|
601
|
-
hintPan: "Ctrl+滚轮缩放 · Ctrl+拖动平移 · 双击复位",
|
|
602
|
-
hintScroll: "Ctrl+拖动平移 · 滚轮滚动页面",
|
|
603
|
-
hintNotCaptured: "画面未接管 · 本次操作未送达 · 再点一次即可恢复",
|
|
604
|
-
failed: "失败",
|
|
605
|
-
stale: "⚠ 未接管",
|
|
606
|
-
captured: "已接管",
|
|
607
|
-
fabTitle: "CDP 浏览器实时视图",
|
|
608
|
-
settingsTitle: "展开设置",
|
|
609
|
-
settingsHide: "收起设置",
|
|
610
|
-
famTitle: "CDP 浏览器",
|
|
611
|
-
famIsolate: "空间隔离",
|
|
612
|
-
famIsolateDesc: "关 = 持久化配置(重启保留登录态);开 = 每次隔离沙箱",
|
|
613
|
-
famIdle: "空闲自动停止(分钟,0 = 不停)",
|
|
614
|
-
famIdleDesc: "超过 N 分钟没有 bcdp_* 调用即停止后台浏览器,下次调用按需重启",
|
|
615
|
-
linksTitle: "连接目标(顺序即优先级)",
|
|
616
|
-
linksEmpty: "暂无目标——用下方表单添加第一个连接目标",
|
|
617
|
-
linksEnabled: "启用",
|
|
618
|
-
linksActive: "已激活",
|
|
619
|
-
linksAddCdp: "添加 CDP 端点",
|
|
620
|
-
linksAddCli: "添加本机 ego CLI",
|
|
621
|
-
linksAddLp: "添加 Lightpanda(受管)",
|
|
622
|
-
linksAddLpExists: "Lightpanda 连接已存在——仅限本机,一台机器只允许一条",
|
|
623
|
-
linksAddTabbit: "添加 Tabbit CLI",
|
|
624
|
-
linksAddTabbitExists: "Tabbit 连接已存在——仅限本机,一台机器只允许一条",
|
|
625
|
-
linksTabbitPathHint: "留空 = 自动检测 (%LOCALAPPDATA%\\Tabbit\\LocalAgent\\bin)",
|
|
626
|
-
linksLpPathHint: "留空 = 自动检测(PATH → ~/.local/bin;Windows 经 WSL2)",
|
|
627
|
-
linksLpHeadlessHint: "无头快速试验引擎:无法人工兜底(登录/验证码)。排前面 = 快速场景优先用它;排在有头类型(CDP/本机 Chrome/ego CLI)后 = 兜底优先。",
|
|
628
|
-
linksLpRemoteWarn: "cdpMode=remote 时激活 Lightpanda 行会报 mode-kind-mismatch",
|
|
629
|
-
linksAddCliExists: "本机 ego CLI 连接已存在——仅限本机,一台机器只允许一条",
|
|
630
|
-
linksEndpoint: "端点",
|
|
631
|
-
linksEndpointHint: "http(s)://主机:端口 或 ws(s)://…",
|
|
632
|
-
linksEndpointInvalid: "端点无效,未保存",
|
|
633
|
-
linksCliPath: "ego CLI 路径",
|
|
634
|
-
linksCliPathHint: "留空 = 自动检测(PATH → 应用包 → 内置运行时)",
|
|
635
|
-
linksLabel: "标签",
|
|
636
|
-
linksRemove: "删除",
|
|
637
|
-
linksMoveUp: "上移",
|
|
638
|
-
linksMoveDown: "下移",
|
|
639
|
-
linksProbe: "探测",
|
|
640
|
-
linksProbing: "探测中…",
|
|
641
|
-
linksProbeOk: "可达",
|
|
642
|
-
linksProbeFail: "不可达",
|
|
643
|
-
linksLimitReached: "连接序列最多 {n} 条",
|
|
644
|
-
linksWriteFailed: "保存失败——设置层拒绝了这次写入",
|
|
645
|
-
linksCliRemoteWarn: "cdpMode=remote 时激活 ego CLI 会报 mode-kind-mismatch",
|
|
646
|
-
linksCliSdk: "使用内置 harness",
|
|
647
|
-
linksDisabledHint: "已停用——先勾选启用才能激活",
|
|
648
|
-
linksActivate: "激活",
|
|
649
|
-
linksLocalRow: "本机 Chrome(受管启动)",
|
|
650
|
-
linksLocalEnableHint: "勾选 = 允许 auto 模式在激活目标不可达时回落本机启动",
|
|
651
|
-
pickCardTitle: "浏览器点选内容",
|
|
652
|
-
pickCardElements: "已选 {n} 个元素",
|
|
653
|
-
pickCardRemove: "移除这段点选",
|
|
654
|
-
pickCardSnapshotTag: "(点击时快照)",
|
|
655
|
-
pickCardRecapture: "重抓快照",
|
|
656
|
-
pickCardRecaptureHint: "重新读取这个 tab 并覆盖引用的报告(@ token 不变)",
|
|
657
|
-
pickCardLive: "实时",
|
|
658
|
-
trackAllOn: "全模式 · 全部 tab",
|
|
659
|
-
trackAllOff: "仅激活 tab",
|
|
660
|
-
trackAllHintOn: "全模式:space 内每个 tab 都单独出图,外框标出当前激活的那个;再点一下回到仅激活。",
|
|
661
|
-
trackAllHintOff: "仅激活:只出激活 tab 的图;点一下切到全模式(所有 tab 都跟踪)。",
|
|
662
|
-
pageRefresh: "刷新页面",
|
|
663
|
-
pageRefreshHint: "重新加载 agent 当前页面(Page.reload)",
|
|
664
|
-
openUrl: "打开网址",
|
|
665
|
-
openUrlHint: "让 agent 页面跳转到指定网址",
|
|
666
|
-
openUrlPrompt: "要在 agent 浏览器里打开的网址",
|
|
667
|
-
sizeSyncOff: "🔒 锁定尺寸",
|
|
668
|
-
sizeSyncOn: "🔓 尺寸同步",
|
|
669
|
-
sizeSyncHint: "解锁后拖动面板会直接改变 agent 浏览器真实窗口大小;再点一下锁定。",
|
|
670
|
-
sizePresets: "尺寸预设",
|
|
671
|
-
sizePresetsHint: "按固定比例设置 agent 浏览器窗口",
|
|
672
|
-
maximizeWindow: "最大化",
|
|
673
|
-
maximizeHint: "最大化真实 agent 浏览器窗口",
|
|
674
|
-
resizeHint: "拖动调整 agent 浏览器窗口大小",
|
|
675
|
-
sizeApiOutdated: "尺寸接口未就绪:请重启 DSH 以加载最新 host 构建",
|
|
676
|
-
actionFailed: "操作失败"
|
|
677
|
-
}
|
|
1265
|
+
zh: watchZh
|
|
678
1266
|
};
|
|
1267
|
+
Object.assign(watchEn, SPACE_META_EN);
|
|
1268
|
+
Object.assign(watchZh, SPACE_META_ZH);
|
|
1269
|
+
/**
|
|
1270
|
+
* 动作药丸取词:host 送来的 {zh,en} 对,按当前界面语言挑一个。
|
|
1271
|
+
* 不塞进 watchEn/watchZh 是因为这些词**由 host 侧单一真源产生**
|
|
1272
|
+
* (`TOOL_ACTION_LABELS`),客户端只做选择,不做第二份表。
|
|
1273
|
+
*/
|
|
1274
|
+
function pickActionLabel(label) {
|
|
1275
|
+
if (!label || typeof label !== "object") return "";
|
|
1276
|
+
return _egoLocale === "zh" ? label.zh || label.en || "" : label.en || label.zh || "";
|
|
1277
|
+
}
|
|
679
1278
|
function wt(key, params = void 0) {
|
|
680
1279
|
var text = (watchDict[_egoLocale] || watchEn)[key] || watchEn[key] || key;
|
|
681
1280
|
if (params) for (var k in params) text = text.replace(new RegExp("{" + k + "}", "g"), String(params[k]));
|
|
@@ -934,7 +1533,7 @@ function createKeyboardProxy(send) {
|
|
|
934
1533
|
}
|
|
935
1534
|
function createMsePlayer(video, generation, mime, onFailure) {
|
|
936
1535
|
if (!window.MediaSource || !window.MediaSource.isTypeSupported(mime)) {
|
|
937
|
-
onFailure("
|
|
1536
|
+
onFailure(wt("streamMseUnsupported"));
|
|
938
1537
|
return function() {};
|
|
939
1538
|
}
|
|
940
1539
|
var mediaSource = new MediaSource();
|
|
@@ -963,7 +1562,7 @@ function createMsePlayer(video, generation, mime, onFailure) {
|
|
|
963
1562
|
reading = false;
|
|
964
1563
|
if (disposed) return;
|
|
965
1564
|
if (part.done) {
|
|
966
|
-
onFailure("
|
|
1565
|
+
onFailure(wt("streamDisconnected"));
|
|
967
1566
|
return;
|
|
968
1567
|
}
|
|
969
1568
|
queue.push(part.value);
|
|
@@ -996,7 +1595,7 @@ function createMsePlayer(video, generation, mime, onFailure) {
|
|
|
996
1595
|
pump();
|
|
997
1596
|
});
|
|
998
1597
|
fetch(VIDEO_ROUTE + "?generation=" + encodeURIComponent(generation), { signal: abort.signal }).then(function(res) {
|
|
999
|
-
if (!res.ok || !res.body) throw new Error("
|
|
1598
|
+
if (!res.ok || !res.body) throw new Error(wt("streamConnectFailed") + " (" + res.status + ")");
|
|
1000
1599
|
reader = res.body.getReader();
|
|
1001
1600
|
pump();
|
|
1002
1601
|
}).catch(function(error) {
|
|
@@ -1180,6 +1779,11 @@ const PANEL_CSS = `
|
|
|
1180
1779
|
used to read as duplicated tabs; a W1/W2 badge explains them instead of hiding. */
|
|
1181
1780
|
.dsh-ego-tab .dsh-ego-tabwin { flex-shrink:0; font-size:9.5px; line-height:14px; padding:0 3px;
|
|
1182
1781
|
border-radius:4px; border:1px solid currentColor; opacity:.55; letter-spacing:.2px; }
|
|
1782
|
+
/* M4 — this tab is sitting on a human-verification screen. One glyph is all the
|
|
1783
|
+
room there is; the sentence lives in the title attribute. */
|
|
1784
|
+
.dsh-ego-tab .dsh-ego-tabwarn { flex-shrink:0; color:#ffcc00; font-size:11px; line-height:14px; }
|
|
1785
|
+
/* M8 — how many pages are open (tail of the strip). */
|
|
1786
|
+
.dsh-ego-tabcount { flex-shrink:0; align-self:center; font-size:10px; opacity:.55; padding-left:2px; }
|
|
1183
1787
|
/* Transient failure text inside the strip (close refused, capture failed). */
|
|
1184
1788
|
.dsh-ego-taberr { flex-shrink:0; font-size:10.5px; line-height:16px; padding:0 6px; border-radius:999px;
|
|
1185
1789
|
color:#ff453a; border:1px solid rgba(255,69,58,.45); background: rgba(255,69,58,.12); }
|
|
@@ -2013,10 +2617,21 @@ function FamilySettingsCard(props) {
|
|
|
2013
2617
|
var value = snapshot.value || {};
|
|
2014
2618
|
var writable = snapshot.writable === true;
|
|
2015
2619
|
var h = React.createElement;
|
|
2620
|
+
var guideState = React.useState(function() {
|
|
2621
|
+
return !isGuideSkipped("browser-cdp");
|
|
2622
|
+
});
|
|
2623
|
+
var guideOpen = guideState[0], setGuideOpen = guideState[1];
|
|
2016
2624
|
return h("div", { style: {
|
|
2017
2625
|
display: "grid",
|
|
2018
2626
|
gap: "8px"
|
|
2019
|
-
} }, h(
|
|
2627
|
+
} }, guideOpen ? h(GuidePanel, {
|
|
2628
|
+
key: "guide",
|
|
2629
|
+
ns: "browser-cdp",
|
|
2630
|
+
steps: guideSteps(BROWSER_CDP_GUIDE_STEPS),
|
|
2631
|
+
onClose: function() {
|
|
2632
|
+
setGuideOpen(false);
|
|
2633
|
+
}
|
|
2634
|
+
}) : null, h(FamLinks, {
|
|
2020
2635
|
key: "links",
|
|
2021
2636
|
first: true,
|
|
2022
2637
|
value,
|
|
@@ -2030,7 +2645,15 @@ function FamilySettingsCard(props) {
|
|
|
2030
2645
|
writable,
|
|
2031
2646
|
scope
|
|
2032
2647
|
});
|
|
2033
|
-
})
|
|
2648
|
+
}), h("div", {
|
|
2649
|
+
key: "guide-restart",
|
|
2650
|
+
style: { paddingTop: "2px" }
|
|
2651
|
+
}, h(GuideRestartButton, {
|
|
2652
|
+
ns: "browser-cdp",
|
|
2653
|
+
onOpen: function() {
|
|
2654
|
+
setGuideOpen(true);
|
|
2655
|
+
}
|
|
2656
|
+
})));
|
|
2034
2657
|
}
|
|
2035
2658
|
function FamGroup(props) {
|
|
2036
2659
|
var group = props.group;
|
|
@@ -2619,7 +3242,7 @@ function FamLinks(props) {
|
|
|
2619
3242
|
onToggle: function(next) {
|
|
2620
3243
|
writeLinks(updateRow(links, row.id, { enabled: next }));
|
|
2621
3244
|
}
|
|
2622
|
-
}), h("span", { style: badgeStyle }, isCli ? "CLI" : isLp ? "
|
|
3245
|
+
}), h("span", { style: badgeStyle }, isCli ? "CLI" : isLp ? wt("badgeLpHeadless") : isTabbit ? "TABBIT" : "CDP"), h(FamRowInput, {
|
|
2623
3246
|
v: row.label || "",
|
|
2624
3247
|
writable,
|
|
2625
3248
|
placeholder: wt("linksLabel"),
|
|
@@ -2887,7 +3510,7 @@ function mountFloatingWatch(ctx) {
|
|
|
2887
3510
|
panel.innerHTML = `
|
|
2888
3511
|
<div id="dsh-ego-head">
|
|
2889
3512
|
<span class="dsh-ego-grip" title="${wt("dragHint")}">${ICON_GRIP}</span>
|
|
2890
|
-
<span id="dsh-ego-title">${ICON_GLOBE}<span style="margin-left:6px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${wt("title")}</span><span id="dsh-ego-ver" style="margin-left:6px;font-size:10px;opacity:.5;flex-shrink:0;">v${CLIENT_BUILD}</span></span>
|
|
3513
|
+
<span id="dsh-ego-title">${ICON_GLOBE}<span style="margin-left:6px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${wt("title")}</span><span id="dsh-ego-ver" style="margin-left:6px;font-size:10px;opacity:.5;flex-shrink:0;">v${CLIENT_BUILD}</span><span id="dsh-ego-action" hidden style="margin-left:8px;flex-shrink:0;display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border-radius:999px;font-size:10.5px;background:rgba(77,107,254,.14);color:var(--dsw-alias-label-primary,#4d6bfe);border:1px solid rgba(77,107,254,.32);"></span></span>
|
|
2891
3514
|
<button id="dsh-ego-refresh" class="dsh-ego-iconbtn" title="${wt("refresh")}">${ICON_REFRESH}</button>
|
|
2892
3515
|
<button id="dsh-ego-historybtn" class="dsh-ego-iconbtn off" title="${wt("historyShow")}">${ICON_CLOCK}</button>
|
|
2893
3516
|
<button id="dsh-ego-close" class="dsh-ego-iconbtn" title="${wt("settingsHide")}">${ICON_CLOSE}</button>
|
|
@@ -3069,6 +3692,19 @@ function mountFloatingWatch(ctx) {
|
|
|
3069
3692
|
let pendingLiveFrame = null;
|
|
3070
3693
|
let liveFlushRaf = null;
|
|
3071
3694
|
const pageMeta = /* @__PURE__ */ new Map();
|
|
3695
|
+
const owners = /* @__PURE__ */ new Map();
|
|
3696
|
+
let metaEl = null;
|
|
3697
|
+
let metaRow = null;
|
|
3698
|
+
const ownerOf = (targetId) => owners.get(targetId) || null;
|
|
3699
|
+
const metaLineOf = (row) => row ? joinMeta(formatSpaceMeta({
|
|
3700
|
+
row,
|
|
3701
|
+
owner: ownerOf(row.targetId)
|
|
3702
|
+
}, Date.now(), wt)) : "";
|
|
3703
|
+
const paintMeta = () => {
|
|
3704
|
+
if (!metaEl) return;
|
|
3705
|
+
metaEl.textContent = metaLineOf(metaRow);
|
|
3706
|
+
metaEl.hidden = metaEl.textContent === "";
|
|
3707
|
+
};
|
|
3072
3708
|
const watchClientId = "floating-" + Math.random().toString(36).slice(2);
|
|
3073
3709
|
let watchStarted = false, watchTargetId = null, watchRenewTimer = null, watchStopTimer = null, watchRequest = null;
|
|
3074
3710
|
let watchUnsupported = false, watchRequestTarget = null, watchRequestPendingTarget = null, captureBackend = "cdp", streamGeneration = 0, streamState = "idle", streamMime = "video/mp4; codecs=\"avc1.42E01E\"", videoCleanup = null;
|
|
@@ -3253,7 +3889,7 @@ function mountFloatingWatch(ctx) {
|
|
|
3253
3889
|
img.autoplay = true;
|
|
3254
3890
|
img.playsInline = true;
|
|
3255
3891
|
}
|
|
3256
|
-
img.title = "
|
|
3892
|
+
img.title = wt("liveImgHint");
|
|
3257
3893
|
const realText = urlEl ? urlEl.textContent : "";
|
|
3258
3894
|
let hintTimer = null;
|
|
3259
3895
|
const clearHint = () => {
|
|
@@ -3469,6 +4105,13 @@ function mountFloatingWatch(ctx) {
|
|
|
3469
4105
|
txt.style.overflow = "hidden";
|
|
3470
4106
|
txt.style.textOverflow = "ellipsis";
|
|
3471
4107
|
tab.appendChild(dot);
|
|
4108
|
+
if (s.humanCheck && s.humanCheck.detected) {
|
|
4109
|
+
const warn = document.createElement("span");
|
|
4110
|
+
warn.className = "dsh-ego-tabwarn";
|
|
4111
|
+
warn.textContent = wt("captchaTabBadge");
|
|
4112
|
+
warn.title = wt("captchaTitle");
|
|
4113
|
+
tab.appendChild(warn);
|
|
4114
|
+
}
|
|
3472
4115
|
tab.appendChild(txt);
|
|
3473
4116
|
const closeBtn$1 = document.createElement("span");
|
|
3474
4117
|
closeBtn$1.className = "dsh-ego-tabclose";
|
|
@@ -3493,7 +4136,7 @@ function mountFloatingWatch(ctx) {
|
|
|
3493
4136
|
const reason = body$1 && typeof body$1.reason === "string" ? body$1.reason : "http-" + res.status;
|
|
3494
4137
|
const err = document.createElement("span");
|
|
3495
4138
|
err.className = "dsh-ego-taberr";
|
|
3496
|
-
err.textContent = "
|
|
4139
|
+
err.textContent = wt("closeFailed") + reason;
|
|
3497
4140
|
tabsEl.appendChild(err);
|
|
3498
4141
|
window.setTimeout(() => {
|
|
3499
4142
|
err.remove();
|
|
@@ -3527,6 +4170,13 @@ function mountFloatingWatch(ctx) {
|
|
|
3527
4170
|
});
|
|
3528
4171
|
tabsEl.appendChild(tab);
|
|
3529
4172
|
}
|
|
4173
|
+
const pageCount = formatPageCount(list.length, wt);
|
|
4174
|
+
if (pageCount !== null) {
|
|
4175
|
+
const tail = document.createElement("span");
|
|
4176
|
+
tail.className = "dsh-ego-tabcount";
|
|
4177
|
+
tail.textContent = pageCount;
|
|
4178
|
+
strip.appendChild(tail);
|
|
4179
|
+
}
|
|
3530
4180
|
};
|
|
3531
4181
|
const renderSingleView = (s) => {
|
|
3532
4182
|
body.innerHTML = "";
|
|
@@ -3582,7 +4232,9 @@ function mountFloatingWatch(ctx) {
|
|
|
3582
4232
|
};
|
|
3583
4233
|
const renderSpaces = (spaces) => {
|
|
3584
4234
|
if (disposed) return;
|
|
3585
|
-
const incoming = Array.isArray(spaces) ? spaces : [];
|
|
4235
|
+
const incoming = truncateLastActive(Array.isArray(spaces) ? spaces : []);
|
|
4236
|
+
const liveAll = new Set(incoming.map((s) => s && s.targetId));
|
|
4237
|
+
for (const id of [...owners.keys()]) if (!liveAll.has(id)) owners.delete(id);
|
|
3586
4238
|
lastList = trackAll ? incoming : incoming.filter((s) => s && s.active === true).slice(0, 1);
|
|
3587
4239
|
if (lastList.length === 0 && incoming.length > 0) lastList = incoming.slice(0, 1);
|
|
3588
4240
|
for (const s of lastList) {
|
|
@@ -3610,7 +4262,7 @@ function mountFloatingWatch(ctx) {
|
|
|
3610
4262
|
if (historyOpen) renderHistory(lastList);
|
|
3611
4263
|
if (pinned) return;
|
|
3612
4264
|
if (lastList.length === 0) {
|
|
3613
|
-
setTitle("
|
|
4265
|
+
setTitle(wt("title"));
|
|
3614
4266
|
body.innerHTML = `<div class="dsh-ego-empty">${wt("noActivePages")}<br><span style="font-size:11px;">${wt("noActiveHint")}</span></div>`;
|
|
3615
4267
|
fab.classList.remove("dsh-ego-live", "dsh-ego-busy");
|
|
3616
4268
|
return;
|
|
@@ -3793,6 +4445,14 @@ function mountFloatingWatch(ctx) {
|
|
|
3793
4445
|
}
|
|
3794
4446
|
view.appendChild(t);
|
|
3795
4447
|
view.appendChild(u);
|
|
4448
|
+
metaEl = document.createElement("div");
|
|
4449
|
+
metaEl.className = "dsh-ego-liveurl";
|
|
4450
|
+
metaEl.style.fontSize = "10.5px";
|
|
4451
|
+
metaEl.style.opacity = ".7";
|
|
4452
|
+
metaRow = current;
|
|
4453
|
+
metaEl.textContent = metaLineOf(current);
|
|
4454
|
+
metaEl.hidden = metaEl.textContent === "";
|
|
4455
|
+
view.appendChild(metaEl);
|
|
3796
4456
|
body.appendChild(view);
|
|
3797
4457
|
};
|
|
3798
4458
|
let lastSawActive = false;
|
|
@@ -3886,6 +4546,9 @@ function mountFloatingWatch(ctx) {
|
|
|
3886
4546
|
}
|
|
3887
4547
|
}
|
|
3888
4548
|
};
|
|
4549
|
+
const spacesCoalescer = createSpacesCoalescer((list) => {
|
|
4550
|
+
renderSpaces(list);
|
|
4551
|
+
}, 300);
|
|
3889
4552
|
let reconnectFallbackTimer = null;
|
|
3890
4553
|
const openStream = () => {
|
|
3891
4554
|
if (disposed) return;
|
|
@@ -3917,7 +4580,23 @@ function mountFloatingWatch(ctx) {
|
|
|
3917
4580
|
if (disposed) return;
|
|
3918
4581
|
try {
|
|
3919
4582
|
const list = JSON.parse(ev.data);
|
|
3920
|
-
if (Array.isArray(list))
|
|
4583
|
+
if (Array.isArray(list)) spacesCoalescer.push(list);
|
|
4584
|
+
} catch {}
|
|
4585
|
+
});
|
|
4586
|
+
sse.addEventListener("focus", (ev) => {
|
|
4587
|
+
if (disposed) return;
|
|
4588
|
+
try {
|
|
4589
|
+
const f = JSON.parse(ev.data);
|
|
4590
|
+
if (!f || typeof f.targetId !== "string") {
|
|
4591
|
+
owners.clear();
|
|
4592
|
+
paintMeta();
|
|
4593
|
+
return;
|
|
4594
|
+
}
|
|
4595
|
+
owners.set(f.targetId, {
|
|
4596
|
+
source: typeof f.source === "string" ? f.source : void 0,
|
|
4597
|
+
sessionId: typeof f.sessionId === "string" ? f.sessionId : void 0
|
|
4598
|
+
});
|
|
4599
|
+
paintMeta();
|
|
3921
4600
|
} catch {}
|
|
3922
4601
|
});
|
|
3923
4602
|
sse.addEventListener("capture-status", (ev) => {
|
|
@@ -3925,6 +4604,29 @@ function mountFloatingWatch(ctx) {
|
|
|
3925
4604
|
applyCaptureStatus(JSON.parse(ev.data));
|
|
3926
4605
|
} catch {}
|
|
3927
4606
|
});
|
|
4607
|
+
let actionTimer = null;
|
|
4608
|
+
sse.addEventListener("tool-call", (ev) => {
|
|
4609
|
+
if (disposed) return;
|
|
4610
|
+
try {
|
|
4611
|
+
const m = JSON.parse(ev.data);
|
|
4612
|
+
const label = m && m.label;
|
|
4613
|
+
if (!label) return;
|
|
4614
|
+
const el = panel.querySelector("#dsh-ego-action");
|
|
4615
|
+
if (!el) return;
|
|
4616
|
+
const text = pickActionLabel(label);
|
|
4617
|
+
if (text === "") return;
|
|
4618
|
+
el.textContent = "DSH · " + text;
|
|
4619
|
+
el.title = "DSH · " + text;
|
|
4620
|
+
el.hidden = false;
|
|
4621
|
+
if (actionTimer) clearTimeout(actionTimer);
|
|
4622
|
+
actionTimer = setTimeout(() => {
|
|
4623
|
+
actionTimer = null;
|
|
4624
|
+
try {
|
|
4625
|
+
el.hidden = true;
|
|
4626
|
+
} catch {}
|
|
4627
|
+
}, 4e3);
|
|
4628
|
+
} catch {}
|
|
4629
|
+
});
|
|
3928
4630
|
sse.onerror = () => {
|
|
3929
4631
|
doConnected = false;
|
|
3930
4632
|
if (reconnectFallbackTimer) return;
|
|
@@ -4180,6 +4882,7 @@ function mountFloatingWatch(ctx) {
|
|
|
4180
4882
|
document.addEventListener("visibilitychange", onVisibility);
|
|
4181
4883
|
return () => {
|
|
4182
4884
|
disposed = true;
|
|
4885
|
+
spacesCoalescer.cancel();
|
|
4183
4886
|
if (liveFlushRaf != null) try {
|
|
4184
4887
|
window.cancelAnimationFrame(liveFlushRaf);
|
|
4185
4888
|
} catch {}
|
|
@@ -4467,6 +5170,9 @@ var TAB_CSS = `
|
|
|
4467
5170
|
flex-shrink: 0; font-size: 9px; line-height: 12px; padding: 0 3px; border-radius: 4px;
|
|
4468
5171
|
border: 1px solid currentColor; opacity: .55; letter-spacing: .2px;
|
|
4469
5172
|
}
|
|
5173
|
+
/* M4 — human-verification glyph on the row; M8 — open-page count at the tail. */
|
|
5174
|
+
.dsh-ego-side-tab > .dsh-ego-side-tabwarn { flex-shrink: 0; color: #e0a520; font-size: 10px; }
|
|
5175
|
+
.dsh-ego-side-tabcount { flex-shrink: 0; align-self: center; font-size: 10px; opacity: .55; padding-left: 2px; }
|
|
4470
5176
|
.dsh-ego-side-tab:hover { opacity: 1; background: rgba(128,128,128,.2); }
|
|
4471
5177
|
.dsh-ego-side-tab.active {
|
|
4472
5178
|
background: #0a84ff; color: #fff; border-color: transparent; opacity: 1;
|
|
@@ -5204,7 +5910,13 @@ function createPickControl(onState, deliver) {
|
|
|
5204
5910
|
}
|
|
5205
5911
|
}
|
|
5206
5912
|
function post(enabledNow, targetId) {
|
|
5207
|
-
var body = {
|
|
5913
|
+
var body = {
|
|
5914
|
+
enabled: enabledNow,
|
|
5915
|
+
labels: {
|
|
5916
|
+
quote: wt("pickBarQuote"),
|
|
5917
|
+
quoted: wt("pickQuoted")
|
|
5918
|
+
}
|
|
5919
|
+
};
|
|
5208
5920
|
if (targetId) body.targetId = targetId;
|
|
5209
5921
|
return fetchBcdp("/api/bcdp/pick", {
|
|
5210
5922
|
method: "POST",
|
|
@@ -5330,6 +6042,8 @@ function LivePreviewController(ctx, sessionId) {
|
|
|
5330
6042
|
this.store = ensureSnapshotStoreCreator()(this._initialState());
|
|
5331
6043
|
this.frameCache = /* @__PURE__ */ new Map();
|
|
5332
6044
|
this.pageMeta = /* @__PURE__ */ new Map();
|
|
6045
|
+
this.owners = /* @__PURE__ */ new Map();
|
|
6046
|
+
this.spacesCoalescer = null;
|
|
5333
6047
|
this.lastList = [];
|
|
5334
6048
|
this.pinned = null;
|
|
5335
6049
|
this.currentActiveId = null;
|
|
@@ -5388,6 +6102,8 @@ function LivePreviewController(ctx, sessionId) {
|
|
|
5388
6102
|
this._pick = "off";
|
|
5389
6103
|
this._pickMessage = "";
|
|
5390
6104
|
this._pickTargetId = null;
|
|
6105
|
+
this._actionLabel = null;
|
|
6106
|
+
this._actionTimer = null;
|
|
5391
6107
|
this.pickControl = createPickControl(function(pick, message) {
|
|
5392
6108
|
self._setPickState(pick, message);
|
|
5393
6109
|
}, function(el, a) {
|
|
@@ -5411,6 +6127,7 @@ LivePreviewController.prototype._initialState = function() {
|
|
|
5411
6127
|
historyOpen: false,
|
|
5412
6128
|
zoomHint: null,
|
|
5413
6129
|
wiringStale: false,
|
|
6130
|
+
spaceMeta: "",
|
|
5414
6131
|
backend: "cdp",
|
|
5415
6132
|
streamState: "idle",
|
|
5416
6133
|
streamMessage: "",
|
|
@@ -5418,7 +6135,8 @@ LivePreviewController.prototype._initialState = function() {
|
|
|
5418
6135
|
streamMime: "video/mp4; codecs=\"avc1.42E01E\"",
|
|
5419
6136
|
engineUnsupported: false,
|
|
5420
6137
|
pick: "off",
|
|
5421
|
-
pickMessage: ""
|
|
6138
|
+
pickMessage: "",
|
|
6139
|
+
actionLabel: null
|
|
5422
6140
|
};
|
|
5423
6141
|
};
|
|
5424
6142
|
LivePreviewController.prototype.subscribe = function(cb) {
|
|
@@ -5477,6 +6195,10 @@ LivePreviewController.prototype._recompute = function() {
|
|
|
5477
6195
|
}
|
|
5478
6196
|
}
|
|
5479
6197
|
this.currentActiveId = currentTargetId;
|
|
6198
|
+
var metaLine = currentSpace ? joinMeta(formatSpaceMeta({
|
|
6199
|
+
row: currentSpace,
|
|
6200
|
+
owner: self.owners.get(currentTargetId) || null
|
|
6201
|
+
}, Date.now(), wt)) : "";
|
|
5480
6202
|
this.wiringStale = currentTargetId != null && this.liveImgTargetId !== currentTargetId;
|
|
5481
6203
|
var showLogin = hasPage && !captchaHit && !this.dismissedGuides.login;
|
|
5482
6204
|
var captchaKind = captchaHit && !this.dismissedGuides.captcha ? captchaHit.humanCheck.kind || "captcha" : null;
|
|
@@ -5505,6 +6227,7 @@ LivePreviewController.prototype._recompute = function() {
|
|
|
5505
6227
|
s.link = self.link;
|
|
5506
6228
|
s.trackAll = self.trackAll;
|
|
5507
6229
|
s.agentActiveId = self.agentActiveId;
|
|
6230
|
+
s.spaceMeta = metaLine;
|
|
5508
6231
|
});
|
|
5509
6232
|
this._syncWatch(currentTargetId);
|
|
5510
6233
|
};
|
|
@@ -5547,6 +6270,7 @@ LivePreviewController.prototype.togglePick = function() {
|
|
|
5547
6270
|
LivePreviewController.prototype.dispose = function() {
|
|
5548
6271
|
this.keyboardProxy.dispose();
|
|
5549
6272
|
this.disposed = true;
|
|
6273
|
+
if (this.spacesCoalescer) this.spacesCoalescer.cancel();
|
|
5550
6274
|
try {
|
|
5551
6275
|
this.pickControl.disable();
|
|
5552
6276
|
} catch (e) {}
|
|
@@ -5735,7 +6459,14 @@ LivePreviewController.prototype._renderEmpty = function() {
|
|
|
5735
6459
|
};
|
|
5736
6460
|
LivePreviewController.prototype._processSpaces = function(spaces) {
|
|
5737
6461
|
if (this.disposed) return;
|
|
5738
|
-
var incoming = Array.isArray(spaces) ? spaces : [];
|
|
6462
|
+
var incoming = truncateLastActive(Array.isArray(spaces) ? spaces : []);
|
|
6463
|
+
var liveAll = new Set(incoming.map(function(s$1) {
|
|
6464
|
+
return s$1 && s$1.targetId;
|
|
6465
|
+
}));
|
|
6466
|
+
var own = this.owners;
|
|
6467
|
+
own.forEach(function(_, id) {
|
|
6468
|
+
if (!liveAll.has(id)) own.delete(id);
|
|
6469
|
+
});
|
|
5739
6470
|
this.lastList = this.trackAll ? incoming : incoming.filter(function(s$1) {
|
|
5740
6471
|
return s$1 && s$1.active === true;
|
|
5741
6472
|
}).slice(0, 1);
|
|
@@ -5779,10 +6510,40 @@ LivePreviewController.prototype._processSpaces = function(spaces) {
|
|
|
5779
6510
|
if (busy !== this.lastSawActive) this.lastSawActive = busy;
|
|
5780
6511
|
this._recompute();
|
|
5781
6512
|
};
|
|
6513
|
+
/**
|
|
6514
|
+
* M5/M6 — 记下「谁在驱动这个 tab」(焦点事件累积)。
|
|
6515
|
+
*
|
|
6516
|
+
* focus 每次工具调用都会推一条(高频),所以同值不重算:一次白重渲染的
|
|
6517
|
+
* 代价在这里被幂等写入吃掉(R6)。
|
|
6518
|
+
*/
|
|
6519
|
+
LivePreviewController.prototype._noteFocus = function(f) {
|
|
6520
|
+
var changed = false;
|
|
6521
|
+
if (!f || typeof f.targetId !== "string") {
|
|
6522
|
+
if (this.owners.size > 0) {
|
|
6523
|
+
this.owners.clear();
|
|
6524
|
+
changed = true;
|
|
6525
|
+
}
|
|
6526
|
+
} else {
|
|
6527
|
+
var next = {
|
|
6528
|
+
source: typeof f.source === "string" ? f.source : void 0,
|
|
6529
|
+
sessionId: typeof f.sessionId === "string" ? f.sessionId : void 0
|
|
6530
|
+
};
|
|
6531
|
+
var prev = this.owners.get(f.targetId);
|
|
6532
|
+
if (!prev || prev.source !== next.source || prev.sessionId !== next.sessionId) {
|
|
6533
|
+
this.owners.set(f.targetId, next);
|
|
6534
|
+
changed = true;
|
|
6535
|
+
}
|
|
6536
|
+
}
|
|
6537
|
+
if (changed) this._recompute();
|
|
6538
|
+
};
|
|
5782
6539
|
LivePreviewController.prototype.openStream = function() {
|
|
5783
6540
|
if (this.disposed || !this.visible) return;
|
|
5784
6541
|
this.closeStream();
|
|
5785
6542
|
var self = this;
|
|
6543
|
+
if (this.spacesCoalescer) this.spacesCoalescer.cancel();
|
|
6544
|
+
this.spacesCoalescer = createSpacesCoalescer(function(list) {
|
|
6545
|
+
self._processSpaces(list);
|
|
6546
|
+
}, 300);
|
|
5786
6547
|
fetch(WATCH_STATUS_ROUTE, { cache: "no-store" }).then(function(res) {
|
|
5787
6548
|
return res.ok ? res.json() : null;
|
|
5788
6549
|
}).then(function(status) {
|
|
@@ -5811,7 +6572,36 @@ LivePreviewController.prototype.openStream = function() {
|
|
|
5811
6572
|
if (self.disposed) return;
|
|
5812
6573
|
try {
|
|
5813
6574
|
var list = JSON.parse(ev.data);
|
|
5814
|
-
if (Array.isArray(list)) self.
|
|
6575
|
+
if (Array.isArray(list)) if (self.spacesCoalescer) self.spacesCoalescer.push(list);
|
|
6576
|
+
else self._processSpaces(list);
|
|
6577
|
+
} catch (e) {}
|
|
6578
|
+
});
|
|
6579
|
+
this.sse.addEventListener("focus", function(ev) {
|
|
6580
|
+
if (self.disposed) return;
|
|
6581
|
+
try {
|
|
6582
|
+
self._noteFocus(JSON.parse(ev.data));
|
|
6583
|
+
} catch (e) {}
|
|
6584
|
+
});
|
|
6585
|
+
this.sse.addEventListener("tool-call", function(ev) {
|
|
6586
|
+
if (self.disposed) return;
|
|
6587
|
+
try {
|
|
6588
|
+
var m = JSON.parse(ev.data);
|
|
6589
|
+
var label = m && m.label;
|
|
6590
|
+
if (!label || typeof label.zh !== "string" && typeof label.en !== "string") return;
|
|
6591
|
+
self._actionLabel = label;
|
|
6592
|
+
self.store.update(function(st) {
|
|
6593
|
+
st.actionLabel = label;
|
|
6594
|
+
});
|
|
6595
|
+
if (self._actionTimer) clearTimeout(self._actionTimer);
|
|
6596
|
+
self._actionTimer = setTimeout(function() {
|
|
6597
|
+
self._actionTimer = null;
|
|
6598
|
+
self._actionLabel = null;
|
|
6599
|
+
try {
|
|
6600
|
+
self.store.update(function(st) {
|
|
6601
|
+
st.actionLabel = null;
|
|
6602
|
+
});
|
|
6603
|
+
} catch (e) {}
|
|
6604
|
+
}, 4e3);
|
|
5815
6605
|
} catch (e) {}
|
|
5816
6606
|
});
|
|
5817
6607
|
this.sse.addEventListener("capture-status", function(ev) {
|
|
@@ -6383,7 +7173,28 @@ function EgoBrowserTab(props) {
|
|
|
6383
7173
|
fontSize: "9.5px",
|
|
6384
7174
|
opacity: ".5",
|
|
6385
7175
|
flexShrink: "0"
|
|
6386
|
-
} }, "v" + CLIENT_BUILD)
|
|
7176
|
+
} }, "v" + CLIENT_BUILD), state.actionLabel ? h("span", {
|
|
7177
|
+
style: {
|
|
7178
|
+
marginLeft: "8px",
|
|
7179
|
+
flexShrink: "0",
|
|
7180
|
+
display: "inline-flex",
|
|
7181
|
+
alignItems: "center",
|
|
7182
|
+
gap: "5px",
|
|
7183
|
+
padding: "2px 8px",
|
|
7184
|
+
borderRadius: "999px",
|
|
7185
|
+
fontSize: "10.5px",
|
|
7186
|
+
background: "rgba(77,107,254,.14)",
|
|
7187
|
+
color: "var(--dsw-alias-label-primary, #4d6bfe)",
|
|
7188
|
+
border: "1px solid rgba(77,107,254,.32)"
|
|
7189
|
+
},
|
|
7190
|
+
title: "DSH · " + pickActionLabel(state.actionLabel)
|
|
7191
|
+
}, h("span", { style: {
|
|
7192
|
+
width: "5px",
|
|
7193
|
+
height: "5px",
|
|
7194
|
+
borderRadius: "50%",
|
|
7195
|
+
background: "#4d6bfe",
|
|
7196
|
+
display: "inline-block"
|
|
7197
|
+
} }), "DSH · " + pickActionLabel(state.actionLabel)) : null), h("button", {
|
|
6387
7198
|
className: "dsh-ego-side-iconbtn" + (state.busy ? " spinning" : ""),
|
|
6388
7199
|
title: wt("refresh"),
|
|
6389
7200
|
onClick: function() {
|
|
@@ -6491,7 +7302,10 @@ function EgoBrowserTab(props) {
|
|
|
6491
7302
|
onClick: function() {
|
|
6492
7303
|
controller.selectTab(s.targetId);
|
|
6493
7304
|
}
|
|
6494
|
-
}, badge !== "" ? h("span", { className: "dsh-ego-side-tabwin" }, badge) : null, h("span", { className: "dsh-ego-side-tabdot" }), h("span", {
|
|
7305
|
+
}, badge !== "" ? h("span", { className: "dsh-ego-side-tabwin" }, badge) : null, h("span", { className: "dsh-ego-side-tabdot" }), s.humanCheck && s.humanCheck.detected ? h("span", {
|
|
7306
|
+
className: "dsh-ego-side-tabwarn",
|
|
7307
|
+
title: wt("captchaTitle")
|
|
7308
|
+
}, wt("captchaTabBadge")) : null, h("span", {
|
|
6495
7309
|
className: "dsh-ego-side-tabtxt",
|
|
6496
7310
|
style: {
|
|
6497
7311
|
maxWidth: "150px",
|
|
@@ -6506,7 +7320,7 @@ function EgoBrowserTab(props) {
|
|
|
6506
7320
|
controller.closeTab(s.targetId);
|
|
6507
7321
|
}
|
|
6508
7322
|
}, "×"));
|
|
6509
|
-
})) : null;
|
|
7323
|
+
}), formatPageCount(state.spaces.length, wt) !== null ? h("span", { className: "dsh-ego-side-tabcount" }, formatPageCount(state.spaces.length, wt)) : null) : null;
|
|
6510
7324
|
var body;
|
|
6511
7325
|
var currentSpace = state.currentSpace;
|
|
6512
7326
|
if (!currentSpace) body = h("div", { className: "dsh-ego-side-body" }, h("div", { className: "dsh-ego-side-empty" }, h("div", null, wt("noActivePages")), h("div", { style: { fontSize: "11px" } }, wt("noActiveHint"))));
|
|
@@ -6556,7 +7370,7 @@ function EgoBrowserTab(props) {
|
|
|
6556
7370
|
controller.handleDoubleClick(e);
|
|
6557
7371
|
}
|
|
6558
7372
|
}) : h("div", { className: "dsh-ego-side-liveurl" }, state.engineUnsupported ? wt("engineUnsupportedBanner") : state.streamMessage || wt("noScreenshot"));
|
|
6559
|
-
body = h("div", { className: "dsh-ego-side-body" }, h("div", { className: "dsh-ego-side-liveview" }, h("div", { className: "dsh-ego-side-livebadge" }, h("span", { className: "dsh-ego-side-state-dot" + (state.pinned ? " pin" : state.busy ? " busy" : "") }), h("span", { style: { flex: 1 } }, (state.backend === "ffmpeg" ? "FFmpeg · H.264" : "CDP") + " · " + (state.streamState === "failed" ? state.streamMessage || wt("failed") : state.streamState === "unsupported" ? wt("engineUnsupportedBanner") : state.streamState) + (state.currentTargetId ? state.wiringStale ? " · " + wt("stale") : " · " + wt("captured") : "")), state.pinned ? h("button", {
|
|
7373
|
+
body = h("div", { className: "dsh-ego-side-body" }, h("div", { className: "dsh-ego-side-liveview" }, h("div", { className: "dsh-ego-side-livebadge" }, h("span", { className: "dsh-ego-side-state-dot" + (state.pinned ? " pin" : state.busy ? " busy" : "") }), h("span", { style: { flex: 1 } }, (state.backend === "ffmpeg" ? "FFmpeg · H.264" : "CDP") + " · " + (state.streamState === "failed" ? state.streamMessage || wt("failed") : state.streamState === "unsupported" ? wt("engineUnsupportedBanner") : state.streamState) + (state.currentTargetId ? state.wiringStale ? " · " + wt("stale") : " · " + wt("captured") : "") + (state.spaceMeta ? " · " + state.spaceMeta : "")), state.pinned ? h("button", {
|
|
6560
7374
|
className: "dsh-ego-side-back",
|
|
6561
7375
|
type: "button",
|
|
6562
7376
|
onClick: function() {
|