Closed arjitc closed 1 month ago
No, the only way is to either alter the javascript or to use fragment or query parameters.
I think there might be ways we can make this easier and more obvious. We want people to be able to customise things after all.
E.g. instead of just having <script src="app/ui.js">
like we do now, we could do:
<script type="module">
import UI from "./app/ui.js";
// Change this to force specific settings
// UI.forceSetting('host', 'server.example.com');
UI.start();
</script>
Hi, @CendioOssman -- yes, your example would be perfect!
The vnc_lite is very easy to implement but the features lack a lot, while vnc.html has a lot of features, better UI and more work put into it by the noVNC team as well! This would help to make the implementation into other projects very easy as well.
You can already pass the host/port/etc can be set from the fragment or query string.
The password would be not-too-good security-wise to allow it to be picked from the fragment (although it would be trivial to implement). But it can be very easily set by simply adding UI.setPassword('<MY_PASSWORD>')
right after UI.start();
.
So what's actually missing here?
So just to clarify -- would this be possible (it was possible in the old version),
host = WebUtil.getConfigVar('host', '<?php echo $vnc_host; ?>');
port = WebUtil.getConfigVar('port', '<?php echo $vnc_port; ?>');
password = WebUtil.getConfigVar('password', '<?php echo vnc_password; ?>');
In the old version, these 3 values were set via PHP on our end and it would just auto-connect upon the page loading.
Not easily right now, no.
Ah -- would be nice to have it that way, I think(?) currently, the parameters can be passed in the URL, but then that saves in the browser history etc which isn't ideal, the other way at least via PHP/Sessions, you can control / wipe the variable values if the user isn't authenticated etc.
@CendioOssman -- Just saw the pull-request for this feature, thank you! :)
btw Internet Explorer is EOL in 2021, might be worth making this a optional feature/branch for now which can be enabled right away? :)
Oh? That would be a welcome EOL. :)
Do you have any official reference from Microsoft that we can use?
Unfortunately I don't see a good way of making this optional, so we'll likely have to wait until we can ignore IE. :/
So I found the announcement:
In short, Internet Explorer is not getting EOL:d anytime soon. However Microsoft will not be supporting it for new web pages, instead considering it a tool for legacy sites.
So I think that is good enough for us to move forward with dropping IE support.
So I think that is good enough for us to move forward with dropping IE support.
It will be a glorious day
Is there anyway to pre-load / load the information (host, port, password) into the vnc.html page via PHP ?
This is possible with the vnc_light.html file but seems quite tricky with the vnc.html as it loads all the information from ui.js
Thanks!