create-bridgething 0.6.0 → 0.7.0
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/package.json
CHANGED
|
@@ -68,25 +68,26 @@ CDP input goes straight into the page (never through the physical buttons), so t
|
|
|
68
68
|
launcher gesture and on-device browser-nav side effects never interfere.
|
|
69
69
|
|
|
70
70
|
Install the app onto the device first so the kiosk is showing it (build + push).
|
|
71
|
-
|
|
72
|
-
chromium refuses to bind it to anything routable, so a tunnel is mandatory):
|
|
71
|
+
CDP is served at `bridgething.local:9222`, reachable directly over USB:
|
|
73
72
|
|
|
74
73
|
```bash
|
|
75
74
|
# device answers at bridgething.local over USB; root has no password
|
|
76
|
-
|
|
77
|
-
curl -s http://localhost:9223/json/version >/dev/null && echo tunnel-up
|
|
75
|
+
curl -s http://bridgething.local:9222/json/version >/dev/null && echo cdp-up
|
|
78
76
|
```
|
|
79
77
|
|
|
78
|
+
Use the `webSocketDebuggerUrl` exactly as returned. It comes back as an IP rather
|
|
79
|
+
than the hostname you asked for, and it is already correct - do not rewrite it.
|
|
80
|
+
|
|
80
81
|
**Playwright's `connectOverCDP` hangs against the device's embedded chromium** -
|
|
81
82
|
it never finishes the websocket upgrade (a quirk of the device's `cast_shell`
|
|
82
|
-
build
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
build; a plain websocket connects fine). Drive it with a raw CDP websocket
|
|
84
|
+
instead. Connect to the `page` target from `/json` (the page-level endpoint, not
|
|
85
|
+
the browser-level one). This script screenshots the live device and presses a
|
|
86
|
+
button; it is the whole loop:
|
|
86
87
|
|
|
87
88
|
```ts
|
|
88
89
|
// drive.ts -> run with: bun drive.ts
|
|
89
|
-
const targets = (await fetch('http://
|
|
90
|
+
const targets = (await fetch('http://bridgething.local:9222/json').then(r => r.json())) as any[];
|
|
90
91
|
const page = targets.find(t => t.type === 'page');
|
|
91
92
|
const ws = new WebSocket(page.webSocketDebuggerUrl);
|
|
92
93
|
await new Promise<void>((res, rej) => {
|