Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I don't want to see that Discard/Keep dialog when downloading a pdf file in browser. I just want it to automatically save to my default location. I'm using chrome on Ubuntu 13.04.

enter image description here

share|improve this question

1 Answer 1

I fear that the only way to disable this is to patch Chrome.

The file that contains the blacklist is /src/chrome/browser/download/download_extensions.cc.

One would just need to remove the line containing { "pdf", AllowOnUserGesture }, and recompile.


Or replace DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path) with:

DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path) {
  return NotDangerous;
}

which seems to have some irony to it.


UPDATE: I wrote a patch and have successfully tested it.

--- chromium-26.0.1410.43-old/chrome/browser/download/download_extensions.cc    2013-03-21 21:14:04.000000000 -0400
+++ chromium-26.0.1410.43-new/chrome/browser/download/download_extensions.cc    2013-06-04 11:51:40.000000000 -0400
@@ -213,6 +213,7 @@
 };

 DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path) {
+  return NotDangerous;
   base::FilePath::StringType extension(path.Extension());
   if (extension.empty())
     return NotDangerous;

If on Gentoo, you can just place this in a file in /etc/portage/patches/www-client/chromium/ and emerge chromium.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.