Instead of downloading PDF, how to force PDF to open/view in browser only?

I managed to write a small plugin for this purpose:

https://github.com/thoka/discourse-send-pdf-inline