Isn't that exactly what browser PDF viewers (e.g. PDF.js [0]) already do?
On android I have to use a firefox fork called iceraven to be able to install pdf.js extension to use mozilla's own pdf.js to load pdf's in my tabs. Afaik, there's no other way to do it.