Web Development

Browser-Correct Download Instructions

Browser-Correct Download Instructions

Something I’ve noticed since I started using non-IE browsers is that download instructions are provided, they’re almost always specifically for the IE browser on Windows operating systems (right-click on the link then select "Save Target As…").

What about Firefox? Opera? Macintosh browsers?

Many who use non-IE, non-Win browsers are probably so used to seeing the incorrect instructions that they mentally correct them before downloading. Therefore, few will hold it against you for being Win/IE-centric.

Those who use the alternate browsers and operating systems aren’t the normal "follow the crowd in all things" type of citizen.

One way to make an impression is to be different than everybody else by providing correct download instructions for these folks. It’s not that they don’t know how to download, but that you acknowledge their existence and care enough to be accurate.

And it’s easy to do. Simply pop some JavaScript into the place where your download instructions are.

The "download instructions" this article refers to are those that instruct the user to download a document at a link. Many PDF files have such instructions because some people’s computers are configured to load the PDF file instead of download it when the link is clicked normally.

Here is the JavaScript.

<script type="text/javascript" language="JavaScript">
<!-- Copyright 2005 Bontrager Connection, LLC
function talkright() {
if(navigator.appVersion.indexOf('Mac') != -1) {
   // It's a Macintosh
   document.write('Option+Click the link.');
   return;
   }
if(navigator.appVersion.indexOf('Win') != -1) {
   // It's Windows
   document.write('Put the mouse cursor over the link. ');
   document.write('Right click the link and select ');
   if(navigator.userAgent.indexOf('Firefox') != -1) {
      // It's Firefox
      document.write('"Save Link As..."');
      return;
      }
   if(navigator.userAgent.indexOf('Opera') != -1) {
      // It's Opera
      document.write('"Save target as..."');
      return;
      }
   if(navigator.userAgent.indexOf('Gecko') != -1) {
      // It's Netscape 6+
      document.write('"Save Target As..."');
      return;
      }
   if(navigator.userAgent.indexOf('IE') != -1) {
      // It's IE
      document.write('"Save Target As..."');
      return;
      }
   }
// Default
document.write('Put the mouse cursor over the link. ');
document.write('Right click the link and select ');
document.write('"Save Target As..."');
}
talkright();
//-->
</script>
<noscript>
Put the mouse cursor over the link.
Right click the link and select "Save Target As..."
</noscript>

The NOSCRIPT tag is present for browsers with JavaScript turned off.

Only a few browsers are represented above, those I could check the afternoon this article was written.

Many more different kinds of browsers are used. And I ask your help to update the JavaScript.

If you use a browser other than those in the JavaScript above, please go to the forum at http://willmaster.com/support/cgi-bin/forum/MBP.cgi where you’ll see a thread titled "Browser ‘Link Download’ Instructions."

Reply to the thread with the name of your operating system and browser, and with the procedure for downloading a document from a link.

I thank you very much.

About the author

Written by Will Bontrager.

Publication: WillMaster Possibilities

If you found this post useful you may also want to check these out:

  1. New Browser Window Checkbox
  2. Disabling the Right-click Mouse Button
  3. Automatic New Window for External Links
  4. Redirecting URL
  5. Opening A New Browser Window
  6. How to Disable the Submit Button