# Browser

The desktop app has a built-in browser. A browser is a pane like a terminal,
so it opens in a tab or a split, and its page keeps running while hidden.

## Open a page

- **File → New Browser Tab** (`Ctrl+Alt+B`), the globe button in the tab strip,
  or the command palette.
- `nana browser open <url>` from a terminal. See [Nana CLI](https://nana.areshk.dev/docs/features/nana-cli.md#browser-control).
- Ctrl-click a link in a terminal, when **Settings → Browser → Open terminal
  links in the browser** is on.
- A page that opens a new window gets a new tab instead.

Type an address or a search in the address bar. Matching history shows below
it. Links to other apps, such as `mailto:`, open in those apps.

## In a page

| Action | Shortcut |
| --- | --- |
| Address bar | `Ctrl+L` |
| Reload | `Ctrl+R` |
| Back / forward | `Alt+Left` / `Alt+Right` |
| Find on page | `Ctrl+Shift+F` |
| Zoom in / out / reset | `Ctrl+=` / `Ctrl+-` / `Ctrl+0` |
| Copy the page's address | `Ctrl+Shift+C` |
| Web Inspector | `Ctrl+Shift+I` |

The toolbar also opens the page in another browser and switches the tab's
profile.

## Profiles

Each profile keeps its own cookies, site data, history, and logins. New tabs use
the default profile. Manage profiles in **Settings → Browser**, where you can
also import history, bookmarks, and cookies from another browser on this
computer.

## Saved and not saved

A browser tab remembers its address and profile across restarts. Its title,
zoom, and back/forward history start fresh.

## Turning it off

Turn off **Settings → Browser → Enable built-in browser** to disable browser
tabs and `nana browser`. Terminal links then open in your system browser.

## Engine

The browser uses Microsoft Edge WebView2. Windows 11 normally includes its
Evergreen Runtime; if it is missing, install it from
[Microsoft](https://developer.microsoft.com/microsoft-edge/webview2/).
Nana still starts without it and reports why the browser is unavailable.

The page uses an owned native window aligned with its pane, drawn and driven by
the runtime. It follows window moves and resizes and
takes the pointer, keyboard, and clipboard itself, keeping its own context menu.
Because the app cannot draw over a native window, app content that
covers the pane — an open menu, a dialog, a drag in progress — is shown over the
page's last still. Keys Nana keeps, such as `Ctrl+R` and
`Ctrl+Shift+I`, come back to the app; the rest go to the page. Right-clicking a
page shows the runtime's own menu, which offers **Inspect** in the same builds
that keep the Web Inspector.

A profile's cookies and site data live in a folder of their own under the
browser profiles directory, so profiles stay separate: **Settings → Browser** can clear one profile's site data
through the runtime, and deleting a profile closes it and removes its folder.
Importing history and bookmarks works from the installed Chromium-family
browsers and Firefox. Cookies can be imported from Firefox; Chromium cookies are
encrypted per user and per application on Windows, so they are not read.