firefox

Firefox images and icons

A few weeks ago, I was in need of a free star icon, and for the life of me, I couldn't find one that was quite right. I scoured over the Internet, all the while noticing the perfect little star in my browser.

A couple of times, I Googled for Firefox icons, but I couldn't find them posted anywhere. Finally, I realized that if I just downloaded the source, I could easily find the icons, zip them up neatly, and post them for all to share.

So that's what I've done here. Behold the Firefox icons. These are organized more usefully in the actual Firefox source, but if you don't mind a little icon browsing, the attached zip should have all the icons you see in your browser.

Enjoy.

PS - these are licensed under the following licenses: MPL 1.1/GPL 2.0/LGPL 2.1, and are copyright Mozilla.

Script to Rid Thyself of Autocomplete = Off in Firefox

I took some time today and wrote up a script that can be run to eliminate autocomplete=off in Firefox. It basically does the same thing as is described here, but it automates it.

The script can be run with one of five arguments:

  • You can choose to use find (--find) or locate (--locate) to find the files that need to be changed on your system;
  • You can dictate the location of the file if you want to modify a specific one or know exactly where it's located (--dictate);
  • You can choose to use the Ubuntu default location (--default); or
  • You can print the help information (--help)

Once the program is run, it will make a back up, and modify it the original versions of the file. Once that's complete, all you have to do is restart Firefox.

It has been pointed out to me by some security folks that removing autocomplete's functionality from the browser might not be the best thing, since it will allow you to save your passwords in the browser. There's some truth to that: Anything that's on your computer can be hacked. So, if you're going to use this script, use it wisely.

Here's the code. I've attached it to this message as well. Any bugs or comments are greatly appreciated.

#!/bin/bash
# a simple script to destroy autocomplete in linux installations. 
 
 
##############
# We begin with our functions, it's not efficient, but it works
##############
 
# a function to print the help message.
function printHelp {
cat <<EOF
NAME
    autocompleteDestroyer.sh
 
SYNOPSIS
    autocompleteDestroyer.sh [ --find | --default | --help | --locate | --dictate ] 
 
OPTIONS
    This program will find the nsLoginManager.js file on your computer, and will fix it so that autocomplete is disabled in your installation of Firefox. Since this program will be altering your installation of Firefox, it will require your root password. 
 
    --help     Print this help file
 
    --default  Attempt to use the default location of the files (/usr/lib/xulrunner*/components/nsLoginManager.js)
 
    --locate   Use the locate database, if installed, to find the files. This will only find the files that were added before the last time the locate database was updated (which is typically once a day). It is faster than the --find option, but might not find all versions.
 
    --find     Use the find command to locate the nsLoginManager.js files. This will search in /usr/lib by default. Edit the script if you would like to change this. This is the slowest, but most thorough option.
 
    --dictate  Allows input of a known location.
 
EXIT STATUS
    autocompleteDestroyer.sh exists with a status of 0 if it encounters no problems. An exit status of 1 means incorrect usage. An exit status of 2 indicates it was unable to find your files. An exit status of 3 indicates the user terminated the program. An exit status of 4 means it encountered problems editing your file.
 
BUGS
    If any bugs are encountered, please see michaeljaylissner.com/contact
 
AUTHOR AND COPYRIGHT
    This script was authored by Michael Lissner and is released under GNU GPLv3.
 
EOF
}
 
# takes an argument, and creates an array containing the files to be modified.
function identifyEvilFiles {
    if [ $1 == "find" ]
    then
        files=$(find /usr/lib -name nsLoginManager.js 2> /dev/null)
        if [[ ! $files ]]
        then
            # Test if files has been set.
            echo "autocompleteDestroyer.sh: No files found. Try loosening the find parameter in the script, per the help file."
            exit 2
        fi
    elif [ $1 == "default" ]
    then
        # We assume the default location of nsLoginManager.js
        files=$(ls /usr/lib/xulrunner*/components/nsLoginManager.js 2> /dev/null)
        if [[ ! $files ]]
        then
            # We didn't have any hits. Exit.
            echo "autocompleteDestroyer.sh: We didn't find anything at the default locations. Perhaps try the --locate or --find arguments."
            exit 2
        fi
    elif [ $1 == "locate" ]
    then
        # We run the locate command, see if we have any hits.
        files=$(locate -b '\nsLoginManager.js' 2> /dev/null)
        if [[ ! $files ]]
        then
            # No hits. Exit.
            echo "autocompleteDestroyer.sh: We didn't find anything using the locate command. Perhaps try the --find argument."
            exit 2
        fi
    elif [ $1 == "dictate" ]
    then
        # "Why don't you just tell me what movie you'd like to see?" --Kramer.
        read -p "Where is the file nsLoginManager.js located on your machine: " files
        if [ -f $files ]
        then
            # Good. The file exists. We press on.
            echo "Thank you. That file exists, and we will modify it."
        else
            echo "autocomplete.sh: That file doesn't seem to exist. Please try again."
            exit 2
        fi
     fi
}
 
 
 
function modifyFiles {
    echo  "The following files will be modified: 
$files "
    echo 
    read -p "Shall we proceed (y/n): " proceed
 
    if [ $proceed == "y" -o $proceed == "Y" ]
    then
        # Here we go!
        while read -r line
        do
            echo Now processing $line
            #find the function in the file, label it with FILLERWORD, then replace the first line, and delete the rest. A messy approach, but functional
            sed -i.bak '/[[:space:]]*_isAutocompleteDisabled[[:space:]]*:[[:space:]]*function.*{[[:space:]]*$/,/^[[:space:]]*},[[:space:]]*$/s/^/FILLERWORD/' $line
            sed -r -i 's/FILLERWORD.*_isAutocomplete.*/    _isAutocompleteDisabled :  function (element) { return false; },/' $line
            sed -i '/FILLERWORD/d' $line
 
            # test if it worked
            grep -i -q 'isautocompletedisabled.*return false' $line
            if [ $? != 0 ]
            then
                # something failed...probably. Tell the user
                echo "Unable to successfully edit the file. Exiting"
                exit 4
            fi
        done <<< "$files"
        echo "All the files have been processed properly. Please restart Firefox, and thanks for using this script."
        exit 0
    else
        # It appears they'd like to abort. Let's exit.
        echo "OK. You know what to do if you change your mind."
        exit 3
    fi
 
}
 
 
#initiation sequence
if [ $# -eq 0 -o $# -gt 1 ]
then 
    # We need to give them help using the program. 
    echo "autocompleteDestroyer.sh:  Invalid number of arguments."
    echo "Usage: autocompleteDestroyer.sh [ --help | --default | --locate | --find | --dictate ] "
    exit 1
elif [[ $EUID -ne 0 ]]; 
then
    echo "autoCompleteDestroyer.sh: This script must be run as root" 1>&2
    exit 1
else
    case $1 in
        --help) printHelp;;
        --find) identifyEvilFiles find; modifyFiles;;
        --default) identifyEvilFiles default; modifyFiles;;
        --locate) identifyEvilFiles locate; modifyFiles;;
        --dictate)identifyEvilFiles dictate; modifyFiles;;
        *) echo "autocompleteDestroyer.sh: Invalid argument. Try the --help argument."
           exit 1;
    esac
fi

Rid Thyself of Autocomplete=Off in Firefox

Update, 12-15-09: See this script for an automated way to apply this change.

If you're at all like me, you use a password manager to keep track of all your passwords, and it works great. Most of the time. Except sometimes, it doesn't work, and you're confused why. Well, more often than not, it's because your password manager has been blocked by the web page you're viewing.

If you look closely at the code of the page, somewhere in it, you'll probably find something that looks like this:

<input class="button" type="submit"  name="login" value="login" autocomplete="off">

That autocomplete parameter that you see at the end there? Yeah, that's the one that's blocking your password manager. So we must block it, so it doesn't block us.

There's a couple approaches to this, but probably the best is to disable Firefox's ability to interpret autocomplete. The way to do this on Linux is to browse to:

/usr/lib/xulrunner-1.9.1.5/components/nsLoginManager.js

And in Windows, I believe it's at:

C:\Program Files\Mozilla Firefox\nsLoginManager.js

Once you've found that file, open it in an editor, and find the section that has isAutoCompleteDisabled, and make it look like this (so it will always return FALSE):

    /*
    * _isAutoCompleteDisabled
    *
    * Returns true if the page requests autocomplete be disabled for the
    * specified form input.
    */
    _isAutocompleteDisabled :  function (element) {
    //        if (element && element.hasAttribute(”autocomplete”) &&
    //            element.getAttribute(”autocomplete”).toLowerCase() == “off”)
    //            return true;
 
    return false;
    },

Once that's done, save the file, restart Firefox and you're all set.

Firefox Extension Fixes

Tagged:  

Just a quick post today. For some time I've been using the Firefox Long URL Mobile Expander. It's a great add-on that expands the URLs from about two hundred URL shortening services such as tinyurl.com and bit.ly. One problem it has though is that when you open certain files locally on your computer, it throws an error:

error: current_domain is null

This is a pretty annoying error, and some kind person tracked it down and posted the fix in the comments. They did not, however, post an updated version of the add-on. So, attached to this message is the fixed version.

A second extension that I've been using for a long time is the Resizeable Textarea add-on. It allows you to drag the edge of text areas and form fields so that you can make them as big (or small) as you like. Unfortunately, the author hasn't updated the add-on since 2006, so it doesn't work on recent versions of Firefox. This is easy to fix, so I updated this one as well, and attached it to this post.

Enjoy.

EDIT: Per the creator's comments below, you can find an updated and fixed version of the Long URL Expander in experimental status here: https://addons.mozilla.org/en-US/firefox/addons/versions/8636#version-2.
EDIT 2, 10-2-2009: Turns out that the fixed version of Resizeable Textarea on the mozilla site doesn't actually work. An updated version is attached though.

Firefox Modifications for Maximal Screen Real Estate and Usability

I've been playing around lately with concepts to make Firefox more useful on my laptop, and I've come up with a few solutions I thought I would share. The idea here is to take the best concepts from Chrome and Safari, and apply them to Firefox. These changes will maximize your use of screen real estate, and will make Firefox a little easier to use at the same time.

Once these are set up, Firefox will look like this:

These changes do the following:

  • Reduce the status bar to 1px at the bottom of the screen
  • Reduce the menu bar to a small icon to the right of the URL bar (like Chrome)
  • Move the tabs to the top of the browser (like Chrome)
  • Highlights the domain part of each URL (like Chrome)
  • Make links appear in the URL bar when you hover over them (since the status bar is eliminated)
  • Show a progress bar in the URL bar rather than in the status bar (like Safari)

The changes that are needed to enable all this are a bit complicated, but not too bad:

  • Eliminating the status bar at the bottom of the screen creates about 35 pixels of vertical space that is otherwise not used for very much. By making it only one pixel, hovering over the bottom of your browser window will pop it up, in case you need it. To do this, you need the Stylish extension, and this Stylish script.
  • Reducing the menu bar to only a small icon achieves the same goal of creating screen space. To do so, I recommend the Compact Menu extension. A word of warning though: this one takes some configuration after installation. (The Tiny Menu extension will also work, but you can't move the icon to the right-hand side, which makes the back button much more difficult to use.)
  • After some consideration, I decided to move my tabs above the URL bar because the URL bar and the associated buttons really do apply to whatever page is being displayed. Which is to say that the URL is part of the tab, and should be displayed under it - not vice versa. To make this change is pretty easy - simply install the Stylish script found here.
  • Highlighting the domain in the URL bar, and graying out the rest is a simple and useful trick that helps to avoid scam sites that might be trying to impersonate a valid web site. To make this change, simply install the Locationbar2 extension.
  • Since we eliminated the status bar, one thing we'll need back is the ability to see where a link takes us before we click on it. By making it appear in the URL bar rather than the status bar, our eyes only need to look in one place, and the result of clicking on a link is shown to us before we click on it. To make this change, there is a setting in the Fission extension, which is also used to display progress in the URL bar

You might note at this point that in the screenshot above that I've also eliminated the search box from the navigation toolbar, thus allowing more space for the URL bar. To replace the search box's functionality, I recommend the Cybersearch extension, which uses keywords in the URL bar to complete searches. For example, if I type "wiki windows," it gives me the top ten wikipedia pages for the term windows:

This also works for Google and Amazon, and just about any other site you can think of.

Once all of this is completed, you should have created about 70 vertical pixels of new space in your browser, maintained all the previous functionality, and improved the usability of a couple of tasks.

Cool Research Tip - Bookmark to Date Websites

Tagged:  

I spend a lot of time researching things on the Internet, and I've noticed a problem with regards to the answers I find. Frequently, after researching something for a while, I discover what appears to be the answer I am looking for, but people are notoriously bad when it comes to dating the things they write.

Yesterday, while scanning the news, I discovered this article, which explains that in Firefox if you type "javascript:alert(document.lastModified)" into the address bar, it will show a pop-up indicating when the page was - you guessed it - last modified.

This is a VERY handy tip, and I realized that if you hit Ctrl+B in Firefox, and then right-click in the sidebar > Create new bookmark, you can even save it as a bookmark, so that if you ever want to know when a page was modified, it's a piece of cake to find out. The one shortcoming of this is that it won't work on dynamically generated pages, such as this one.

Syndicate content