43 ms·
Great functionality, terrible name.
by AlienRobot 1y ago
Great functionality, terrible name.
- varun_ch 1y agoI sometimes wonder whether what the DOM APIs could look like in a hypothetical world where we could start over with everything.
- hexasquid 1y agoIt looks like this isn't a standard yet.
- jonathrg 1y agoWhy? Does it not set the HTML?
- netsharc 1y agoIt doesn't say "There's a lot of hidden sanitizing stuff inside this method" from the name... Something like "setSafeHTML()" would be preferable. (Since it's Mozilla, there should be a few committee meetings to come up with the appropriate name)...
- hoppp 1y agoWell ,could it be safelySetHTML instead of setSafeHTML ? The second one could imply the HTML is already safe while the first one is safe way to set html. If it's just setHTML then it could imply that don't care if its safe or not.
- AlienRobot 1y agoThere is already an innerHTML property for elements. This doesn't set the outer HTML, so it's literally setInnerHTML2.
- hexasquid 1y agoAfter a minute of digging, found discussion here: https://github.com/WICG/sanitizer-api/issues/100 https://github.com/WICG/sanitizer-api/issues/100 Perhaps it can be reopened (or a new issue can be opened) regarding naming.
- ajkjk 1y agoThe name seems ideal to me.