6 ms·
This is great, but maybe you can add a sandbox to that iframe you use for displaying? Nothing to do with security, just that people copy pasting snippets can ac
by egeozcan 2y ago
This is great, but maybe you can add a sandbox to that iframe you use for displaying? Nothing to do with security, just that people copy pasting snippets can actually lock the page up with broken scripts. I speak from experience :)
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox https://developer.mozilla.org/en-US/docs/Web/HTML/Element/if...
- mg 2y agoA sandbox could be an interesting idea. Especially as a dropdown with options what should be blocked. I am not sure if anything should be blocked by default, because that could always end in frustration when something that should work does not for mysterious reasons. But it might make a good default to block all external requests when the editor gets a feature to link to code directly. Like ...html_editor/?code=<!doctype html><html>... Then it could display an info box like "Initial code was loaded from your link and the sandbox was activated. Use the Sandbox menu to enable more features the code can use" There was a bit of a discussion about this on HN two months ago here: https://news.ycombinator.com/item?id=42448964 https://news.ycombinator.com/item?id=42448964 The editor is open source, so if you like, you can add the features you have in mind: https://github.com/no-gravity/html_editor https://github.com/no-gravity/html_editor