Home

[Feature] Util.HTMLHead.AddScriptFromUri and Util.HTMLHead.AddScript should support type=module

i.e. to enable scripts like this:

<script type="module">
    import {a} from "./module.js";
    alert(a);
</script>

as it is now you have to roll your own injection of script element to get that

Note I tried:

var serverType = typeof(Util).Assembly.GetType("LINQPad.ExecutionModel.Server");
var server = serverType.GetProperty("CurrentServer").GetValue(null);
server.Uncapsulate().InjectHtmlHeader($"<script type='module' src='{uri}'></script>\r\n");

but it seems to ignore the type attributes
so I had to write a javascript that added the script element to header

Comments

Sign In or Register to comment.