arise-browser 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/deploy/neko/Dockerfile
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
FROM ghcr.io/m1k1o/neko/google-chrome:latest
|
|
2
2
|
|
|
3
|
-
# socat to forward CDP from 127.0.0.1:9222 to 0.0.0.0:
|
|
3
|
+
# socat to forward CDP from 127.0.0.1:9222 to 0.0.0.0:9223
|
|
4
4
|
# (Chrome ignores --remote-debugging-address in newer versions)
|
|
5
5
|
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends socat && \
|
|
6
6
|
apt-get clean -y && rm -rf /var/lib/apt/lists/*
|
|
7
7
|
|
|
8
|
+
# Pre-create Chrome profile directory with correct ownership
|
|
9
|
+
# (Docker volumes mount as root; Chrome runs as neko user)
|
|
10
|
+
RUN mkdir -p /home/neko/.config/arise-chrome && \
|
|
11
|
+
chown -R neko:neko /home/neko/.config/arise-chrome
|
|
12
|
+
|
|
8
13
|
# Override supervisord config to enable CDP (--remote-debugging-port=9222)
|
|
9
14
|
COPY supervisord.conf /etc/neko/supervisord/google-chrome.conf
|
|
10
15
|
|
package/package.json
CHANGED
|
@@ -13,40 +13,34 @@ metadata:
|
|
|
13
13
|
|
|
14
14
|
# AriseBrowser
|
|
15
15
|
|
|
16
|
-
Control a real Chrome browser via HTTP API.
|
|
16
|
+
Control a real Chrome browser via HTTP API. Persistent element refs, YAML accessibility snapshots, WebRTC live view.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## MANDATORY RULES
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
**You MUST follow these rules. No exceptions.**
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
1. **Do NOT call any API endpoint until `/health` returns `{"connected":true}`.** The server needs time to start the Docker container and Chrome. Poll `/health` in a loop.
|
|
23
|
+
2. **Every browser task follows: Navigate → Snapshot → Act → Snapshot → Act → Done.** Always snapshot before acting — you need refs from the snapshot to target elements.
|
|
24
|
+
3. **Refs are persistent.** Do NOT re-snapshot just to reuse a ref. Only snapshot when the page changes significantly.
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
node --version || echo "MISSING: Install Node.js 20+ — https://nodejs.org"
|
|
28
|
-
```
|
|
26
|
+
## Step 1: Start the Server
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
Requires Docker and Node.js. If arise-browser is not installed:
|
|
31
29
|
```bash
|
|
32
|
-
|
|
30
|
+
npm install -g arise-browser
|
|
33
31
|
```
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
Start:
|
|
37
34
|
```bash
|
|
38
|
-
npm install -g arise-browser
|
|
39
35
|
npx arise-browser --virtual-display --port 9867 --host 0.0.0.0 &
|
|
40
36
|
```
|
|
41
37
|
|
|
42
|
-
Wait for ready
|
|
38
|
+
**Wait for ready (MANDATORY):**
|
|
43
39
|
```bash
|
|
44
|
-
until curl -s http://localhost:9867/health
|
|
45
|
-
curl http://localhost:9867/health
|
|
46
|
-
# → {"status":"ok","connected":true}
|
|
40
|
+
until curl -s http://localhost:9867/health 2>/dev/null | grep -q '"connected":true'; do sleep 2; done
|
|
47
41
|
```
|
|
48
42
|
|
|
49
|
-
First run takes ~2 minutes (Docker pulls
|
|
43
|
+
First run takes ~2 minutes (Docker pulls Neko Chrome image ~700MB).
|
|
50
44
|
|
|
51
45
|
### Tell the user
|
|
52
46
|
|