Downloads
Every file a site sends as a download lands in that browser’s downloads: a link to a file, a form whose answer is a file, a file a page makes itself, or an address that is a file. The step that started the download says so in its result, with the file’s name. The agent has five tools for them:list_downloadslists the files with theirid(dl_…), name, size, type, site,started,finishedand state (downloading,done,failedorcanceled).wait_for_downloadwaits for a download to finish, up to 40 seconds a call.read_downloadreads a text file (plain text, CSV, JSON, XML and the like) up to 2 MB, or a PDF’s text.delete_downloaddeletes a file. It can’t be brought back.save_page_as_pdfsaves the page in a tab as a PDF, as printing to PDF would.
file_upload in downloads, so the file’s contents never pass through the agent.
You see the files in the browser’s panel in the console, under Downloads, with Save (to your device) and Delete. The list and Save work while the browser sleeps. In the live view a notice says when a download starts and finishes.
Nothing the browser downloads is opened or run on the server. A site’s suggested file name is cleaned before it is shown, and on disk the file is stored under its id.
Limits
Downloads count toward the browser’s disk space, and they aren’t part of the profile backups.
Printing
The browser has no printer, so a page’s Print button andwindow.print() do nothing by themselves. When a page asks to print, the agent’s result says so and suggests save_page_as_pdf, and the person watching is offered Save page as PDF. Use it for receipts, tickets, invoices and confirmations.
save_page_as_pdf takes a file name, landscape, and paper (letter or a4) for pages that set no size. In the console, Save as PDF is at the foot of the browser panel’s site block.
Reading a PDF in a tab
When a tab shows a PDF,get_page_text returns the document’s title and text, each page marked [Page N]. Pass pages, such as "3", "3-7" or "8-", to read part of it. read_page and find read the PDF’s text too, and computer scrolls it.
The text comes from the copy of the file Chrome already has. If Chrome no longer has it, refetch: true downloads it again from the site with one GET and the tab’s cookies. Don’t use it for a PDF that answered a form or came from a one-time link.
A PDF is read up to 32 MB, 500 pages and 100,000 characters a call. Scanned pages with no text layer come back empty: take a computer screenshot instead.