npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@agent-infra/browser-ui

v0.2.1

Published

<div align="right"> <b>简体中文</b> | <a href="README.md">English</a> </div>

Downloads

111

Readme

@agent-infra/browser-ui

@agent-infra/browser-ui 是一个基于 CDP 的浏览器远程投屏解决方案。它基于 @agent-infra/browser 实现了基础能力封装,可以被网页直接作为 Web 组件引用。

用户只需要提供有权限的 CDP WebSocket URL,@agent-infra/browser-ui 就可以展示远程浏览器的页面,同时你也可以手动介入浏览器操作,在没有 VNC 和无头浏览器的场景下非常有用。

安装

npm install @agent-infra/browser-ui

快速开始

在前端项目中使用:

import { BrowserUI } from '@agent-infra/browser-ui';

const container = document.getElementById('browserContainer');
if (!container) {
  throw new Error('Browser container element not found');
}

BrowserUI.create({
  root: container,
  browserOptions: {
    connect: {
      browserWSEndpoint: 'https://example.com/ws/url',
    },
  },
});

或者直接使用 unpkg CDN:

  • CDN URL: https://unpkg.com/@agent-infra/browser-ui/dist/bundle/index.js
<!doctype html>
<html lang="en">
  <body>
    <div id="browserContainer"></div>
    <script src="https://unpkg.com/@agent-infra/browser-ui/dist/bundle/index.js"></script>
    <script>
      const BrowserUI = window.agent_infra_browser_ui.BrowserUI;

      BrowserUI.create({
        root: document.getElementById('browserContainer'),
        browserOptions: {
          connect: {
            // @ts-ignore
            browserWSEndpoint: 'https://example.com/ws/url',
          },
        },
      });
    </script>
  </body>
</html>

完整的可用示例,可直接在当前目录下运行 npm run dev 或查看包中的 /examples 目录。

核心功能

关于所有功能的详细文档和 API 参考,请访问我们的完整文档

  • 标签页管理 - 显示所有标签页并实现 switchTab/createTab/closeTab 功能
  • 导航控制 - 基础功能如 goBack/goForward/reload/goto
  • 对话框处理 - 实时显示并响应阻塞弹窗如 Alert/Confirm
  • 鼠标操作 - 支持 move/hover/click/drag 操作
  • 键盘输入 - 完整键盘支持,包括常用热键
  • 剪贴板模拟 - 模拟剪贴板功能用于复制粘贴操作

系统要求

  • Node.js >= 20.x
  • 支持远程调试的 Chrome/Chromium 浏览器
  • 可访问 CDP WebSocket 端点的网络环境

许可证

Apache License 2.0.

致谢

特别感谢启发此工具包的开源项目: