Open azephiris opened 6 years ago
@robotboy655 Will this ever be addressed? I don't see why .html
, .css
and .js
are still not allowed in the AddonWhitelist. This hampers my ability to create snappy and modern user interfaces with DHTML.
snappy and modern user interfaces are perfectly possible with vgui, in fact its exceptional at it and you don't need the workshop for this, SetHTML can take any string you like! Try webdl to /data/
Plus writing entire UI's using DHTML is questionable considering chromium isn't merged.
snappy and modern user interfaces are perfectly possible with vgui, in fact its exceptional at it and you don't need the workshop for this, SetHTML can take any string you like! Try webdl to /data/
Plus writing entire UI's using DHTML is questionable considering chromium isn't merged.
Thank you for your rebuttal. I'm working on an unorthodox addon (one that primarily relies on chromium branch + binary modules), so this isn't necessarily going to the workshop. My issue is that I distribute the addon side of things using the GMA format since it provides easier deployment on users' installations and compresses well.
Therefore, I'm able to write entire UIs in DHTML (and my users will also see it identically). So, sure that makes my addon specifically fall into an unusual category--but this request is so simple and has been requested for years. I don't think that it'd hurt to fix this properly. (Plus, modern chromium has stuff like module scripts which are currently broken due to a MIME type mismatch because you need to use a different extension to package your addon)
Then adding these to the wl sounds good to me!
@robotboy655 Will this ever be addressed? I don't see why
.html
,.css
and.js
are still not allowed in the AddonWhitelist. This hampers my ability to create snappy and modern user interfaces with DHTML.
To workaround this myself, I did the following
SetHTML
to set the panel's HTML contents to that variable-- In your addon's initiation code
myHTMLChunks = {} -- Give it a unique name
-- HTML file 1.lua
table.insert(myHTMLChunks, [===[<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
...===])
-- HTML file 2.lua
table.insert(myHTMLChunks, [===...===])
-- Continue for as many HTML files as you need
-- After loading all of the HTML files
combinedHTML = table.concat(myHTMLChunks) -- Give it a unique name
-- When your UI needs to render
myPanel:SetHTML(combinedHTML)
I have a complete example on an older project of mine- https://github.com/BadgerCode/emojichat/tree/master
You still dont get the benefits like autocomplete and syntax highlighting without copy/pasting it from a file of those types, much better to just do it with files
@robotboy655 Any updates? Still waiting for an official response....
As said on the forums, some servers and non-workshop addons like Starfall use resource.AddFile to send the JS Ace Editor / HUD GUIs to clients.
I don't see any security flaw as we can already open any URLs in a HTML panel, and allowing these files extensions would be benefic with the upcoming Chromium update.