Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes elm/html#246 together with elm/html#281.
Simpler alternative to #190. That PR allows
srcdocbut disallows script execution via careful management ofsandbox. That’s quite complicated, while this PR is very simple. It turns out that a GitHub search immediately reveals people (ab)usingsrcdocto execute scripts, so that carefulsandboxhandling isn’t backwards compatible for them anyway. I asked on Slack on how people usesrcdoc:In all cases it’s possible to wrap the iframe in a web component to achieve the same thing. So it’s fairly easy to migrate.
All that makes it seem like it’s more worth keeping things simple and disallow
srcdoc. Instead of silently disallowing script tags (silently breaking people’s code), we show a warning with a link to documentation on how to use a web component instead – see elm/html#281.Demo/tests: