{"id":351,"date":"2007-03-30T09:34:57","date_gmt":"2007-03-30T15:34:57","guid":{"rendered":"http:\/\/blog.codedread.com\/archives\/2007\/03\/30\/a-little-tweak-to-firefox-2-search-bar\/"},"modified":"2007-03-30T09:34:57","modified_gmt":"2007-03-30T15:34:57","slug":"a-little-tweak-to-firefox-2-search-bar","status":"publish","type":"post","link":"https:\/\/www.codedread.com\/blog\/archives\/2007\/03\/30\/a-little-tweak-to-firefox-2-search-bar\/","title":{"rendered":"A Little Tweak To Firefox 2 Search Bar"},"content":{"rendered":"<p>About a year ago, <a href=\"http:\/\/blog.codedread.com\/archives\/2006\/04\/10\/polishing-firefox-chrome\/\">I posted<\/a> my technique for configuring the search bar in Firefox 1.5, complaining that it was far too small in the default UI layout that comes with the web browser.  In fact, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=205011\">this bug<\/a> still exists today and has 280 votes.  But then again, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=18574#c624\">your vote doesn't matter<\/a>.  Anyway, Firefox 2 alleviated the hacking that I had to do to get the search bar to expand to fill up remaining space.  There's just one tweak in Firefox 2 that I still need for perfect search bar nirvana.<!--more--><\/p>\n<p>This is what I do with the search bar:  As described <a href=\"http:\/\/blog.codedread.com\/archives\/2006\/04\/10\/polishing-firefox-chrome\/\">here<\/a>, I move the search bar to the menu bar (yep, immediately to the right of the \"Help\" menu in Windows).  This means that both the Location bar (where you type your web addresses) and the Search bar (where you type your Google\/Yahoo\/MSN searches) have room to breath by expanding to fill in any space in that toolbar strip.  It's a simple matter of going to View > Toolbars > Customize and then dragging the search bar where you want it.<\/p>\n<p><script type=\"text\/javascript\" src=\"http:\/\/www.codedread.com\/googleads.js\"><\/script><br \/>\n<script type=\"text\/javascript\" src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\"><\/script><\/p>\n<p>That being said, I still have one problem with it.  Occasionally, I'll want to recall a recent search.  Unlike the Location Bar, the Search Bar does not have a visible pull-down arrow that shows you how to see previous search history.  You can use the arrow keys to access this pull-down list, but that is not obvious to new users - and generally speaking, the reason I want to pick an old search from my history is because <em>I'm too lazy to re-type it in the first place<\/em>, so Firefox - don't force me to access the keyboard!<\/p>\n<p>Anyway, it's easily fixable by hacking a little chrome.  Here are the revised steps that apply for Firefox 2:<\/p>\n<h3>Unroll The Browser Chrome<\/h3>\n<ul>\n<li>Open a terminal session (Windows users can go to Start > Programs > Accessories > Command Prompt).<\/li>\n<li>Navigate to the location of your Firefox install (for example, C:\\Program Files\\Mozilla Firefox\\)<\/li>\n<li>Change to the \"chrome\" subdirectory<\/li>\n<li>In the chrome subdirectory, type the following: <span style=\"font-weight:bold;background-color:#DDD;margin:2px;padding:1px;\">jar xvf browser.jar<\/span><br \/>\nThis will unroll the browser chrome <span class=\"definition\" title=\"Java ARchive\">JAR<\/span> file into a \"content\" subdirectory.<\/li>\n<\/ul>\n<p>For those of you that don't have a Java Runtime Environment (JRE) installed, you can use WinZip or a similar tool to find the browser.jar file and extract it.<\/p>\n<h3>Modify The Chrome<\/h3>\n<ul>\n<li>Edit the file content\/browser\/search\/search.xml<\/li>\n<li>Find the xul:textbox with class=\"searchbar-textbox\" and add the following attribute to it: <span style=\"font-weight:bold;background-color:#DDD;margin:2px;padding:1px\">enablehistory=\"true\"<\/span><\/li>\n<li>While you're at it, modify the maxrows attribute to something more useful than 10 (like 20, for instance).<\/li>\n<\/ul>\n<h3>Roll Up The Chrome<\/h3>\n<ul>\n<li>Navigate back to the chrome subdirectory<\/li>\n<li>Re-zip up the chrome files by typing:  <span style=\"font-weight:bold;background-color:#DDD;margin:2px;padding:1px\">jar cvf browser-new.jar content\/*<\/span><br \/>\nThis will create a new file called browser-new.jar<\/li>\n<li>Close all instances of Firefox<\/li>\n<li>Swap the browser JAR files.  For Windows users type:<br \/>\n<span style=\"font-weight:bold;background-color:#DDD;margin:2px;padding:1px\">rename browser.jar browser-old.jar<br \/>\nrename browser-new.jar browser.jar<\/span><\/li>\n<\/ul>\n<p>That last step will ensure that you backup your old chrome file (now called browser-old.jar).  This is always recommended, because if you screw something up you can always restore it.<\/p>\n<p>For those without a JRE installed, you'll have to use Winzip or a similar utility to recreate the JAR file.  In WinZip, you can right-click the content\" folder, choose WinZip > Add to content.zip.  Then rename content.zip to browser.jar (once you've backed up your older browser.jar file).<\/p>\n<h3>Conclusion<\/h3>\n<p>Now test things out by bringing up Firefox.  You should see a little pull-down arrow in your search bar that works as expected.  If you've done something wrong, then you can undo by simply closing Firefox and restoring your old chrome file.<\/p>\n<p>In fact, I've submitted this as an alternative one-line patch to <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=264199\">Bug 264199<\/a>.  Let's see what the module owners say.<\/p>\n<p><script type=\"text\/javascript\" src=\"http:\/\/www.codedread.com\/googleads.js\"><\/script><br \/>\n<script type=\"text\/javascript\" src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>About a year ago, I posted my technique for configuring the search bar in Firefox 1.5, complaining that it was far too small in the default UI layout that comes with the web browser. In fact, this bug still exists today and has 280 votes. But then again, your vote doesn&#8217;t matter. Anyway, Firefox 2 [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35,25,11,14,28],"tags":[],"class_list":["post-351","post","type-post","status-publish","format-standard","hentry","category-firefox","category-software","category-technology","category-tips","category-web"],"_links":{"self":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts\/351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/comments?post=351"}],"version-history":[{"count":0,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts\/351\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/media?parent=351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/categories?post=351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/tags?post=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}