firefoxfirefox-addonxul

How to Increase Firefox Sidebar Width


I coded a sidebar for Firefox like the History and Bookmarks sidebar. In a fresh profile, if I install my add-on and open up the sidebar, the sidebar width gets 216px as default value. But if I grip the right side of the sidebar and drag to right, its width can get to 432px but not more.

How can I set my sidebar's width as 432px as my add-on's default sidebar width?


Solution

  • It's not really documented, but it can be achieved like this:

    var sidebar = ui.Sidebar({ ... });
    sidebar.show();
    
    var window = require('window/utils').getMostRecentBrowserWindow();
    window.document.getElementById('sidebar').style.width = "400px";