ipfs.io is a gateway, fetching the content from the IPFS network and serving it to you over HTTP.
Does the "deliverying JS to browser" thing that I described make sense at all?
[1] https://github.com/ipfs/js-ipfs
[2] https://github.com/ipfs-shipyard/ipfs-companion
[3] https://github.com/ipfs-shipyard/ipfs-companion/blob/master/...