Skip to content

Build your personal knowledge base with Trilium Notes

feat(clipper): raise the full-page screenshot limit to 100 captures

Elian Doranc53cb61c26ee
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Web Clipper.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Web Clipper.html
index 389035dc77..ae909bf9be 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Web Clipper.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Web Clipper.html
@@ -108,8 +108,8 @@
scrolling (such as cookie banners and chat buttons) are left out, while
a background that fills the whole window repeats on every screen. A long
page is saved as several images, one below the other in the note. A page
- longer than 50 screens is cut off there, and the message after saving says
- so.</p>
+ longer than 100 screens is cut off there, and the message after saving
+ says so.</p>
</li>
<li>
<p>If the current page was already clipped, a notice at the top offers to
diff --git a/apps/web-clipper/entrypoints/background/index.spec.ts b/apps/web-clipper/entrypoints/background/index.spec.ts
index 8a10008f98..9728f9b5b9 100644
--- a/apps/web-clipper/entrypoints/background/index.spec.ts
+++ b/apps/web-clipper/entrypoints/background/index.spec.ts
@@ -602,10 +602,10 @@ describe("background", () => {
vi.useFakeTimers({ toFake: [ "setTimeout", "Date" ] });
offscreen.slices = [];
- simulatePage({ viewportHeight: 2000, pageHeight: 100001, devicePixelRatio: 4 });
+ simulatePage({ viewportHeight: 2000, pageHeight: 200001, devicePixelRatio: 4 });
await run(sendRuntimeMessage({ name: "save-full-page-screenshot" }));
- expect(offscreen.request).toEqual({ pageHeight: 100000, devicePixelRatio: 4 });
- expect(sliceTops()).toEqual(Array.from({ length: 50 }, (_, index) => index * 2000));
+ expect(offscreen.request).toEqual({ pageHeight: 200000, devicePixelRatio: 4 });
+ expect(sliceTops()).toEqual(Array.from({ length: 100 }, (_, index) => index * 2000));
expect(await lastToast()).toMatchObject({
message: "Screenshot has been saved to Trilium, but the page was too long to capture in full."
});
diff --git a/apps/web-clipper/entrypoints/background/index.ts b/apps/web-clipper/entrypoints/background/index.ts
index 4b9f8d5c1e..ffc4fc5693 100644
--- a/apps/web-clipper/entrypoints/background/index.ts
+++ b/apps/web-clipper/entrypoints/background/index.ts
@@ -50,8 +50,8 @@ interface Stitcher {
const CAPTURE_INTERVAL_MS = 550;
/** How long a scrolled page gets to draw what came into view before it is captured. */
const SCROLL_SETTLE_MS = 150;
-/** The most captures a full-page screenshot takes, about 30 seconds; a longer page is cut off. */
-const MAX_SCREENSHOT_CAPTURES = 50;
+/** The most captures a full-page screenshot takes, about a minute; a longer page is cut off. */
+const MAX_SCREENSHOT_CAPTURES = 100;
/** An image of a clipping; `content` references it by `imageId` until Trilium stores it. */
type ClippedImage = { imageId: string, src: string, dataUrl?: string };
diff --git a/docs/User Guide/User Guide/Installation & Setup/Web Clipper.md b/docs/User Guide/User Guide/Installation & Setup/Web Clipper.md
index 1ead1a158d..1dc13028a1 100644
--- a/docs/User Guide/User Guide/Installation & Setup/Web Clipper.md
+++ b/docs/User Guide/User Guide/Installation & Setup/Web Clipper.md
@@ -42,7 +42,7 @@ Clicking the extension's button in the browser toolbar opens its popup:
The popup opens on the selection if there is one, otherwise on _Page_, showing the article, or the whole page when the page has no article. On a page that shows nothing to save, it opens on _Bookmark_ and says so. The keyboard shortcuts and the context menu still save right away, without a preview: saving the whole page that way saves the article, or the whole page when the page has no article.
* Pages the extension cannot access (the browser's own pages, the extension stores, and pages that were open before the extension was installed until they are reloaded) cannot be saved or captured, so the popup says so in place of the preview, and only _Tabs_ remains available there.
* Below the preview, a row of buttons offers the other actions: _Crop_ (a screenshot of an area you select), _Screenshot_ (of the visible part of the page), _Full page_ (a screenshot of the whole page) and _Tabs_ (saves the links of every tab in the current window as a list of <a class="reference-link" href="../Note%20Types/Text/Link%20Previews.md">Link Previews</a>, or of plain links when _Autogenerate link previews_ is turned off). Hovering over a button shows its full name and, if it has one, its keyboard shortcut.
-* _Full page_ scrolls through the page, takes a screenshot of each part and joins them into one image, then scrolls back to where the page was. The scrollbars are hidden while it does, so they do not appear in the image. Stay on the tab until it is saved: switching to another tab stops the screenshot. A header that stays at the top of the window appears once, at the top of the image, and headings that stick while scrolling appear where they are in the page. Other elements that stay in place while scrolling (such as cookie banners and chat buttons) are left out, while a background that fills the whole window repeats on every screen. A long page is saved as several images, one below the other in the note. A page longer than 50 screens is cut off there, and the message after saving says so.
+* _Full page_ scrolls through the page, takes a screenshot of each part and joins them into one image, then scrolls back to where the page was. The scrollbars are hidden while it does, so they do not appear in the image. Stay on the tab until it is saved: switching to another tab stops the screenshot. A header that stays at the top of the window appears once, at the top of the image, and headings that stick while scrolling appear where they are in the page. Other elements that stay in place while scrolling (such as cookie banners and chat buttons) are left out, while a background that fills the whole window repeats on every screen. A long page is saved as several images, one below the other in the note. A page longer than 100 screens is cut off there, and the message after saving says so.
* If the current page was already clipped, a notice at the top offers to open the note in Trilium.
* If Trilium cannot be found, the popup explains why instead of showing the actions, with buttons to look for Trilium again and to open the options.
* The bottom of the popup shows whether the extension is connected to Trilium, as a colored dot (green when connected, amber when the versions are not compatible, red when Trilium was not found) next to a description of the connection, followed by the buttons for the extension's options and for this help page. A button to check the connection again appears next to them when hovering over the bar, and stays visible while Trilium cannot be reached or is not compatible.