Search code examples
firefox-addonfirefox-addon-sdk

Creating a Firefox add-on with a sidebar on the right hand side


I'm trying to edit Daniel Buchner's sidebar library so that the sidebar shows up on the right hand side. Do I do something along the lines of the following?

sidebar.browser.style.MozBoxDirection = 'reverse';


Solution

  • Your approach doesn't work because you would need to change the direction of the sidebar's parent box, not its children. However, that would cause unnecessary fallout (like the default sidebar appearing on the right side and developer tools on the left). So it is better to solve the problem by changing this line:

    document.getElementById('browser').insertBefore(clone, splitter);
    

    Instead of inserting your sidebar on the left side you can use appendChild to add it to the end of the container. You will also have to add your own splitter however - you can clone the sidebar splitter and change its ID.