# Why the debugger

Why a scan attaches Chrome's debugger to the tab, what the "started debugging this browser" bar means, and why it stays a few seconds after the scan.

While a scan runs, Chrome shows a bar across the top of the window:

```text
"Page Scanner" started debugging this browser
```

The bar is Chrome's, not Page Scanner's. Chrome shows it whenever an extension attaches its
debugger to a tab, with that extension's name in the quotes, and Page Scanner attaches it for one
reason: the debugger is the only way an extension can reach Chrome's own print-to-PDF, which is
what keeps the PDF's text real text rather than a picture of text.

## What the debugger is for

One attachment, one layout, two outputs. With the debugger attached, Page Scanner lays the page
out once at its full height and takes two things from that one layout: a screenshot, which is the
preview you crop in the editor, and Chrome's print-to-PDF, which is the file. Because both come
from the same layout, the crop you draw on the preview lands exactly on the PDF, and the text in
it stays selectable and searchable.

Without the debugger, an extension can only scroll the page a screen at a time and stitch the
screenshots together, which gives a picture of the text, not the text.

## How long the bar stays

Page Scanner attaches the debugger to the one tab you scan when the scan starts, and detaches it
the moment the scan is done. Chrome then keeps the bar up for about five more seconds before it
takes it away. That delay is Chrome's own rule; no extension can shorten it, and Chrome does not
tell an extension when the bar goes. It is why the bar is often still there as the editor opens.

While it is, the editor says so in a small card by its toolbar, which goes when the bar goes.
**Don't show again** on the card, or **Explain Chrome's debugging bar** in the
[settings'](https://docs.pagescanner.app/extension/settings) Editor section, turns the card off.

The bar's **Cancel** button detaches the debugger, which ends a scan that is still running. Scan
again when you want the capture.

## What it does not mean

Chrome's wording says "debugging this browser", and what happens is narrower than that. The
debugger is attached to the one tab you scanned, for the length of that scan, and nothing else.
Page Scanner asks for no host permissions, so it has no standing access to any site, and it does
not watch the pages you have not scanned. The capture is not uploaded anywhere: it is kept in the
extension's own storage in your browser so the editor can open it.

Everything the extension keeps and sends is in the [privacy policy](https://pagescanner.app/privacy/).

With [local agents](https://docs.pagescanner.app/extension/local-agents) connected, a program on your own computer can ask for
a scan too. The debugger is still attached only for each scan, and Chrome shows the same bar for
it.

## When the debugger cannot attach

Only one debugger can attach to a tab at a time, so with DevTools open on the tab Page Scanner
falls back to scrolling and stitching screenshots. The capture is then a picture: its PDF holds
no selectable text, and the Output Format panel says so. Close DevTools and scan again for a
capture whose text is text.

## Hiding the bar

No extension can hide it. Chrome has a command-line switch that does,
`--silent-debugger-extension-api`, which exists for automated test setups; Page Scanner does not
ask you to use it, and with it the editor has no bar to speak of and shows no card.
