There are extensions that open such files. These extensions do mainly syntax highlighting like:
https://chrome.google.com/webstore/detail/cgjalgdhmbpaacnnej...
https://chrome.google.com/webstore/detail/epmaefhielclhlnmjo... (offers some more features but does not work when AdBlock is enabled)
So opening instead of downloading is possible by using an extension. Perhaps an extension already exists which does that without any other features.