I am writing from my Android. On my laptop, it's pretty simple to choose to open a PDF file directly in the browser rather than opening it in an external program.

The problem comes when I try to open it on Android. I am usually asked to download it and it will open with PDF Viewer. I would like it to open directly in Chrome because - moreover -- I'd like to get a link to the PDF file.

Usually, on Android, you can link the website and then the receiver will have to download the PDF so that he can view it. I would like to be readable directly in the browser.


3 Answers 3


You can use a Google Docs page to view PDF files in the browser. To do this, visit the page https://docs.google.com/viewerng/viewer?url=http://yourfile.pdf, where http://yourfile.pdf is the path to the PDF file you want to view (credits to this answer).

Unfortunately, there is as far as I know no way to do this automatically in Chrome (you can always paste the URL manually every time you want to open a PDF file but that's not very practical). However, if you use a browser that supports extensions, it's possible to use an extension to automatically redirect PDF files to this URL. Unfortunately, you can't do this on any well-known browsers (Chrome and Edge for Android don't support extensions at all, and Firefox for Android only supports a very limited set of extensions), but there are less well-known browsers where you can do this. The one I use is Kiwi (I have no association with its author).

Once you've installed Kiwi (or another browser that supports Chrome extensions), install the Redirector extension (I have no association with its author). Next, click on the three dots on the top right, scroll down, click "Redirector", then click on the "Edit Redirects" button, and then click on "Create new redirect":

That will open a popup with five text boxes and two checkboxes. Enter the following information:

  1. The first box is just a description, you can enter whatever you want, for example Open PDF in browser.
  2. The second box is an example URL to a PDF file, you can enter the URL to whatever PDF file you want.
  3. In the third box, enter (^https?://[^?]+\.pdf($|\?).*$). This is a regular expression that matches URLs of PDF files. If you know regular expressions, you may want to note that the parentheses that enclose the whole regular expression are necessary to capture the whole URL so that the $1 in the next box works as expected.
  4. In the fourth box, enter https://docs.google.com/viewerng/viewer?url=$1. This is the URL that PDF files will be redirected to, $1 represents the URL of the original PDF file.
  5. Check the box labelled "Regular Expression".
  6. The last box is just another description Again, enter whatever you want, for example, Redirects PDF files to a Google docs page that shows the PDF in the browser.

When you're done entering all that, it should look like this:

Now click Save and you're done. Now all PDF files will be opened in the browser like this:

To get a link to the original PDF file, copy the URL from the title bar and remove the https://docs.google.com/viewerng/viewer?url= part from the beginning.

  • 2
    Works perfectly, however, I'd suggest to keep Google as the default search engine, otherwise there might be some glitches.
    – lousycoder
    Aug 20, 2021 at 10:08

Another implementation of this idea is to use a Tasker profile I created. Instructions and profile import are available here. The instructions are also copied below.

Google Drive Viewer allows files to be viewed (without downloading) in Google Chrome for Android.


  • The following apps are required: Tasker, AutoShare, and AutoTools
  • Set up the AutoShare command
    • Open AutoShare
    • Main Menu - Manage Commands - plus sign
      • New Command = View File
      • Browsing for files = Direct URL
      • URL = https://upload.wikimedia.org/wikipedia/commons/thumb/1/12/Google_Drive_icon_%282020%29.svg/1280px-Google_Drive_icon_%282020%29.svg.png
      • Priority = 1
    • Main Menu - Share Targets - ensure “AutoShare Command” is checked
  • Import the project into Tasker using the button below (this page must be viewed on your Android device for the button to appear)


  • Long-tap a file link in Chrome
  • Tap “Share link” - “AutoShare Command” - “View File”
  • If a file can’t be natively previewed in Google Drive, you may be able to connect an app that can preview the file


  • By default, the file will open in a new tab. To adjust this setting, open the “Google Drive Viewer” task in Tasker and set %newtab (line 1) as follows:
    • true: file will open in a new tab
    • false: file will open in the same tab currently being used

I just installed opera on the phone, make it the default browsing app, now whenever i have a link with pdf it asks me gently whether to open it from within or download it.

You must log in to answer this question.