It is free software and specific use example. In those examples I cannot see anything bad.
You show one example, when the majority do not follow that example. It is the overal practise of how "web applications" work that is the problem, not unicorn instances that just happen to be OK. Javascript and Webassembly (or maybe more specifically, web browsers) facilitate the issue but running unknown code so trivially from someone else. I am sure we could find examples of where DRM can be put to good use...