diff --git a/web/base_viewer.js b/web/base_viewer.js index 993c869c7..757d65d12 100644 --- a/web/base_viewer.js +++ b/web/base_viewer.js @@ -207,6 +207,8 @@ class BaseViewer { #scrollModePageState = null; + #onVisibilityChange = null; + /** * @param {PDFViewerOptions} options */ @@ -533,17 +535,42 @@ class BaseViewer { // `this._onePageRenderedCapability` thus won't be resolved. // To ensure that automatic printing, on document load, still works even in // those cases we force-allow fetching of all pages when: + // - The current window/tab is inactive, which will prevent rendering since + // `requestAnimationFrame` is being used; fixes bug 1746213. // - The viewer is hidden in the DOM, e.g. in a `display: none`