Install the extension first, and then right click on the following links to see it in action:

Link to a PDF File

Link to a Word (docx) File

Link to a JavaScript (JS) file

 

Choose extension's option "Open with Google Drive Viewer" as shown below. Read More about the extension on its home page.