diff --git a/resources/browserhtml/system/web_view.js b/resources/browserhtml/system/web_view.js index 1e3bf64..356fe9b 100644 --- a/resources/browserhtml/system/web_view.js +++ b/resources/browserhtml/system/web_view.js @@ -799,6 +799,17 @@ export class WebView extends LitElement { this.captureScreenshot(); } + updated(_changedProperties) { + if (this.active) { + if (this.rafHandle) { + cancelAnimationFrame(this.rafHandle); + } + this.rafHandle = requestAnimationFrame(() => + this.captureScreenshot(true), + ); + } + } + // Capture a screenshot and cache it for overview mode captureScreenshot(immediate = false) { // Debounce: clear any pending capture @@ -831,7 +842,7 @@ export class WebView extends LitElement { // Delay capture to allow page to render this.screenshotTimeout = setTimeout(() => { doCapture(); - }, 500); + }, 400); } onfocus() {