Open jridgewell opened 5 years ago
This looks like a good addition for the safe mode.
Safe mode/DOMPurify won't allow injection of script tags that execute code anyways, so this is only relevant to the "unsafe" mode.
Tangent: Should we rename "safe" mode to "AMP" mode?
After https://github.com/ampproject/worker-dom/issues/283, we should fix the thread mutation sync so that script elements don't execute on the main thread:
When we do this, we should also ensure that regularly created script elements do execute:
One way to do this would be to add a
_disabled
flag to the node. When using innerHTML,script._disabled = true
. When it's being recreated on the main thread, we can do the following:A script created like this will not be able to execute.