# Browser wall

> A wall of maps in item frames that shows a web page, where every player sees and drives a page of their own - clicks, scrolling with the hotbar and /browse - with a headless browser behind it.

The browser wall shows a web page on a wall of maps. Every player who looks at it sees a page of their own, from the same wall. A player clicks the page by swinging at it, scrolls by moving the hotbar selection, and opens another page with `/browse <url>`.

Source: [`examples/browser-wall`](https://github.com/minekube/minekube/tree/main/examples/browser-wall).

## What it shows

- **A page per player.** The game opens one browser page per viewer, through the Chrome DevTools Protocol, and sends each player the maps of their own page. Players do not see each other's pages.
- **Pixels from aim.** The rules work out which pixel of the page a player aims at, from where they stand and look. A click is a press at that pixel. A change of hotbar slot scrolls the page.
- **Only changed maps.** Each map is 128 by 128 pixels. When a page changes, only the maps that changed are sent.
- **Failure as a message.** When the browser goes away, the player's page breaks off with `LostPage`, and the player is told why in chat.
- **Two players end to end.** `browser-wall.e2e.ts` joins two real clients. One clicks a button and the other scrolls a list, and each sees only their own change, down to which maps changed. Then one leaves and the other keeps scrolling.

## Run it

The wall needs a browser that speaks the Chrome DevTools Protocol at `127.0.0.1:8787`. The tests use the [Kitesurf](https://github.com/cloudflare/kitesurf) container.

```sh
mk server
mk dev examples/browser-wall
```

`bun test examples/browser-wall` runs the rules and the recorded session with two viewers.

## Read next

- [Test with bot clients](https://minekube.com/games/testing/bots): how the two players in the end-to-end test are bundles in real clients.
- [Performance](https://minekube.com/games/platform/performance#browser-wall): what Kitesurf measured for sessions, clicks and scrolling.
