Send a rendering of the whole page with a capture, where the server keeps one #2
Labels
No labels
bug
documentation
enhancement
performance
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-chromium#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Postulo can now keep the page a capture was read from (postulo/postulo#256, landed as 1527130dd): the source, and a rendering, a picture of the whole page. The server can draw a rendering from the kept source, but only the words, laid out with scripts and the network off. What only the browser can make is the page as the person was seeing it, signed in or behind bot protection. This issue is that half.
What the server already does with what the extension sends
htmltoPOST /api/v1/captures, and it is kept wherever the instance and the account both keep sources (both off by default). To not keep it for one capture, add"keep": {"source": false}.keephas no other member and cannot switch keeping on.page, in the201ofPOST /capturesand on each row ofGET /captures:source,rendering,rendering_type,accepts_rendering,rendering_url,rendering_types,rendering_max_bytes,note.What the extension should do
page. Ifaccepts_renderingis false, orpageis missing (an older server), send nothing more.rendering_types(image/png,image/jpeg,image/webp,application/pdf), no larger thanrendering_max_bytes. Ask before drawing, so nothing is drawn only to be refused.PUTit torendering_urlwith the same bearer token (capturesscope): the raw bytes as the body,Content-Typeset to its type, and aContent-Length. Not JSON, not a form.201200409#not-keptreasonisswitched-off,decided,already-keptorno-room: do not retry413#too-largemax_bytes; said before the body was read415#unsupported-media-typeaccepted411Content-Length422401/403/429Decisions for this repository
chrome.tabs.captureVisibleTabgives the viewport only. The whole page means scrolling and stitching (which moves the page under the person and misdraws fixed headers), or the DevTools protocol'sPage.captureScreenshotwithcaptureBeyondViewportthrough thedebuggerpermission, which shows a warning bar and is a permission worth refusing. Firefox'stabs.captureTabtakes arectin page coordinates. Each browser may need its own answer; the Firefox package is assembled from this one (postulo/postulo-firefox).rendering_max_bytes(10 MB by default). JPEG or WebP at a stated quality, or a downscale, before sending; never send whatrendering_max_bytesrefuses.accepts_renderingis true, but the popup should still say that a picture is being sent, and offer to skip it for this capture.Done when
Landed (
5c7743d) except what needs a browser:src/lib/picture.jsdraws the whole page (captureTabwith a rect on Firefox; scrolling and stitching on Chromium, nodebuggerpermission) and the person is asked before it is sent. Never run for real, so the first Done when (a rendering visible on the server) is unconfirmed. See the manual-check issue.