15 February 2009 - 12:30Hiding History with userChrome

Josh had an interesting comment in my recent post on Firefox 3.1 Location Bar Preferences about hiding certain keywords from the location bar.

At first I suggested using the new “Forget About This Site” feature where you can select a page from your History Sidebar and choose to forget everything (history, cookies, etc) about that site. Doing this would prevent any of those pages from showing up in the location bar because you would have no history for that site.

Quick way to remove a site from the location bar

Quick way to remove a site from the location bar

Unfortunately, that requires the user to actively clear the site from his/her history. (Perhaps Firefox could automatically do that for the user in a privacy-aware manner…)

Josh then had a question regarding userChrome. Since Firefox 3 handles all sorts of fancy CSS 3 selectors including substring matching in attributes with *=, I figured it would be fairly simple to match the url or title of a location bar result and hide it.

This technique works well if you don’t mind leaving trails of your privacy hiding in plain sight. However, I suppose the ease of taking a peek at userChrome is a quite bit more difficult than just typing in the location bar.

Hide pages that match your keyword/pattern in the URL or title

Hide pages that match your keyword/pattern in the URL or title

All you need to do is use your favorite way to style Firefox, e.g., editing userChrome.css in your profile’s chrome directory or through an add-on, and add a style matching the class name “autocomplete-richlistitem” as well as a selector for either the “url” or “title” attributes.

For example, if you want to block any results that have “facebook” anywhere in the URL, use the following style:
.autocomplete-richlistitem[url*="facebook"] { display: none; }

This is just a simple hack to prevent certain pages from showing up. The location bar by default tries to show the top 12 pages, but if you’re hiding pages, you might end up with no results. You can try changing the value of browser.urlbar.maxRichResults from about:config to get more results, so if any get hidden, there are others to fill in the space.

15 Comments | Tags: AwesomeBar, Mozilla

4 February 2009 - 7:21Panic Mode: Really! I Just Opened Firefox

You probably already know about the new Private Browsing Mode [support.mozilla.com] in Firefox 3.1, but did you know about the other “P” Mode? Panic Mode!

Well, maybe not as it’s a brand new add-on I’ve written that shows your home page instead of about:privatebrowsing when starting Private Browsing Mode. That’s all! Very simple. 🙂

Panic Mode works just like Private Browsing except it shows your home page

Panic Mode works just like Private Browsing except it shows your home page

Now when your boss is walking over and you’ve got a bunch of tabs for online social networks, chatting and personal mail; just hit the shortcut for Private Browsing (Ctrl/Cmd-Shift-P), and woosh! those tabs disappear and now it looks like you’ve been busy working! Saved by Panic Mode! 😛

Just remember that you’re now in Private Browsing, so if you hit the shortcut again, it’ll bring back the tabs you had opened. (Don’t mix up those modes! Could be dangerous if you restored those tabs as your boss is looking over your work!)

Oh, and any kind of home page works. So if you’ve set a bookmark folder to be your home page, it’ll load all those tabs when going into Panic Mode.

Try out Panic Mode Add-on [addons.mozilla.org] today! 🙂

3 Comments | Tags: Add-on, Mozilla

4 February 2009 - 7:20Firefox 3.5 Location Bar Privacy

Thanks for installing/upgrading Hide Unvisited. This latest version is only for Firefox 3.5 and leverages the built-in privacy functionality of Firefox 3.5, so you don’t even need the add-on anymore. The add-on has already automatically uninstalled itself and set the preference as described below for you. 🙂 But if you want another add-on to try, check out Enter Selects — pressing enter from the location bar will now automatically go to the first result.


User Privacy has made big steps with Firefox 3.5. First off it’s very simple to clear out the last hour of online shopping, medical researching or media browsing with “Clear Recent History.” This is much smarter than wiping out your entire history or not letting Firefox track any history just to prevent some pages from showing up in the Location Bar. Another big privacy feature is Private Browsing Mode [support.mozilla.org] (Panic Mode? 😉 ), which starts a new browsing session where Firefox won’t track any history until you leave that mode.

Both these features affect the Location Bar because removing pages from your history stops you or someone else using Firefox and accidentally finding those pages when typing in the Location Bar.

One slight caveat is that by default, Firefox will suggest bookmarks from the Location Bar because you’ve added a star to the page and probably want to revisit it. This means even if you clear your browsing history, bookmarks will still show up when searching for pages.

Choose what Firefox 3.5 can suggest from the Location Bar

Choose what Firefox 3.5 can suggest from the Location Bar

Firefox 3.5 adds a new drop-down menu in the Privacy view when setting your Preferences. Here you can tell Firefox to only search “History” instead of the default of “History and Bookmarks.” This means if you use a bookmark and remove traces of visiting the bookmark, it won’t show up in the Location Bar until you revisit that page you bookmarked.

On a related note of only showing pages you’ve been to, Firefox 3.5 will only suggest pages that you’ve typed in the Location Bar when clicking the drop-down button. This means the 12 sites that appear in the list are those that you frequently use to start browsing. Similarly, Auto Dial 6 has been updated to only show pages you’ve typed. These two make great ways to go back to sites that you launch from.

Two launch-points to get you started in just a couple clicks

Two launch-points to get you started in just a couple clicks

If you want more advanced control of the Location Bar behavior, check out Firefox 3.5 Location Bar Preferences.

70 Comments | Tags: Add-on, AwesomeBar, Mozilla

4 February 2009 - 7:19Firefox 3.5 Location Bar Preferences

For those comfortable with twiddling around with about:config, there are several new preferences to play with since Firefox 3. (If that sounds scary, check out my other post about Firefox 3.5 Location Bar Privacy.)

I’ll explain three new groups of preferences that let you..

  1. Toggle suggestions on and off
  2. Customize what results get shown
  3. Change the matching behavior as you type
Configure Smart Location Bar's behavior from about:config

Configure Smart Location Bar's behavior from about:config

Toggle Suggestions

The first preference is fairly simple; toggle browser.urlbar.autocomplete.enabled to turn the location bar suggestions on and off. This is useful if you always want to type out the URLs you want, or if you can type a whole domain and hit enter faster than typing a single letter and having Firefox suggest the site you want.

If you’re just looking to prevent certain pages from showing up in the suggestions, there are better options available than using this sledgehammer (see below). Also, for those who have set browser.urlbar.maxRichResults to 0, -1 or something else (e.g., userChrome.css) to turn off suggestions, using this preference is better as it prevents your CPU from wasting power while searching for results that Firefox won’t show.

Customize Results

The second preference lets you make the location bar only match URLs of pages you’ve visited, similar to Firefox 2’s behavior. It’s much more powerful than just that as it also lets you restrict results to pages that you’ve 1) visited, 2) bookmarked, 3) tagged or 4) typed in addition to letting you force your search terms to match in 1) the title or 2) the URL.

You can use any combination of these filters to reduce the number of results that show up in the location bar’s suggestions. Another way to look at it is if you specify some filters, e.g., bookmarked + typed, you’re getting rid of anything that isn’t that — throw away all results that aren’t bookmarked as well as get rid of pages that you’ve never typed in the location bar.

The way you set these filters in browser.urlbar.default.behavior is slightly tricky if you’re not familiar with “bitmaps.” They’re not too complicated to deal with, but you will have to do some simple addition in your head. 🙂 The way things work is each filter is given a number value, and to figure out what number to set for the preference, just add up the values of each filter you want.

If you want the location bar to only match URLs of pages you’ve visited like Firefox 2, set browser.urlbar.default.behavior to 17 (1 for visited pages + 16 for URLs).

Similarly, if you want to additionally restrict results to pages you’ve typed in, add in an extra 32 for “typed” — 49 for matching URLs of typed, visited pages. So for those who have used browser.urlbar.matchOnlyTyped in the past, you’ll probably want to add 32 to any other filters you want.

The whole set of values for each filter are as follows:

  • 1: visited
  • 2: bookmarked
  • 4: tagged
  • 8: match title
  • 16: match URL
  • 32: typed

Filter On-Demand

The last group of preferences are very related to the previous preference, and I’ve introduced their functionality in my post on Firefox 3.5 Restricts, Matches, Keywords.

Basically they do the same thing as the previous preference except you type in a special character to turn on a filter as you’re searching from the location bar. This lets you pick and choose when you want the filters to be in effect instead of always being on.

The default symbols for these “on-demand” filters are as follows:

  • ^: browser.urlbar.restrict.history
  • *: browser.urlbar.restrict.bookmark
  • +: browser.urlbar.restrict.tag
  • ~: browser.urlbar.restrict.typed
  • #: browser.urlbar.match.title
  • @: browser.urlbar.match.url

One big difference from what I described in the earlier post is the handling of empty filters. Setting these restrict/match preferences’ special symbols to nothing prevents you from (accidentally) activating that filter dynamically. However, you can still set the default.behavior to use that filter automatically.

57 Comments | Tags: AwesomeBar, Mozilla