# @alicloud/console-os-browser-vm

> browser virtual machine

Latest version **1.4.43** (published 2026-11-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install @alicloud/console-os-browser-vm
pnpm add @alicloud/console-os-browser-vm
yarn add @alicloud/console-os-browser-vm
bun add @alicloud/console-os-browser-vm
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.4.43 |
| Published | 2026-11-10 |
| First published | 2019-12-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 75.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jacksontian, fengmk2, pagecao, aliyunsdkteam, console-fe |

## Links

- npm: https://www.npmjs.com/package/@alicloud/console-os-browser-vm
- npm.io page: https://npm.io/package/@alicloud/console-os-browser-vm

## Dependencies (1)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.24.1

## Recent versions

- 1.4.43 (latest) — 2026-11-10
- 1.4.43-beta.2 (beta) — 2026-11-10
- 1.4.40-alpha.0 (alpha) — 2025-05-26
- 1.3.0-canary.5 (canary) — 2021-12-21
- 1.0.1-next.1 (next) — 2021-02-22
- 1.4.43-beta.1 — 2026-11-06
- 1.4.42 — 2026-09-07
- 1.4.42-beta.1 — 2026-09-03
- 1.4.41 — 2025-10-24
- 1.4.41-beta.2 — 2025-10-10
- 1.4.41-beta.1 — 2025-10-09
- 1.4.40 — 2025-07-28
- 1.4.39 — 2025-05-22
- 1.4.38 — 2025-02-20
- 1.4.37 — 2025-01-10
- … 112 more at https://npm.io/package/@alicloud/console-os-browser-vm/versions

## README

# @alicloud/console-os-browser-vm

## 安装

``` bash
> npm install @alicloud/console-os-browser-vm --save
```

## 说明

直接执行代码：

``` javascript
import { evalScripts } from '@alicloud/console-os-browser-vm';

const context = evalScripts('window.test = 1;')

console.log(window.test === undefined) // true
```

获取虚拟化部分浏览器内置对象。

```javascript
import { createContext, removeContext } from '@alicloud/console-os-browser-vm';

const context = await createContext();

const run = window.eval(`
  (() => function({window, history, locaiton, document}) {
    window.test = 1;
  })()
`)

console.log(context.window.test);
console.log(window.test);

// 操作虚拟化浏览器对象
context.history.pushState(null, null, '/test');
context.locaiton.hash = 'foo'

// 销毁一个 context
await removeContext( context );
```

---
_Source: https://npm.io/package/@alicloud/console-os-browser-vm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
