ycp424c/dsh-browser-bridge--packages-vite-plugin0

@ycp424c/dsh-browser-bridge-vite

Vite plugin that injects the DSH browser bridge page runtime

AI Analysis

核心用途是在前端开发流程中自动接入 DSH 桥接环境。适合使用 Vite 构建项目、并希望智能体能直接读取和操作开发中页面的开发者。

Package
@ycp424c/dsh-browser-bridge-vite
Version
0.1.0
Last updated
Aug 14, 2026

Install

This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗

@ycp424c/dsh-browser-bridge-vite

Vite plugin that injects the DSH browser bridge page runtime. Dev serves inject by default; production builds inject only with the explicit bridge.injectInBuild: true switch, and the serialized config keeps the production default of zero-network dormancy. Library mode and non-HTML SSR output are never injected.

import { dshBrowserBridge } from '@ycp424c/dsh-browser-bridge-vite'

export default defineConfig({
  plugins: [dshBrowserBridge({ dshOrigin: 'http://127.0.0.1:3080' })],
})
  • dshOrigin accepts only loopback HTTP(S) origins; credentials, remote hosts, and non-HTTP(S) schemes are rejected at config time.
  • The options schema is strict: secret-shaped keys are rejected because every option ends up in the frontend bundle.
  • Serialized configs escape <, U+2028, and U+2029 so inline module scripts can never be broken out of.
  • The virtual runtime module wires the official Vite HMR events (vite:afterUpdate / dispose) in development.

See the workspace README and INSTALL.md for installation and configuration.