Chrome open pdf in new tab instead of download
How can we turn that setting on to direct download in chrome instance created by selenium webdriver? I've got a solution. Posting as answer. SetPreference "plugins. How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more.
Download pdf instead of opening into new tab in Chrome from excel vba via Selenium webdriver Ask Question. Asked 1 year, 6 months ago. Active 1 year, 4 months ago. Viewed times. Start "chrome", "" Obj. SendKeys "username" Obj. SendKeys "password" Obj. Sheets "Invoices".
Range "A1". End xlDown. Row Range "A1". Offset 1. Select 'Clear existing number from search box Obj. Clear 'Enter a new invoice number saved in the macors workbook. SendKeys ThisWorkbook.
Value 'Click on searh button Obj. Click 'Click on the found invoice link Obj. Click 'Click on download button Obj. Now they are opening up in a new tab on chrome and it is very uncomfortable. Of course if you open any PDF in chrome built-in viewer if you move the mouse you get the toolbar with buttons.
Google Chrome users. By default, Google Chrome opens a PDF file in the browser window instead of saving it to the downloads folder. Open Google Chrome. Edit: I have found that it behaves kinda randomly.
Sometimes it does open it inside its viewer and sometimes it asks to download it. Download a PDF file, then when it is done, left click on the download icon at the bottom and select 'always open this type of file' Now It should open any PDF link you click in that window without downloading it to a permanent location. I also have the box ticked, 'ask where to save each file before download', not sure if this has any affect on the behavior of automatically opening a file.
There may be some PDFs that chrome cannot display properly, so it offers you to download it to view with another PDF viewer. It is not a full featured viewer like Foxit or Adobe. I use it this way and can find no PDF that chrome has saved, it has to cache it somewhere to read it, but I am not sure where it does. If it is set to 'inline', it will auto-open if configured accordingly.
If it is set to 'attachment', Chrome will offer to save it, regardless of other configurations. In other words, behavior will vary from site to site, just like you're describing. I don't know, however, if and how it could be made to open the PDF in any case; I'm afraid this might not be possible. The ability to auto-open PDFs was disabled in recent versions of Chrome. The developers re-implemented the feature and it is available again in Chrome 10 and above.
If you need to, restart chrome for it to take effect. Should be good to go.
0コメント