mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-09 12:51:45 -04:00
Follows https://github.com/lightpanda-io/browser/pull/3552 to add various element endpoints. Total of 13 new endpoints were added, including a slightly fancier router to deal with variables in URLs. ``` $ curl -X POST "http://localhost:9222/session" --data '{}' {"value":{"sessionId":"248378f2-bc8d-4cb5-8aaf-3ec4193c5a9e","capabilities":{"acceptInsecureCerts":false,"browserName":"Lightpanda","browserVersion":"1.0.0-dev.9605+475ed9ae7","platformName":"linux","setWindowRect":false,"userAgent":"Lightpanda/1.0","proxy":{}}}}⏎ ~/c/p/browser2] $ curl -X POST "http://localhost:9222/session/248378f2-bc8d-4cb5-8aaf-3ec4193c5a9e/url" --data '{"url": "https://lightpanda.io"}' {"value":null} $ curl -X POST "http://localhost:9222/session/248378f2-bc8d-4cb5-8aaf-3ec4193c5a9e/element" --data '{"using":"css selector","value":"h1"}' {"value":{"element-6066-11e4-a52e-4f735466cecf":"1"}} $ curl -X GET "http://localhost:9222/session/248378f2-bc8d-4cb5-8aaf-3ec4193c5a9e/element/1/text" {"value":"The first browserfor machines, not humans"} ``` First two already existed, last two are new.