Monday, April 24, 2006

Remove "Sort By Name" from your Firefox context menu

Earlier this month, I posted an entry complaining about how the context menu items "Reload Live Bookmark" and "Sort By Name" are too close to each other. After mistakenly sorting my Bookmarks Toolbar Folder yet again, I finally found a way to do something about it.

Disclaimer: Follow these instructions at your own risk. You may break your browser. Although I did not find an extension to do this, I'm pretty sure that using one would be a better approach than the one I'm taking here. If you are as annoyed as I was about this, then please, read on.

I couldn't find an extension for this, and I didn't dig too deep into the developers documentation, but I did find something in the chrome/browser.jar file. In order to remove the option you need to edit a file in that archive.
  1. Backup the file browser.jar before starting. You may screw something up and have to start over. You should find it in the chrome folder, found under the Firefox install directory.
  2. Unzip browser.jar to a temporary folder. This file is an uncompressed archive that you can open using a utility like WinZip.
  3. Find the file content/browser/bookmarks/bookmarks.js in the directory structure you just created from the archive. You'll want to edit this file.
  4. Find the case statement referring to the context menu for an item of type "Livemark". Search for the following text:

    case "Livemark":

    It should start on line 308 or thereabouts.
  5. On the next line, you'll see a list of commands. Find the text "bm_sortbyname", (complete with quotes and the trailing comma). Remove it and save the file.
  6. Re-create browser.jar by creating a ZIP file from your directory structure. Make sure not to use compression with the archive. After creating the ZIP file, rename it to browser.jar and copy it to chrome directory.
That's it. The entry for "Sort By Name" is now removed from the context menu that comes up when you right-click on a Live Bookmark. I do believe that this is probably not the best way to do this, as this file gets updated when you upgrade your browser. You may have to repeat the above steps after an upgrade to get rid of it again.

Hopefully this will be the last time I accidentally re-sort my Bookmarks Toolbar Folder.

Labels: , ,

13 Comments:

Anonymous Anonymous said...

Hey man, I tried but it didnt work. When opening the browser it was just a white screen. Is this written for Firefox 1.5.0.3?

SOmeone should make a firefox extension for this or something. That Sort by Name thingy is annoying!

Sun May 21, 09:56:00 AM PDT  
Blogger brad77 said...

I originally did this with version 1.5.0.2, but have since upgraded. The upgrade reset the menu, but I followed the above steps and was able to do it again. It does work with 1.5.0.3.

My first thoughts are that you may have created a compressed ZIP file. Is the new browser.jar the same size as your backup? It should be.

Could it be that you didn't save the relative path information in the new JAR?

Mon May 22, 07:09:00 PM PDT  
Anonymous dman said...

Thanks, that worked like a charm. I think I found Sort by Name almost as annoying as you did ;)

Fri Jun 09, 11:54:00 PM PDT  
Anonymous dman said...

oh, btw the new jar is 1KB larger than the old one (1079 vs 1078 KB), but everything seems to work ok. did it on 1.5.0.4

Fri Jun 09, 11:58:00 PM PDT  
Anonymous Anonymous said...

This hack doesn't seem to work in Firefox 2. Is there an updated method?

Tue Nov 21, 09:32:00 AM PST  
Anonymous Anonymous said...

I'm using Firefox 2.0 and this hack works just fine -- thanks! I swear I was accidentally sorting my bookmarks toolbar once a day.

Wed Dec 13, 08:53:00 AM PST  
Blogger Steve said...

This is an older thread but it is #1 in Google for 'sort firefox context menu' so I'll give it a shot. It sounds like this thread is referring to the right-click menu on the toolbar. I would like to know how to sort the right-click menu when clicking on a webpage. Can it be done? Thanks! Steve Best Consignment Shop Software

Fri Nov 02, 09:54:00 PM PDT  
Blogger Robin Seybold said...

This comment has been removed by the author.

Thu Nov 29, 04:54:00 AM PST  
Blogger Robin Seybold said...

Nice edit! I've sorted my RSS-feeds too many times..no more!

Thu Nov 29, 04:55:00 AM PST  
Anonymous Anonymous said...

Use this add on to reload all your tabs at once without clicking each one individually.

Should help your problem.

https://addons.mozilla.org/en-US/firefox/addon/2081

Sat Feb 16, 11:27:00 PM PST  
Blogger Michael Dryden said...

I had the exact issue you did, and your solution worked perfectly. Thanks :)

Thu Mar 20, 03:05:00 PM PDT  
Anonymous D Hollway said...

Hi, this problem has been bugging me for a long time - I've lost count of the number of times I've accidentally sorted my RSS bookmarks whilst trying to reload them. Your page was the top result in Google.. and I can see why. Worked perfectly in FF2.0.0.14. Let's hope it works in FF3 later this month :)

Thu Jun 12, 09:03:00 AM PDT  
Anonymous Anonymous said...

Thanks - works perfectly!

Fri Jun 13, 05:20:00 AM PDT  

Post a Comment

Links to this post:

Create a Link

<< Home