mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
config(extension): 配置WebSocket连接URL为构建时变量
- 移除DEFAULT_DAEMON_PORT常量定义 - 使用__BSK_DAEMON_WS_URL__构建时变量替代硬编码端口 - 在wxt.config.ts和vitest.config.ts中添加环境变量配置 - 为__BSK_DAEMON_WS_URL__添加类型声明和文档注释 - 默认值保持为ws://127.0.0.1:52800,可通过BSK_DAEMON_WS_URL环境变量覆盖
This commit is contained in:
@@ -31,12 +31,9 @@ import { detectBrowserMeta } from "@/transport/handshake";
|
||||
import type { Transport } from "@/transport/transport";
|
||||
import { WSTransport } from "@/transport/ws-transport";
|
||||
|
||||
export const DEFAULT_DAEMON_PORT = 52800;
|
||||
|
||||
export default defineBackground(() => {
|
||||
const port = DEFAULT_DAEMON_PORT;
|
||||
const controller = new ConnectionController();
|
||||
const transport = new WSTransport({ url: `ws://127.0.0.1:${port}` });
|
||||
const transport = new WSTransport({ url: __BSK_DAEMON_WS_URL__ });
|
||||
const sessions = new SessionManager();
|
||||
const cdp = new ChromiumCdp();
|
||||
const sessionsLive = attachSessionsLiveFlag({ manager: sessions });
|
||||
|
||||
Reference in New Issue
Block a user