ping
:
Instructions
Purpose
Verify the LionScraper extension is connected over the local WebSocket bridge. If disconnected, tries Chrome first, then Edge (each installed channel): detect paths and whether the process is running. For each channel, the Server waits up to postLaunchWaitMs for the extension to register: if the browser was not running and autoLaunchBrowser allows it, the Server starts it; if the browser was already running, it polls without closing that browser. If this ping started the browser and registration still does not occur within postLaunchWaitMs, the Server closes only that launched instance before trying the next channel. Worst-case wait is up to about 2× postLaunchWaitMs when both channels each use a full wait (e.g. two launches, two already-running browsers, or a mix).
When to call
In a new session, before any
scrape*tool.Right after any tool returns
EXTENSION_NOT_CONNECTED.
Returns
Success:
ok,bridgeOk,browser,development(alwaysnodefor this npm package),extensionVersion; optionaldiagnosticswhen the server assisted (launchedtrue or false,waitedMs,selectedBrowser).Failure:
BROWSER_NOT_INSTALLED(no Chrome/Edge found on standard paths), orEXTENSION_NOT_CONNECTEDwithdetails.browserProbe/details.bridge/details.install.
Parameters
autoLaunchBrowser: optional boolean. Iffalse, never spawn a browser; non-running candidates are skipped and the Server continues to the next installed channel when possible. If omitted: default true (server may auto-launch eligible browsers).postLaunchWaitMs: optional; max time (ms) to poll for WebSocket registration after spawning a browser or when a browser is already running, clamped 3000–60000, default 20000.
Notes
Does not load pages or extract data. Portable browser installs may not be detected. Optional lang follows the lang section above.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | BCP 47 for human-readable errors this call: en-US | zh-CN. Omitted → English. Pass zh-CN when the user works in Chinese; the Server cannot infer chat language. | |
| autoLaunchBrowser | No | If true, when the bridge is down the Server may start Chrome then Edge (each installed channel) if not running. If false, never spawn; skips non-running channels and tries the next. Omitted: defaults to true. | |
| postLaunchWaitMs | No | Milliseconds to poll for the extension WebSocket register after spawning a browser or while Chrome/Edge is already running (clamped 3000–60000; default 20000). |