Firefox 4 menu button goes right

So, Firefox 4/Minefield pulled a fast one on me and instead of looking like it should, which is this:

Screenshot: Minefield with the new menu button on the left

it somehow, all on its own, ended up looking like this:

Screenshot: Minefield with the menu button on the right end of tab bar

As you see, the fancy new menu button has gotten itself on the right end of the tab bar. A subtle change which is trivial to correct using Firefox’s toolbar customization… except the Mozilla engineers in their infinite wisdom have decided that the menu button shan’t be moved.

Screenshot: Minefield's Toolbar Customization open. Menu button can't be moved.

Great. How the fuck am I supposed to fix this, then, without having to build a new profile from scratch?

Well, the trick is to kill the browser and then edit $YOURPROFILE/localstore.rdf. Find the line that says

currentset="appmenu-toolbar-button,tabbrowser-tabs,tabs-closebutton,alltabs-button,new-tab-button,tabview-button" />

but with the “appmenu-toolbar-button” misplaced or even missing entirely. Fix it so that it looks like the code above, with appmenu-toolbar-button first. Save the changes. Now restart the browser and hope for the best!

And no, removing appmenu-toolbar-button altogether won’t get rid of the menu button. It’s just one of the ways to trigger this issue.