MozillaZine

Customising the Firefox 3.0.* Location Bar.

User Help for Mozilla Firefox
steviex
Moderator

User avatar
 
Posts: 28902
Joined: August 12th, 2006, 8:27 am
Location: Middle England

Post Posted June 20th, 2008, 1:02 pm

I thought it might be useful to collate all the information about the new 'Smart' Location Bar as implemented in Firefox 3.
This guide will detail some methods to customise the bar, and its Functioning.

FIRST ... There is currently no way to make the Location bar behave exactly like Firefox 2 but I hope this guide helps...

NEXT .... Make sure you actually know how the bar works before you rush to customise, or criticise it...
Here is a good guide to how the new Location bar works... http://www.dria.org/wordpress/archives/2008/04/17/628/

Much discussion on the Forums has been had about this, already. (see the end of section 3)
Firefox 3.1 will have more ways to control the Location Bar when it is released ( I will include details as I get them... currently collecting them here viewtopic.php?f=23&t=827405 )

I am dividing this Guide into four sections...

1. Appearance
2. Extensions to Alter the Location Bar
3. Altering what is searched for and the Search Algorithm (The way the Search Works)
4. MINI TUTORIAL - Adding code snippets to userChrome.css and userContent file
_________________________________________________________________________________________________________

1. Appearance

a) Appearance and Number of Results

i. To increase the number of results, Install this extension https://addons.mozilla.org/en-US/firefox/addon/7674
(This is an experimental Addon, so you will need to register at the addons site to Install)

ii. To get the results to appear on one line, like Firefox 2, install the Old Bar Extension https://addons.mozilla.org/en-US/firefox/addon/6227
(Note, this only affects the appearance, NOT the function)

iii. To change the colours and font of the results, see this article http://mozillalinks.org/wp/2008/03/twea ... lete-menu/

b) Location Bar Appearance

While some extensions exist to modify the appearance, many fixes can be accomplished via CSS placed in the userchrome.css file
For information on this, see the Guide in Section 4 of this article.

i. The Star
By default, the star should always visible for bookmarkable pages.

This code will hide the star only if the page is bookmarked
Code: Select all
 #urlbar-icons > #star-button[starred="true"]
{
display:   none !important;
}


This code will hide the star only if the page is not bookmarked
Code: Select all
#urlbar-icons > #star-button:not([starred="true"])
{
display:   none !important;
}


If you want to always hide the star, no matter what, use this code
Code: Select all
 #urlbar-icons > #star-button
{
display:   none !important;
}


To keep Always Visible use this code
Code: Select all
    #urlbar[pageproxystate="invalid"] > #urlbar-icons > #star-button
{
visibility:   visible !important;
 }



ii. The Go Button

To keep Always Visible, Install this extension https://addons.mozilla.org/en-US/firefox/addon/6933
or use this code
Code: Select all
#urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button
{
visibility: visible !important;
}



To Hide the Button use this code
Code: Select all
#urlbar-icons > #go-button
{
   display:   none !important;
}


iii. The RSS Icon
To hide the icon use this code
Code: Select all
#feed-button
{
display: none !important
}


iv. To make the URL Bar go yellow for https sites use this code
Code: Select all
#urlbar[level] .autocomplete-textbox-container >* {
background-color: #FFFFB7 !important;
}


v. To eliminate the Drop Down Arrow use this code
Code: Select all
.autocomplete-history-dropmarker { display: none !important;}

(Thanks to Eric Wendelin)

2. Extensions to Alter the Location Bar

The following Extensions set some of the preferences listed below, and may be easier to use.
Note, some of these extensions are experimental, you will need to register at AMO to install them.

3.Altering what is searched for and the Search Algorithm (The way the Search Works)

Type about:config in the Location Bar and look for these Preferences..

a) Exclude All Results, or change the number of results

browser.urlbar.maxRichResults
This setting is only really useful if you either want to remove the autocomplete function entirely, or limit the list to a shorter length on your screen real estate, now that titles are a part of the result. Setting to 0 (zero) will just stop all autocomplete results.

b) Exclude Bookmarks you have not visited

places.frecency.unvisitedBookmarkBonus This preference set to 0 (zero) will remove the bookmarks you haven't visited from your results.

c) Exclude Bookmarks you have visited

places.frecency.bookmarkVisitBonus
This preference set to 0 (zero) will remove the bookmarks you have visited from your results.

d) Exclude URLS you have not visited

places.frecency.unvisitedTypedBonus
This setting will have the greatest impact on how your results are found.. A setting of 0 (zero) should give you a result of finding your URLs based on what you type being anywhere in the URL or page title. A setting of 1 should result in placing of what you type anywhere in the title or URL being first, followed by the URL or title beginning with what you type. A setting of 2 should result in only showing results based on what you type being at the beginning of the URL or page title.

e) Include only URLS you have typed

browser.urlbar.matchOnlyTyped Set to true

f) Changing order of Search

browser.urlbar.matchBehavior
This setting will have the greatest impact on how your results are found, regardless of what sort of results you remove from the ones available (which will be limited in following entries). I've not seen results as I'd expect from this setting yet, but I'm not done working with it. A setting of 0 (zero) should give you a result of finding your URLs based on what you type being anywhere in the URL or page title. A setting of 1 should result in placing of what you type anywhere in the title or URL being first, followed by the URL or title beginning with what you type. A setting of 2 should result in only showing results based on what you type being at the beginning of the URL or page title.

g) Enabling Inline Auto Complete

browser.urlbar.autoFill
Set this to TRUE to enable IE style Autocomplete in the Locationbar.

As I said, above, there is currently no way to make the Location bar behave exactly like Firefox 2 but I hope this guide helps...

Interesting posts for further reading.....

Assorted threads on the Location Bar topic ...
viewtopic.php?f=38&t=690695
viewtopic.php?f=38&t=670075
viewtopic.php?f=8&t=812285
viewtopic.php?f=7&t=673935

4.MINI TUTORIAL - Adding code snippets to userChrome.css and userContent files by Frank Lion

We can alter how Firefox looks or behaves by adding some code lines to files in your Firefox profile called userChrome.css. or userContent.css

In the following example, we will be adding a code snippet to userChrome.css

1. Using the information in the Knowledge Base links above, locate the chrome folder within your profile. If you have not edited your userChrome.css before, then you will see a file called userChrome-example.css in the chrome folder, together with userContent-example.css

2. Now, we can edit this file using any old editor, even Notepad or Wordpad. But, I suggest you use this program, Programmers Notepad. This will show the important parts in colour for you and if you go to Options/General/Default, will allow you to have line numbers, as well. This makes it easier for everybody to help you, if you ever get stuck.

3. Open the userChrome-example.css file with your editor of choice and unless otherwise directed, copy and paste your code snippet - just as it is written, below this line -

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

This is called the namespace line and you must not alter it.

4. Use 'Save As' to save your file as userChrome.css into the same chrome folder as the example one.

5. Finally, restart Firefox to see the result of all your work. Contrary to myth, Firefox does not need to be closed as you make these changes, but you must always restart to actually implement the changes.



Notes :

a.) If you later wish to disable a particular code snippet then just move the */ onto the end of the final line, like this :

OFF:

/*....Frank's Urlbar Yellow on FF3 https sites...
#urlbar[level] .autocomplete-textbox-container {
background-color: #FFFFB7 !important;
}*/


ON :

/*....Frank's Urlbar Yellow on FF3 https sites...*/
#urlbar[level] .autocomplete-textbox-container {
background-color: #FFFFB7 !important;
}


By moving that, */ ... we are telling the program just to ignore it. The ON stuff will be in colour in the P.Notepad and in black when it's OFF.


b.) If you think you have messed up anything, then just EXIT from your Editor - do not 'save'. It will all be as it was before.

________________________________________________________________________________________________

Thanks to Euchre, Recall, Bluefang, Frank Lion and everyone else for information used in this Guide...

Please PM me for corrections, omissions and additions you think are needed to this article.
I am locking this, as this is a Support Guide, not a Discussion thread.
Do not PM Me for Support....
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. -Albert Einstein

Please DO NOT PM me for support... Lets keep it on the board, so we can all learn.

trolly
Moderator

User avatar
 
Posts: 39908
Joined: August 22nd, 2005, 7:25 am

Post Posted July 19th, 2008, 1:06 pm

Seems a few more filters are going to be implemented.
https://bugzilla.mozilla.org/show_bug.cgi?id=395161

Another useful addon:
Hide unvisited.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

Return to Firefox Support


Who is online

Users browsing this forum: No registered users and 6 guests