noVNC icon indicating copy to clipboard operation
noVNC copied to clipboard

Resize the browser to match VNC session

Open XiaoXianNv-boot opened this issue 10 months ago • 10 comments

I've added a new zoom mode that allows the browser to automatically adapt to the window . Just need to use window.open('vnc. html/?token=token&autoconnect=1&resize=browser','_blank','toolbar=no,location=no,status=no,menubar=no,resizable=yes,width=800,height=420'); Open a window Works fine on EDGE

XiaoXianNv-boot avatar Apr 11 '24 22:04 XiaoXianNv-boot

Thank you for your contribution!

I'm thinking this might be a bit too niche, though, since it only works under very specific circumstances. Could you describe your setup a bit more, and where this feature fits in?

CendioOssman avatar Apr 16 '24 07:04 CendioOssman

Used to open the QEMU/KVM console in a new browser window, yes, QEMU/KVM will constantly change the resolution when it is launched

XiaoXianNv-boot avatar Apr 17 '24 02:04 XiaoXianNv-boot

I'm connected to the VNC port of KVM/QEMU via websockify

XiaoXianNv-boot avatar Apr 17 '24 02:04 XiaoXianNv-boot

@XiaoXianNv-boot, are you interested in looking at the suggested changes?

CendioOssman avatar Aug 08 '24 11:08 CendioOssman

@XiaoXianNv-boot, are you interested in looking at the suggested changes?

YES

XiaoXianNv-boot avatar Aug 16 '24 12:08 XiaoXianNv-boot

Okay. That sounds reasonble. I'm cautious about adding niche stuff to the general UI, though.

In TigerVNC, we have a similar behaviour but without a setting. Perhaps that could be used here as well?

The principle there is that it will resize the local window if the sizes match before the resize, but not if they are different. I.e.

  1. VNC session is 1024x768, local window is 1024x768. VNC session resizes to 1920x1080, and the local window tries to resize to the same 1920x1080.
  2. VNC session is 1024x768, but local window is 800x600. VNC session resizes to 1920x1080, but the local window stays at 800x600.

I have added adjustment rules now. Meet automatic adjustment in the following circumstances

  1. The first adjustment size after setting this mode
  2. The size of the current browser window is the size of the previous adjustment

If the above requirements are not met, the size of the browser will be disabled. After adjusting to other modes, you can re -enable this mode (View Rules 1)

XiaoXianNv-boot avatar Aug 16 '24 15:08 XiaoXianNv-boot

It looks like this was closed accidentally, @XiaoXianNv-boot?

CendioOssman avatar Sep 05 '24 07:09 CendioOssman

看起来这是意外关闭的,?

YES

XiaoXianNv-boot avatar Sep 05 '24 16:09 XiaoXianNv-boot