Make it easier for downstream to modify settings

Expose a simple and stable API to override default settings, and force
settings that users shouldn't be able to change.
This commit is contained in:
Pierre Ossman
2020-06-26 16:00:32 +02:00
parent 84897fd110
commit 438e5b3608
2 changed files with 53 additions and 12 deletions

View File

@@ -46,7 +46,27 @@
<link rel="preload" as="image" href="app/images/warning.svg">
<script type="module" crossorigin="anonymous" src="app/error-handler.js"></script>
<script type="module" crossorigin="anonymous" src="app/ui.js"></script>
<script type="module">
import UI from "./app/ui.js";
let defaults = {};
let mandatory = {};
// Override any defaults you need here:
//
// defaults['host'] = 'vnc.example.com';
// Or force a specific setting, preventing the user from
// changing it:
//
// mandatory['view_only'] = true;
// See docs/EMBEDDING.md for a list of possible settings.
UI.start({ settings: { defaults: defaults,
mandatory: mandatory } });
</script>
</head>
<body>