> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gleap.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript SDK: Screenshots and recordings requested in conversations

> Let customers send screenshots and screen recordings of your website when a workflow, an AI agent or your team asks for them, with the Gleap JavaScript SDK.

When a workflow, an AI agent or a teammate asks a customer to show an issue, the widget shows a card with **Take screenshot** or **Record my screen**. On the customer's tap, the SDK hides the widget and shows a small bar on your page. It captures the page when the customer taps **Capture** or **Start**. Workflows, AI agents and teammates can also collect logs from the page without asking the customer.

How to ask, what the customer sees and what your team gets: [Screenshots, recordings and logs](/documentation/guides/screenshots-recordings-and-logs).

<Note>
  Needs the JavaScript SDK 19.1.0 or later. The code snippet always loads the latest version. Older versions show the card with **Upload a file** only.
</Note>

## How the page is captured

| Browser | Screenshot | Recording |
| - | - | - |
| Chrome, Edge and other Chromium browsers on desktop | The browser asks to share the tab, then the SDK captures its exact pixels. If the customer cancels, the SDK renders the page in the browser instead, without asking again. | A video. The browser asks what to share and offers the current tab first. |
| Firefox and Safari on desktop | The SDK renders the page in the browser. | A video. The browser asks which window or screen to share. |
| Browsers on phones and tablets | The SDK renders the page in the browser. | A page recording of the page's changes, not a video. Your team plays it in the replay player. |

* A screenshot shows the visible part of the page.
* To never show the browser's share prompt for screenshots, set **Web screenshots** to **Never show a browser prompt** in **Project settings → Developer options → Screenshots & recordings**.
* If screen sharing for a recording doesn't start in a desktop browser (the customer cancels, or it's blocked), the bar offers **Record this page** instead.
* When a link loads a new page, a running recording stops, and the bar comes back on the next page with **Record again**. Route changes in single-page apps don't stop a recording.
* When the request allows the microphone, desktop browsers show a microphone button in the recording bar.
* The SDK does nothing until a request arrives.

## Turn screenshots and recordings off

```javascript theme={null}
Gleap.setCaptureEnabled(false);
```

While it's off, the card only offers **Upload a file**, and a capture in progress ends. It's on by default. You can call it before or after `Gleap.initialize`, and pass `true` to turn it on again.

## Turn log requests off

```javascript theme={null}
Gleap.setRemoteLogCollectionEnabled(false);
```

Log requests from workflows, AI agents and your team are then answered as not supported, and screenshots and recordings are sent without logs. It's on by default, and you can call it before or after `Gleap.initialize`. While it's on, logs sent along with a screenshot or recording follow the **Attach logs** setting in the dashboard.

## Mask content

Screenshots and recordings leave out sensitive content:

* **Always masked**: password fields, and fields whose `autocomplete` attribute contains `current-password`, `new-password`, `one-time-code`, `cc-number` or `cc-csc`.
* **Masked**: elements with the class `gl-mask` or `rr-mask`, and fields with the attribute `gleap-ignore="value"`.
* **Hidden**: elements with the class `gl-block` or `rr-block`, and elements that match the CSS selectors under **Masked elements** in **Project settings → Developer options → Screenshots & recordings**.
* The privacy options you set with [`Gleap.setReplayOptions`](/documentation/javascript/replays#available-options) apply too: `blockClass`, `blockSelector`, `maskTextClass`, `maskTextSelector`, `maskAllInputs` and `maskInputOptions`.
* Card payment frames, for example from Stripe, Braintree, Adyen or PayPal, are blacked out in screenshots.

```html theme={null}
<div class="gl-mask">Account balance: 1,250.00</div>

<div class="gl-block">
  <img src="/avatar.png" alt="" />
</div>
```

In screenshots, masked and hidden elements are painted black. Page recordings mask every input value and the text of masked elements, record hidden elements as empty placeholders and leave out canvas elements. While a screen recording runs in a desktop browser, the same elements on your page are blurred, including those in same-origin frames and open shadow roots.

<Warning>
  A screen recording shows everything else the customer shares as it is: other tabs, windows or the whole screen, cross-origin frames (payment frames are blurred as a whole) and closed shadow roots.
</Warning>

Gleap's own UI, such as the widget, the feedback button and the capture bar, never appears in a capture.

## Content Security Policy

If your [Content Security Policy](/documentation/javascript/content-security-policy) restricts `media-src` (or `default-src` without a `media-src`), allow `blob:` so customers can watch the preview of their recording before they send it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.