Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Disable "This type of file can harm your computer" nag in chrome

Writer Matthew Martinez

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

0

3 Answers

I have a solution which worked on Windows 10. The issue can be fixed by editing "download_file_types.pb" which is located in my computer at

%localappdata%\Google\Chrome\User Data\FileTypePolicies\21\download_file_types.pb

The file contains various file extensions. Just hexedit the file and remove the extension you want chrome to ignore. e.g. I wanted to download *.mat files, so I searched for 'mat' and replaced it with 'xxx'

This worked for me. Make backups as it is just a workaround.

3

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.

You can disable this feature through the Advanced Settings option in Chrome Settings. (Please see the screenshot below.) Unfortunately, it's not very granular because disabling it also disables other safe browsing features. Picture of disabling safe browsing.You perhaps could disable safe browsing if you need to download a number of files that you know to be safe, and then you could re-enable safe browsing afterwards.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy