I recently upgraded to Chromedriver 2.15
Now, when I click a link to a pdf file it is auto-downloading instead of displaying in a new tab as before.
<a id="my_pdf_file" format="pdf" target="_blank" href="/my_pdf_file.pdf">My PDF File</a>
Is there a way to resume the old behavior of displaying the pdf in a new tab?
This is how you define a Chrome profile with Watir
This is the chromedriver capabilities page
I don't see right off the way to enable/disable the Chrome PDF viewer (chrome://plugins/)
But, you can set up your own profile - see the 'Use custom profile' section.
This is currently an open issue with Chrome, not Chromedriver:
Unable to open a PDF file in chrome since upgrading to v 42.0.2311.90
I updated to the latest version of the dev branch of Chrome
44.0.2391.0 dev-m (64 bit)
, ran a test in Selenium that opens a PDF, and can confirm that PDFs are opening in new tabs by default.This was tested using the following:
So, you can either use the dev version of Chrome until the release version catches up, try one of the workarounds in the link above, or wait with the knowledge that it will get fixed soon.