mirror of
https://github.com/aiclientproxy/proxycast.git
synced 2026-09-24 23:10:56 +08:00
feat: release v0.88.0 with automation and browser runtime upgrades
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
- Observer 通道自动连接:`/proxycast-chrome-observer/Proxycast_Key=...`
|
||||
- 页面信息上报:标题、URL、Markdown
|
||||
- 远程指令执行:`open_url` / `click` / `type` / `scroll` / `switch_tab` / `go_back` 等
|
||||
- 远程指令执行:`open_url` / `click` / `type` / `scroll` / `switch_tab` / `list_tabs` / `go_back` 等
|
||||
- 弹窗配置:`serverUrl`、`bridgeKey`、`profileKey`、监控开关、手动抓取
|
||||
|
||||
## 安装
|
||||
|
||||
@@ -235,6 +235,11 @@ async function executeRemoteCommand(commandData) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (command === "list_tabs") {
|
||||
await handleListTabs(commandData);
|
||||
return;
|
||||
}
|
||||
|
||||
const tabId = await resolveTargetTabId();
|
||||
if (!tabId) {
|
||||
sendCommandResult({
|
||||
@@ -389,6 +394,41 @@ async function handleSwitchTab(commandData, waitForPageInfo) {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleListTabs(commandData) {
|
||||
const requestId = commandData.requestId;
|
||||
const sourceClientId = commandData.sourceClientId;
|
||||
|
||||
try {
|
||||
const tabs = await chrome.tabs.query({ currentWindow: true });
|
||||
const normalizedTabs = tabs
|
||||
.filter((tab) => Number.isInteger(tab.id) && Number.isInteger(tab.index))
|
||||
.map((tab) => ({
|
||||
id: tab.id,
|
||||
index: tab.index,
|
||||
active: tab.active === true,
|
||||
title: tab.title || "",
|
||||
url: tab.url || "",
|
||||
}));
|
||||
|
||||
sendCommandResult({
|
||||
requestId,
|
||||
sourceClientId,
|
||||
status: "success",
|
||||
message: `已读取 ${normalizedTabs.length} 个标签页`,
|
||||
data: {
|
||||
tabs: normalizedTabs,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
sendCommandResult({
|
||||
requestId,
|
||||
sourceClientId,
|
||||
status: "error",
|
||||
error: error?.message || String(error),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function sendCommandResult(data) {
|
||||
sendObserverMessage({
|
||||
type: "command_result",
|
||||
|
||||
Reference in New Issue
Block a user