noVNC
noVNC copied to clipboard
Resize the browser to match VNC session
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
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?
Used to open the QEMU/KVM console in a new browser window, yes, QEMU/KVM will constantly change the resolution when it is launched
I'm connected to the VNC port of KVM/QEMU via websockify
@XiaoXianNv-boot, are you interested in looking at the suggested changes?
@XiaoXianNv-boot, are you interested in looking at the suggested changes?
YES
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.
- VNC session is 1024x768, local window is 1024x768. VNC session resizes to 1920x1080, and the local window tries to resize to the same 1920x1080.
- 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
- The first adjustment size after setting this mode
- 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)
It looks like this was closed accidentally, @XiaoXianNv-boot?
看起来这是意外关闭的,?
YES