Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ mm cdp Runtime.evaluate '{"expression":"typeof globalThis.stateHooks","returnByV
mm cdp Runtime.evaluate '{"expression":"1+1","returnByValue":true}' --fresh
```

The `params-json` argument must be a valid JSON object. The `--timeout` flag sets the per-command action timeout (default and max: 30 000 ms); the CLI waits up to 47 s for the default so the daemon can run the command and collect its observation. Browser commands share one persistent CDP session per target (page or service worker), so a domain enabled by one call stays enabled for later calls; the session is dropped and re-attached after the page or service worker restarts. `--fresh` opens a one-shot session for a single command and detaches it afterwards. The tool is categorized as `cdp`: by default it returns no observation and does not refresh refs, so pass `--observe full` (or run `mm describe-screen`) after a call that changes state.
The `params-json` argument must be a valid JSON object. The `--timeout` flag sets the per-command action timeout (default and max: 30 000 ms); the CLI waits up to 47 s for the default so the daemon can run the command and collect its observation. Browser commands share one persistent CDP session per target (page or service worker), so a domain enabled by one call stays enabled for later calls; the session is dropped and re-attached after the page or service worker restarts. An event subscription owns the domains it enables on a target. While it holds one, a `<Domain>.enable` on that target with no params (or the subscription's own params) sends nothing and returns the result of the subscription's enable (`{}` for the standard domains): the domain is already enabled. A `<Domain>.enable` with other params and a `<Domain>.disable` are refused with `MM_CDP_BLOCKED`, because they would change or stop the subscription's events (send them with `--fresh` to run them on a session of their own). `--fresh` opens a one-shot session for a single command and detaches it afterwards. The tool is categorized as `cdp`: by default it returns no observation and does not refresh refs, so pass `--observe full` (or run `mm describe-screen`) after a call that changes state.

#### Browser vs Mobile (Hermes) CDP

Expand Down
2 changes: 1 addition & 1 deletion SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ mm cdp Runtime.evaluate '{"expression":"document.querySelector(\'#personalSign\'
| Blocked methods | `Browser.close`, `Target.closeTarget`, `Target.disposeBrowserContext`, `Browser.crashGpuProcess` | `Runtime.terminateExecution`, `Inspector.detached` | `Browser.close`, `Target.closeTarget`, `Target.disposeBrowserContext`, `Browser.crashGpuProcess` |
| Result shape | Standard CDP response | `Runtime.evaluate` nests the value at `result.result.value` | `Runtime.evaluate` nests the value at `result.result.value` |

Browser commands share one persistent CDP session per target, so a domain enabled by one call (e.g. `Network.enable`) stays enabled for the next calls on the same target. Use `--fresh` for a command that must run on its own session, detached afterwards. After an Extension service-worker restart the stale session is dropped and the next call re-attaches.
Browser commands share one persistent CDP session per target, so a domain enabled by one call (e.g. `Network.enable`) stays enabled for the next calls on the same target. An event subscription owns the domains it enables on a target. While it holds one, `<Domain>.enable` with no params (or the subscription's own params) succeeds without sending anything, since the domain is already enabled, and returns `{}`; `<Domain>.enable` with other params and `<Domain>.disable` are refused with `MM_CDP_BLOCKED`, because they would change or stop the subscription's events. Use `--fresh` for a command that must run on its own session, detached afterwards. After an Extension service-worker restart the stale session is dropped and the next call re-attaches.

On mobile, `cdp` and `hermes-targets` use the Metro port the session was launched with (`mm launch --metro-port`), then the `HERMES_METRO_PORT` env var, then 8081. A per-call `--metro-port` / `--app-id` overrides it for that call only. When device-mcp exports `HermesClient` (needs a device-mcp release with MetaMask/device-mcp P2-02) the session keeps one Hermes connection for its Metro port and app id and reuses it across calls; otherwise each call opens its own connection. A mobile failure names the Metro port it used.

Expand Down
Loading
Loading