Member Junction
    Preparing search index...
    • Captures an element to a JPEG for an agent to see. Iframes, cross-origin images without CORS and tainted canvases come out blank or fail; the caller tells the agent so.

      Parameters

      • element: HTMLElement
      • options: ElementCaptureOptions = {}
      • capture: CaptureFn = toJpeg

        The renderer. The default is html-to-image toJpeg; tests pass a fake.

      Returns Promise<ElementCapture>

      Error when the element has no size or more than maxNodes DOM nodes, when the capture takes longer than timeoutMs, and when the capture fails or returns no image data.