WASM with DOM support will be great. Unfortunately it will also be great for obfuscation and malware.
Since WebAssembly instructions are much easier to reason about, you could probably auto-optimize away a lot of the obfuscation, like "this is a silly way to do X, so we can just do X directly".