Display PDF using the browser's PDF viewer rather than GitLab's
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Collaborate/take over this issue](https://contributors.gitlab.com/manage-issue?action=work&projectId=278964&issueIid=434513) </details> <!--IssueSummary end--> # Problem When one puts a PDF file into a Git repository, and opens that page, then Gitlab renders a preview of that PDF. However that preview is way inferior to having the same PDF displayed in the browser directly -- it doesn't even support copying text. It should be possible somehow to display the PDF using the browser's PDF viewer rather than Gitlab's. I know I can click the "download" button, but that will, well, download the PDF. I don't want to download it. That just creates some junk files it my Downloads folder that I have to clean up manually later. I just want to display it online, using the browser's PDF viewer. # Design recommendation See https://gitlab.com/gitlab-org/gitlab/-/issues/434513#note_2819139173. Put an "Open in a new window" button next to the download button. This allows users to stay within the application and keep the context of the blob page, while also giving a path to quickly view the file in their browser if desired. <table> <tr> <th>Current</th> <th>Proposed</th> </tr> <tr> <td> ![current.jpg](/uploads/d2db5637c332fd35ad7ac92f26735381/current.jpg) </td> <td> ![update - file - pdf.jpg](/uploads/ff2f0984fb5b0ecb45496795667c8b61/update_-_file_-_pdf.jpg) * Add "Open in a new window" button next to the download button in the blob page for PDF files * When the button is clicked, the PDF will open in a new window using the browser's default PDF viewer. * Button hover text: `Open in a new window` </td> </tr> </table> # Implementation plan Add a new button in `app/assets/javascripts/blob/components/blob_header_default_actions.vue`. Button should have aria-label and hover tooltip. URL should have [`download` property](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/download) explicitly set to `false` to have the link open in new window.
issue