Tuesday, April 21, 2009

Disable Alt+Click for download in Firefox

I have not found a way to disable the Alt keyboard shortcut that activates a download of the link you click on. It can be a real file or even a html page. This is a timesaver when you quickly want to download files in Mozilla Firefox.

Why did I want to disable it then?

I have found that often the download is triggered unintentionally. Eventually I found that this happened accidentally if I clicked on a link and then after that quickly pressed Alt+Tab to switch to another application. Somehow pressing the Alt after clicking on the link also activated the download.

Here is the workaround that I found working after some research of the settings.

Enter about:config in the address field. about:config is where all user preferences can be viewed and modified in Firefox.

Locate browser.download.saveLinkAsFilenameTimeout and lower the value. I tried 100 milliseconds and have not seen any problems so far. If I run into problems I will try to set it a bit higher.

Some URLs use Content-Disposition headers to tell browsers what to use for a filename when saving a file. This filename may not match the URL. When choosing “Save Link As...” from a link’s context menu, Mozilla must request the URL to find out the filename from a Content-Disposition header. Since this is not as fast as merely using the URL itself to generate a filename, Mozilla will time out after a short time waiting for the headers. This preference determines that timeout.

Number of milliseconds to wait when retrieving the filename from Content-Disposition headers before resorting to the original URL’s filename. Default is 1000 (1 second).

Hopefully there is a better way as this workaround might have side effects when downloading some URLs.

Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner