That's quite different than restricting the execution of code that you've decided to trust. Control over a given domain name, a given server, or a given http response payload, is perpetually up for grabs in ways that just don't apply to software packages whose contents are identified by cryptographic hash.
The attack surface for code served over the web at runtime is unnecessarily large, even if you've allow-listed the originating domain name. Also, it puts too much power in the hands of whoever controls that name, and power corrupts. People who are trustworthy today, will start selling their users out tomorrow.
The attack surface for code served over the web at runtime is unnecessarily large, even if you've allow-listed the originating domain name. Also, it puts too much power in the hands of whoever controls that name, and power corrupts. People who are trustworthy today, will start selling their users out tomorrow.