RSS .92| RSS 2.0| ATOM 0.3
  • Home
  • About
  •  

    Disable the “Downloads” window in Firefox when starting a download

    February 17th, 2009

    In Firefox, everytime you start a new download, the “Downloads” window(which can be brought up by Ctrl+J) pops up. This could be very annoying sometimes. The downloads progress window steals the focus from the main firefox window which shows the web pages.

    For instance, I needed to save about 10-15 images from a web-page. I would right-click on the image and choose “Save Image As”. Once I would define the location where the image is to be stored, the “Downloads” window would immediately popup. I would close the window everytime and navigate to the web-page again. AS you would have guessed, I needed to do this about 10-15 times. If you too have been through this, you know how annoying it is!

    Solution to disable the “Downloads” window when starting a download:

    1. Type about:config in the address bar of Firefox. Choose to proceed if asked for a confirmation.
    2. At the top of that page, you would see a field named “filter“. Into the ‘filter’ field, type “ShowWhenStarting“.
    3. It will bring up a setting. Double-click on that setting row and you will find that the value in the last column changes to “false“.

    Now restart Firefox and try to download an file. You will be happy to find that the “Downloads” window does not open anymore when starting a download! If you need to see the “Downloads” window, you can use Ctrl+J combination on your keyboard.


    Validating email addresses without regular expressions

    February 9th, 2009

    Validating email addresses is one of the common uses of regular expressions. However, not all email addresses are in the typical format of “someone@somewhere.com”. With the frequent advent of new domain extensions, regular expressions may fail to validate certain offbeat email address patterns.

    If you are using PHP 5.2 or higher, you can use an inbuilt function for that:

    filter_var('bob@example.com', FILTER_VALIDATE_EMAIL);
    //returns true

    Apart from email address validation, some more filters can be found. A list of 17 available filters can found on PHP’s offical manual page

    Update: Mmerlinn–a member at Digitl Point forums has alerted me that FILTER_VALIDATE_EMAIL is not RFC2822 compliant, and is vulnerable to new-line injection.