diff --git a/src/lib/components/chat/ChatTabs/ChromeBrowser.svelte b/src/lib/components/chat/ChatTabs/ChromeBrowser.svelte index 48e26d7a29..0689fa2d72 100644 --- a/src/lib/components/chat/ChatTabs/ChromeBrowser.svelte +++ b/src/lib/components/chat/ChatTabs/ChromeBrowser.svelte @@ -25,6 +25,8 @@ let vncRetry: ReturnType; let width = 1024; let height = 768; + let displayWidth = width; + let displayHeight = height; let socket: WebSocket | null = null; let disposed = false; let retry: ReturnType; @@ -96,6 +98,9 @@ if (!bounds.width || !bounds.height) return; width = mobile ? 390 : Math.max(240, Math.round(bounds.width)); height = mobile ? 844 : Math.max(200, Math.round(bounds.height)); + const scale = Math.min(1, bounds.width / width, bounds.height / height); + displayWidth = width * scale; + displayHeight = height * scale; command('viewport', { width, height, mobile }); }; $: if (socket) command('visibility', { visible: active }); @@ -279,18 +284,27 @@ > {#if transport === 'vnc'}
- {:else if transport === 'frames'} - - {:else if frame}Browser page{/if} + {:else if transport === 'frames' || frame} + +
+ {#if transport === 'frames'} + + {:else} + Browser page + {/if} +
+ {/if}