chrome-vision

module
v0.0.0-...-cb5eaf0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2021 License: MIT

README

Chrome Vision

Go Reference Go Report Card GitHub Workflow Status

Advanced cross-platform web automation with a convenient Go API.

This project is based on the Chrome DevTools Protocol (CDP) and WebDriver specification, to control web sessions in Chrome and other Blink-based browsers.

It improves, consolidates and extends the approaches of Selenium WebDriver, Puppeteer and ChromeDP. The first two are very popular, but only the last one offers integration with Go without heavy non-Go dependencies, albeit with a very limited high-level API.

Goals

  • Make the Chrome DevTools Protocol more accessible
  • Simplify the low-level API even more than ChromeDP
  • Support the WebDriver specification as a higher-level API layer, together with the lower-level CDP API
  • Add Computer Vision (CV) and Optical Character Recognition (OCR) capabilities, which are missing in all of the above

Differences From ChromeDP

  • Simpler session initialization, and simpler customization of browser flags (see example)

  • Simpler CDP command execution API:

    • More idiomatic command execution, instead of limited JavaScript-await-like wrapper functions (chromedp.Run, chromedp.RunResponse, chromedp.ActionFunc):

      • Synchronous/blocking execution (simplest): the command's Do function waits for the browser's response and returns it as a parsed struct (see example)
      • Asynchronous/non-blocking execution (more advanced): the command's Start function returns a Go channel to receive from the browser a raw devtools.Message, and the optional ParseResponse function parses it (see example)
      • Return values: for commands with output, Do and ParseResponse return a single struct, to avoid the clutter and brittleness of many return value assignments
      • Errors: both Go and CDP errors are returned as Go errors by Do and ParseResponse, no need for multiple error checks per command
    • No need to initialize executors, either with chromedp.Run or with cdproto.cdp.WithExecutor

  • Communication with the browser:

    • Non-Windows operating systems: using POSIX pipes instead of WebSockets (faster, more reliable and more secure)
    • Windows: using an internal implementation of the WebSocket protocol (optimized for Chrome DevTools, faster and more efficient - see documentation)
  • Stronger adherence to idiomatic Go coding style and https://github.com/golang-standards/project-layout

Directories

Path Synopsis
cmd
cdpgen
The cdpgen program generates the source code of the Go bindings for all the commands, events and types in the Chrome DevTools Protocol (CDP) - from the latest Chromium "tip-of-tree" (tot) definitions (see the details and API documentation in https://chromedevtools.github.io/devtools-protocol/tot, mirrored in https://github.com/ChromeDevTools/devtools-protocol).
The cdpgen program generates the source code of the Go bindings for all the commands, events and types in the Chrome DevTools Protocol (CDP) - from the latest Chromium "tip-of-tree" (tot) definitions (see the details and API documentation in https://chromedevtools.github.io/devtools-protocol/tot, mirrored in https://github.com/ChromeDevTools/devtools-protocol).
examples
googlesearch/devtools
The devtools program is an example for interacting with Google Search, using Chrome Vision's Chrome DevTools Protocol (CDP) API.
The devtools program is an example for interacting with Google Search, using Chrome Vision's Chrome DevTools Protocol (CDP) API.
init
The init program contains various examples of initialization and customization of browser sessions in Chrome Vision.
The init program contains various examples of initialization and customization of browser sessions in Chrome Vision.
navigation/devtools/async
The async program is an example for running Chrome DevTools Protocol (CDP) commands in an asynchronous (non-blocking) mode, which enables more advanced logic than the synchronous (blocking) mode.
The async program is an example for running Chrome DevTools Protocol (CDP) commands in an asynchronous (non-blocking) mode, which enables more advanced logic than the synchronous (blocking) mode.
navigation/devtools/sync
The sync program is an example for running Chrome DevTools Protocol (CDP) commands in a synchronous (blocking) mode, which is more straightforward than the asynchronous (non-blocking) mode.
The sync program is an example for running Chrome DevTools Protocol (CDP) commands in a synchronous (blocking) mode, which is more straightforward than the asynchronous (non-blocking) mode.
internal
cdpgen
Package cdpgen generates the source code of the Go bindings for all the commands, events and types in the Chrome DevTools Protocol (CDP) - from the latest Chromium "tip-of-tree" (tot) definitions (see the details and API documentation in https://chromedevtools.github.io/devtools-protocol/tot, mirrored in https://github.com/ChromeDevTools/devtools-protocol).
Package cdpgen generates the source code of the Go bindings for all the commands, events and types in the Chrome DevTools Protocol (CDP) - from the latest Chromium "tip-of-tree" (tot) definitions (see the details and API documentation in https://chromedevtools.github.io/devtools-protocol/tot, mirrored in https://github.com/ChromeDevTools/devtools-protocol).
pkg
devtools
Package devtools provides Go bindings for all the commands, events and types in the Chrome DevTools Protocol (CDP) - from the latest Chromium "tip-of-tree" (tot) definitions (see the details and API documentation in https://chromedevtools.github.io/devtools-protocol/tot, mirrored in https://github.com/ChromeDevTools/devtools-protocol).
Package devtools provides Go bindings for all the commands, events and types in the Chrome DevTools Protocol (CDP) - from the latest Chromium "tip-of-tree" (tot) definitions (see the details and API documentation in https://chromedevtools.github.io/devtools-protocol/tot, mirrored in https://github.com/ChromeDevTools/devtools-protocol).
devtools/accessibility
Package accessibility provides Go bindings for the `Accessibility` domain (https://chromedevtools.github.io/devtools-protocol/tot/Accessibility) in the Chrome DevTools Protocol (CDP), version 1.3.
Package accessibility provides Go bindings for the `Accessibility` domain (https://chromedevtools.github.io/devtools-protocol/tot/Accessibility) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/animation
Package animation provides Go bindings for the `Animation` domain (https://chromedevtools.github.io/devtools-protocol/tot/Animation) in the Chrome DevTools Protocol (CDP), version 1.3.
Package animation provides Go bindings for the `Animation` domain (https://chromedevtools.github.io/devtools-protocol/tot/Animation) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/audits
Package audits provides Go bindings for the `Audits` domain (https://chromedevtools.github.io/devtools-protocol/tot/Audits) in the Chrome DevTools Protocol (CDP), version 1.3.
Package audits provides Go bindings for the `Audits` domain (https://chromedevtools.github.io/devtools-protocol/tot/Audits) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/backgroundservice
Package backgroundservice provides Go bindings for the `BackgroundService` domain (https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService) in the Chrome DevTools Protocol (CDP), version 1.3.
Package backgroundservice provides Go bindings for the `BackgroundService` domain (https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/browser
Package browser provides Go bindings for the `Browser` domain (https://chromedevtools.github.io/devtools-protocol/tot/Browser) in the Chrome DevTools Protocol (CDP), version 1.3.
Package browser provides Go bindings for the `Browser` domain (https://chromedevtools.github.io/devtools-protocol/tot/Browser) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/cachestorage
Package cachestorage provides Go bindings for the `CacheStorage` domain (https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage) in the Chrome DevTools Protocol (CDP), version 1.3.
Package cachestorage provides Go bindings for the `CacheStorage` domain (https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/cast
Package cast provides Go bindings for the `Cast` domain (https://chromedevtools.github.io/devtools-protocol/tot/Cast) in the Chrome DevTools Protocol (CDP), version 1.3.
Package cast provides Go bindings for the `Cast` domain (https://chromedevtools.github.io/devtools-protocol/tot/Cast) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/console
Package console provides Go bindings for the `Console` domain (https://chromedevtools.github.io/devtools-protocol/tot/Console) in the Chrome DevTools Protocol (CDP), version 1.3.
Package console provides Go bindings for the `Console` domain (https://chromedevtools.github.io/devtools-protocol/tot/Console) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/css
Package css provides Go bindings for the `CSS` domain (https://chromedevtools.github.io/devtools-protocol/tot/CSS) in the Chrome DevTools Protocol (CDP), version 1.3.
Package css provides Go bindings for the `CSS` domain (https://chromedevtools.github.io/devtools-protocol/tot/CSS) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/database
Package database provides Go bindings for the `Database` domain (https://chromedevtools.github.io/devtools-protocol/tot/Database) in the Chrome DevTools Protocol (CDP), version 1.3.
Package database provides Go bindings for the `Database` domain (https://chromedevtools.github.io/devtools-protocol/tot/Database) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/debugger
Package debugger provides Go bindings for the `Debugger` domain (https://chromedevtools.github.io/devtools-protocol/tot/Debugger) in the Chrome DevTools Protocol (CDP), version 1.3.
Package debugger provides Go bindings for the `Debugger` domain (https://chromedevtools.github.io/devtools-protocol/tot/Debugger) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/deviceorientation
Package deviceorientation provides Go bindings for the `DeviceOrientation` domain (https://chromedevtools.github.io/devtools-protocol/tot/DeviceOrientation) in the Chrome DevTools Protocol (CDP), version 1.3.
Package deviceorientation provides Go bindings for the `DeviceOrientation` domain (https://chromedevtools.github.io/devtools-protocol/tot/DeviceOrientation) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/dom
Package dom provides Go bindings for the `DOM` domain (https://chromedevtools.github.io/devtools-protocol/tot/DOM) in the Chrome DevTools Protocol (CDP), version 1.3.
Package dom provides Go bindings for the `DOM` domain (https://chromedevtools.github.io/devtools-protocol/tot/DOM) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/domdebugger
Package domdebugger provides Go bindings for the `DOMDebugger` domain (https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger) in the Chrome DevTools Protocol (CDP), version 1.3.
Package domdebugger provides Go bindings for the `DOMDebugger` domain (https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/domsnapshot
Package domsnapshot provides Go bindings for the `DOMSnapshot` domain (https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot) in the Chrome DevTools Protocol (CDP), version 1.3.
Package domsnapshot provides Go bindings for the `DOMSnapshot` domain (https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/domstorage
Package domstorage provides Go bindings for the `DOMStorage` domain (https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage) in the Chrome DevTools Protocol (CDP), version 1.3.
Package domstorage provides Go bindings for the `DOMStorage` domain (https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/emulation
Package emulation provides Go bindings for the `Emulation` domain (https://chromedevtools.github.io/devtools-protocol/tot/Emulation) in the Chrome DevTools Protocol (CDP), version 1.3.
Package emulation provides Go bindings for the `Emulation` domain (https://chromedevtools.github.io/devtools-protocol/tot/Emulation) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/eventbreakpoints
Package eventbreakpoints provides Go bindings for the `EventBreakpoints` domain (https://chromedevtools.github.io/devtools-protocol/tot/EventBreakpoints) in the Chrome DevTools Protocol (CDP), version 1.3.
Package eventbreakpoints provides Go bindings for the `EventBreakpoints` domain (https://chromedevtools.github.io/devtools-protocol/tot/EventBreakpoints) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/fetch
Package fetch provides Go bindings for the `Fetch` domain (https://chromedevtools.github.io/devtools-protocol/tot/Fetch) in the Chrome DevTools Protocol (CDP), version 1.3.
Package fetch provides Go bindings for the `Fetch` domain (https://chromedevtools.github.io/devtools-protocol/tot/Fetch) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/headlessexperimental
Package headlessexperimental provides Go bindings for the `HeadlessExperimental` domain (https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental) in the Chrome DevTools Protocol (CDP), version 1.3.
Package headlessexperimental provides Go bindings for the `HeadlessExperimental` domain (https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/heapprofiler
Package heapprofiler provides Go bindings for the `HeapProfiler` domain (https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler) in the Chrome DevTools Protocol (CDP), version 1.3.
Package heapprofiler provides Go bindings for the `HeapProfiler` domain (https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/indexeddb
Package indexeddb provides Go bindings for the `IndexedDB` domain (https://chromedevtools.github.io/devtools-protocol/tot/IndexedDB) in the Chrome DevTools Protocol (CDP), version 1.3.
Package indexeddb provides Go bindings for the `IndexedDB` domain (https://chromedevtools.github.io/devtools-protocol/tot/IndexedDB) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/input
Package input provides Go bindings for the `Input` domain (https://chromedevtools.github.io/devtools-protocol/tot/Input) in the Chrome DevTools Protocol (CDP), version 1.3.
Package input provides Go bindings for the `Input` domain (https://chromedevtools.github.io/devtools-protocol/tot/Input) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/inspector
Package inspector provides Go bindings for the `Inspector` domain (https://chromedevtools.github.io/devtools-protocol/tot/Inspector) in the Chrome DevTools Protocol (CDP), version 1.3.
Package inspector provides Go bindings for the `Inspector` domain (https://chromedevtools.github.io/devtools-protocol/tot/Inspector) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/io
Package io provides Go bindings for the `IO` domain (https://chromedevtools.github.io/devtools-protocol/tot/IO) in the Chrome DevTools Protocol (CDP), version 1.3.
Package io provides Go bindings for the `IO` domain (https://chromedevtools.github.io/devtools-protocol/tot/IO) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/layertree
Package layertree provides Go bindings for the `LayerTree` domain (https://chromedevtools.github.io/devtools-protocol/tot/LayerTree) in the Chrome DevTools Protocol (CDP), version 1.3.
Package layertree provides Go bindings for the `LayerTree` domain (https://chromedevtools.github.io/devtools-protocol/tot/LayerTree) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/log
Package log provides Go bindings for the `Log` domain (https://chromedevtools.github.io/devtools-protocol/tot/Log) in the Chrome DevTools Protocol (CDP), version 1.3.
Package log provides Go bindings for the `Log` domain (https://chromedevtools.github.io/devtools-protocol/tot/Log) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/media
Package media provides Go bindings for the `Media` domain (https://chromedevtools.github.io/devtools-protocol/tot/Media) in the Chrome DevTools Protocol (CDP), version 1.3.
Package media provides Go bindings for the `Media` domain (https://chromedevtools.github.io/devtools-protocol/tot/Media) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/memory
Package memory provides Go bindings for the `Memory` domain (https://chromedevtools.github.io/devtools-protocol/tot/Memory) in the Chrome DevTools Protocol (CDP), version 1.3.
Package memory provides Go bindings for the `Memory` domain (https://chromedevtools.github.io/devtools-protocol/tot/Memory) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/network
Package network provides Go bindings for the `Network` domain (https://chromedevtools.github.io/devtools-protocol/tot/Network) in the Chrome DevTools Protocol (CDP), version 1.3.
Package network provides Go bindings for the `Network` domain (https://chromedevtools.github.io/devtools-protocol/tot/Network) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/overlay
Package overlay provides Go bindings for the `Overlay` domain (https://chromedevtools.github.io/devtools-protocol/tot/Overlay) in the Chrome DevTools Protocol (CDP), version 1.3.
Package overlay provides Go bindings for the `Overlay` domain (https://chromedevtools.github.io/devtools-protocol/tot/Overlay) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/page
Package page provides Go bindings for the `Page` domain (https://chromedevtools.github.io/devtools-protocol/tot/Page) in the Chrome DevTools Protocol (CDP), version 1.3.
Package page provides Go bindings for the `Page` domain (https://chromedevtools.github.io/devtools-protocol/tot/Page) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/performance
Package performance provides Go bindings for the `Performance` domain (https://chromedevtools.github.io/devtools-protocol/tot/Performance) in the Chrome DevTools Protocol (CDP), version 1.3.
Package performance provides Go bindings for the `Performance` domain (https://chromedevtools.github.io/devtools-protocol/tot/Performance) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/performancetimeline
Package performancetimeline provides Go bindings for the `PerformanceTimeline` domain (https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline) in the Chrome DevTools Protocol (CDP), version 1.3.
Package performancetimeline provides Go bindings for the `PerformanceTimeline` domain (https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/profiler
Package profiler provides Go bindings for the `Profiler` domain (https://chromedevtools.github.io/devtools-protocol/tot/Profiler) in the Chrome DevTools Protocol (CDP), version 1.3.
Package profiler provides Go bindings for the `Profiler` domain (https://chromedevtools.github.io/devtools-protocol/tot/Profiler) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/runtime
Package runtime provides Go bindings for the `Runtime` domain (https://chromedevtools.github.io/devtools-protocol/tot/Runtime) in the Chrome DevTools Protocol (CDP), version 1.3.
Package runtime provides Go bindings for the `Runtime` domain (https://chromedevtools.github.io/devtools-protocol/tot/Runtime) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/schema
Package schema provides Go bindings for the `Schema` domain (https://chromedevtools.github.io/devtools-protocol/tot/Schema) in the Chrome DevTools Protocol (CDP), version 1.3.
Package schema provides Go bindings for the `Schema` domain (https://chromedevtools.github.io/devtools-protocol/tot/Schema) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/security
Package security provides Go bindings for the `Security` domain (https://chromedevtools.github.io/devtools-protocol/tot/Security) in the Chrome DevTools Protocol (CDP), version 1.3.
Package security provides Go bindings for the `Security` domain (https://chromedevtools.github.io/devtools-protocol/tot/Security) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/serviceworker
Package serviceworker provides Go bindings for the `ServiceWorker` domain (https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker) in the Chrome DevTools Protocol (CDP), version 1.3.
Package serviceworker provides Go bindings for the `ServiceWorker` domain (https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/storage
Package storage provides Go bindings for the `Storage` domain (https://chromedevtools.github.io/devtools-protocol/tot/Storage) in the Chrome DevTools Protocol (CDP), version 1.3.
Package storage provides Go bindings for the `Storage` domain (https://chromedevtools.github.io/devtools-protocol/tot/Storage) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/systeminfo
Package systeminfo provides Go bindings for the `SystemInfo` domain (https://chromedevtools.github.io/devtools-protocol/tot/SystemInfo) in the Chrome DevTools Protocol (CDP), version 1.3.
Package systeminfo provides Go bindings for the `SystemInfo` domain (https://chromedevtools.github.io/devtools-protocol/tot/SystemInfo) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/target
Package target provides Go bindings for the `Target` domain (https://chromedevtools.github.io/devtools-protocol/tot/Target) in the Chrome DevTools Protocol (CDP), version 1.3.
Package target provides Go bindings for the `Target` domain (https://chromedevtools.github.io/devtools-protocol/tot/Target) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/tethering
Package tethering provides Go bindings for the `Tethering` domain (https://chromedevtools.github.io/devtools-protocol/tot/Tethering) in the Chrome DevTools Protocol (CDP), version 1.3.
Package tethering provides Go bindings for the `Tethering` domain (https://chromedevtools.github.io/devtools-protocol/tot/Tethering) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/tracing
Package tracing provides Go bindings for the `Tracing` domain (https://chromedevtools.github.io/devtools-protocol/tot/Tracing) in the Chrome DevTools Protocol (CDP), version 1.3.
Package tracing provides Go bindings for the `Tracing` domain (https://chromedevtools.github.io/devtools-protocol/tot/Tracing) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/webaudio
Package webaudio provides Go bindings for the `WebAudio` domain (https://chromedevtools.github.io/devtools-protocol/tot/WebAudio) in the Chrome DevTools Protocol (CDP), version 1.3.
Package webaudio provides Go bindings for the `WebAudio` domain (https://chromedevtools.github.io/devtools-protocol/tot/WebAudio) in the Chrome DevTools Protocol (CDP), version 1.3.
devtools/webauthn
Package webauthn provides Go bindings for the `WebAuthn` domain (https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn) in the Chrome DevTools Protocol (CDP), version 1.3.
Package webauthn provides Go bindings for the `WebAuthn` domain (https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn) in the Chrome DevTools Protocol (CDP), version 1.3.
websocket
Package websocket is a lightweight client implementation of the WebSocket protocol (RFC 6455).
Package websocket is a lightweight client implementation of the WebSocket protocol (RFC 6455).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL