Clipboard on http: copy and paste work without the Clipboard API
Over plain http on a tailnet address the page is not a secure context and
navigator.clipboard is undefined, so the web engine refused every copy.
ClipboardReportingMessenger now answers clipboard calls through the
browser's legacy clipboard when the API is missing (web only, conditional
import): copy uses execCommand('copy') with a one-shot copy-event listener
(no focus or selection change); a paste key's Clipboard.getData takes the
browser's own paste event, the key reported not-handled so the browser
still fires it. A Paste button/menu says to use Ctrl+V or the https address.
Secure pages keep the engine path. Capture kit: --insecure and clipboard=.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,11 @@ assistive technology: only point targets (`x,y`) work, and the web's text input
|
||||
is Flutter's own hidden field, which reports IME composition (with semantics on,
|
||||
a text field's input is its semantics element, which does not).
|
||||
|
||||
`--insecure true` opens the build at `http://pipelines-insecure.test:<port>`
|
||||
(Chrome maps that name to the loopback server), so the page is not a secure
|
||||
context and has no Clipboard API, as the app over plain http on a LAN or
|
||||
tailnet address (`examples/clipboard-insecure-*.json`).
|
||||
|
||||
`--user-agent '<ua>'` overrides the browser's user agent before loading, so an
|
||||
Android phone's (with `--touch true`) makes Flutter's `defaultTargetPlatform`
|
||||
Android, for touch-only UI such as the terminal's key row.
|
||||
@@ -74,6 +79,7 @@ In JSON, a step can also set `wait` (ms), `timeout`, `name`, `ms` and `frames`.
|
||||
| `wait=ms` | sleep |
|
||||
| `keys=[...]` | raw key events (JSON `Input.dispatchKeyEvent` params, each with an optional `after` ms), e.g. modifier flags without their key events as a compositor's injected shortcut sends them (`examples/clipboard-*.json`) |
|
||||
| `grant=clipboard` | let the page read and write the clipboard (`navigator.clipboard` in `eval`) |
|
||||
| `clipboard=read[:label]` / `clipboard=write:<text>` | read or write the browser's clipboard from a scratch page on the loopback origin (a secure context), then bring the page back; JSON `expect` fails the run unless the read text matches. Works for an `--insecure` page, which has no `navigator.clipboard` |
|
||||
| `files=a.ttf[,b.ttf]` | answer the next file chooser the page opens with these files (paths relative to the working directory); put it before the click that opens the picker |
|
||||
| `swipe=<target>>dx,dy` | one-finger touch swipe (needs `--touch true`, which emulates a touch screen once semantics is on) |
|
||||
| `pinch=<target>>scale` | two-finger touch pinch, spreading (>1) or closing (<1) (needs `--touch true`) |
|
||||
|
||||
Reference in New Issue
Block a user