How to change how IE / Chrome opens a file in-browser? - google-chrome

So here's the story. At my company, you can access previous pay statements online via a payroll website. When you go to look at a statement, it will open the statement in-browser via a pdf viewer. When working properly, it will usually ask if you want to blank out all the data or not (which... why would you want to? the point is to look at your statement). Now, this worked fine when checking it out in Adobe Reader; you'd just click "yes, show data" and everything displays fine, it can be printed, etc. But the company decided that instead of getting Acrobat for editing pdf files, that the better (cheaper) option is to get a cheap/free alternative called "Nuance" something or other. Two users installed this program, and now the browsers open pdfs in-browser with Nuance instead of Adobe Reader. This is a problem, because Nuance doesn't show the option of hiding or showing data like Reader did; rather, it just chooses the "no" option, which results in a blank template pdf coming up.
Now, this whole problem could be solved if we could just get the browsers to use Reader to open pdf files in-browser... obviously it's not a problem if you could download the pdf, but the site doesn't seem to allow you to download the pdf files. We've tried just about everything we could think of, short of uninstalling Nuance altogether, to get IE or Chrome to open pdf files with Reader, but even with a full IE reset, it uses Nuance to open pdfs inside the browser. Changing the default program for pdfs has yielded no results, IE still uses Nuance in-browser.
Anyone have any thoughts on how to change IE or Chrome to default to using Reader to show pdf files instead of Nuance?
Thanks!

just change the default programs or applications that opens pdf files, make it the adobe reader. You'll have to configure it in Windows, the Default Programs in Control Panel. You'll have to do this in each computer.

Related

Get downloadhistory from Selenium

Is there any way I can find out what the latest file Selenium downloaded was, and from where (what URL) it was downloaded?
I am fetching files from a large number of sites (that I do not control) by clicking on elements, and my problem is that I do not know how the files are downloaded. Sometimes it is just an <a> element, sometimes there is a Javascript event attached to some element, or form (not always obvious from inspection), and so on, and so on.
So I though the easiest would be to just do my clicks, and then check what landed in the download folder. But then I have no idea where that file came from, and I also need to store the url.
For files that can be displayed inline, I can, of course, open them in the browser and get the driver.current_url. This is very convenient for file formats where it actually works, so if there is a way to force e.g. Firefox or Chrome to open all files inline, that would also be an option. (I am aware of one such extension. That extension, however, requires some user interaction in a OS file dialogue window, and that seems like overkill here)
Possible solutions
Firefox: Read moz_downloads from downloads.sqlite, in the FF SQLite DB
Chrome: Read the corresponding SQLite db for Chrome/ium
Write browser extensions that modifies the mimetype of visited pages, so that all files are opened as plain in the browser, and the URLs can be accessed from there.
How I understanding selenium it only insert js to page, that mean that you can interact only with web page but not with browser futures.
But you can do like in this post How to access Google Chrome browser history programmatically on local machine if that files are in download history you can find them there.

Disable "Fit to Page" in Chrome

My company has a web application that outputs a PDF which we print on label paper (stickers with product data).
Chrome is the default browser around here. Unfortunately, when we try to print from Chrome the "Fit to Page" checkbox is automatically selected. This screws up the alignment and prints data in the wrong places. If we uncheck 'Fit to Page', it prints perfectly on all machines.
If I skip the Chrome Print dialog and use the system one, it works fine on a Mac, but poorly on Windows machines.
I would really like a way to disable the "Fit to Page" option.
What I've looked at:
Printing Avery 5160 labels with FPDF - I added /ViewerPreferences << /PrintScaling /None >> to my pdf, but this article Set PDF to print with no scaling says that it's controlled by the application (Chrome in my case).
http://productforums.google.com/forum/#!topic/chrome/REy2n67B1fM --not helpful
https://code.google.com/p/chromium/issues/detail?id=158752 --not helpful
So I'm afraid that I may need to find or make a Chrome extension to do this. Before I dig into that, does anyone know if it's even possible?
Other Facts:
PDF is being generated by fpdf in php. All computers should be using latest vs of Chrome.
I hate to say this but, could you try opening the PDF in a different browser, or use a standalone PDF reader application?
Since the Chromium team has labelled this as a WontFix, Chrome simply might not suffice for your needs.

file upload dialog with multiselect

I'm working on a file upload solution that adds flexibility to existing options. A standard works fine, but does not allow selecting multiple files. There are plenty of solutions to work around this, I'm aware of that, but I'm looking at the solution Facebook has implemented. the "multiple=true" moniker isn't supported by IE9 and below; Facebook trick this by providing a file dialog (on IE) that allows multiselect and feed the result back to a flash upload handler. My question is: how do I open that file dialog (allowing multiselect)? Once I get that done, I can handle the results from there (sending multiple files to my upload handler isn't a problem, nor is distinguishing between IE9 and other browsers/platforms).

Legitimate technique for avoiding file download blocker in IE ("To help protect your security")?

My web app allows export of data in a variety of formats. The export is triggered by selecting an export format from a dropdown (<select>), which causes the form to be POSTed and the file returned and downloaded in the requested export format.
This works fine on all browsers except for IE - on IE the "To help protect your security" blocker appears, and clicking on the "Click here for options" causes the page to reload instead of allowing the actual download.
In short IE users can't download files due to the blocker and the subsequent reload instead of download.
I know we can ask users to change their security zone settings to enable download, but for a variety of reasons this is not practical - there are a lot of users in a lot of different environments and they tend to ignore instructions.
Are the rules for what causes the blocker to come up documented somewhere? What's the legitimate, recommended way of allowing file downloads in IE? That is, for the scenario detailed below, how can I setup the HTML/form to actually let the user download the file?
Show the user a list of file formats
Once the user selects a file, download it to her computer without triggering the download blocker on IE
Have your <select> block simply inject (using JavaScript) click here to download text somewhere else in the DOM tree. Then, the user clicks on a standard link and it reloads the full page, downloading the file directly.
You can even have the click to cause GET requests..

Local WebSite: run default browser

I need to create a brochure-cd from a website I did. All resources are html, images and xml, so i don't have any problem at all in accessing file system. My question is: once I open my index.html page in browser, how can I set the params of the window (eg: show addressbar, show statusbar, etc)
Thanks
(If you have an alternative idea of how run an html based brochure on CD just let me know)
EDIT: Specs changed, I've just knewn I must write xml and upload file, too. Any idea? I'm considering Adobe Air, but would be amazing if I can compile a whole .NET website into an exe..... Anything similar?
The only way you can set these is when you open the page, not after it's already present. So, you will probably have to have a start page, which then opens your new page, with the parameters you want.
Be warned though, if you have any JavaScript, many browsers won't allow scripts to run locally, or will present a nasty warning message before it will execute.
You may look into having a small desktop application on the CD that launches an instance of a browser inside of itself, assuming you can run the browser on every machine this will be run on. This will probably give you the look you're after.
I think you can't. You can only set params of a window you create. So you'll have to run a script on load that creates a new window and then closes the initial window.
There is however no way that this script is executed without warnings, if at all.
An alternative would be to develop an executable that is able to display the page, but that might not be easy, especially when you want to be browser and platform independent.