Using window / utils , you can get the topmost browser window as nsIDOMWindow , then you can get the sidebar element of this window as an HTML element that allows you to change its CSS properties:
var utils = require('sdk/window/utils');
var win = utils.getMostRecentBrowserWindow();
if (utils.isBrowser (win))
{
var sidebar = win.document.getElementById ("sidebar");
sidebar.style.minWidth = "340px";
sidebar.style.width = "340px";
sidebar.style.maxWidth = "500px";
}
Please note that this will affect all sidebars of the top-most open firefox window (including bookmarks and sidebars);
source
share