2.9.16
Coherent GT
A modern user interface library for games
Disable Javascript

Sometimes you might want to make your UI customizable by the players, so you would let them add MOD files. In those cases, you would want to prevent malicious scripts from running. To be sure that the files are safe you can disable or restrict the execution of JavaScript code. In order to prevent abuse from players we suggest:

  • Running files added by the player in an <iframe> that is in sandbox mode like so:
<iframe src="PlayerMadeContent.html" title="iframe example 1" width="400" height="300" sandbox>
</iframe>

The script above can be called by either Coherent::UIGT::View::ExecuteScript or by directly adding it to the user made pages.