blitz icon indicating copy to clipboard operation
blitz copied to clipboard

Support crawl/automation use case

Open Thawab8 opened this issue 2 years ago • 3 comments

Hello, Any plans to support any of these ? puppeteer/playwright/crawlee please look into this use-case.

Thawab8 avatar Aug 12 '24 06:08 Thawab8

Assuming that it gains some adoption, I'd like to adopt the new Webdriver Bidi protocol (https://hacks.mozilla.org/2024/08/puppeteer-support-for-firefox/), which I believe would give us puppeteer support.

nicoburns avatar Aug 12 '24 06:08 nicoburns

I've been looking into supporting the Chrome Devtools Protocol. Which should allow Blitz to be controlled with puppeteer, and I believe would also us to use the Chrome devtools UI for inspecting Blitz.

Some resources:

  • Getting started guide: https://github.com/aslushnikov/getting-started-with-cdp/blob/master/README.md
  • Official reference docs: https://chromedevtools.github.io/devtools-protocol/
  • Further resources: https://github.com/ChromeDevTools/awesome-chrome-devtools#chrome-devtools-protocol
  • Puppteer's connection class (https://github.com/puppeteer/puppeteer/blob/main/packages/puppeteer-core/src/cdp/Connection.ts)

There are also a number of Rust crates implementing CDP (including some which auto-generate the types). They are generally targeted at clients, but the protocol definition is of course the same for client and server so we could probably use one of them:

  • https://github.com/mattsse/chromiumoxide
  • https://github.com/rust-headless-chrome/rust-headless-chrome

nicoburns avatar Jan 18 '25 05:01 nicoburns

I'm now thinking it may make sense to support the (original non-bidi) webdriver protocol (https://w3c.github.io/webdriver/). It's a relatively simple protocol and there's a Rust crate for the protocol side of things which is used by Servo and Firefox (https://docs.rs/webdriver). Probably this is a case of "the more protocols supported the better". Each protocol can likely be a relatively thin wrapper over shared implementation of the actual actions.

nicoburns avatar Aug 11 '25 10:08 nicoburns