Firefox always show menubar toolbar -
i working on firefox extension in have made various changes in browser.xul customize firefox's ui. default firefox has menu-bar disabled/invisible. want display menu-bar toolbar. fyi, have disabled right-click on toolbar shows context menu where-in 1 can make menu-bar visible or gone.
is there way 1 can make setting?
this isnt solution start of one.
option 1
figure out how set style sheet more importance 1 here:
it looks when inactive=true
attribute set on chrome://global/content/xul.css
line 289 gets css important of height 0. tried registering style sheet own height
this whats applied when `inactive=true` attribute on it: toolbar[type="menubar"][autohide="true"][inactive="true"]:not([customizing="true"]) { min-height: 0 !important; height: 0 !important; -moz-appearance: none !important; border-style: none !important; }
i tried importance not overriding this, page worth read, css order priority think can done this: http://hungred.com/useful-information/css-priority-order-tips-tricks/
i tried code wouldnt take more importance:
// globals cu.import('resource://gre/modules/services.jsm'); var sss = cc['@mozilla.org/content/style-sheet-service;1'].getservice(ci.nsistylesheetservice); try { sss.unregistersheet(cssuri, sss.author_sheet); } catch (ignore) {} var cssuri; var css = 'toolbar[type="menubar"][autohide="true"][inactive="true"]:not([customizing="true"]) { height: 50px !important; min-height: 50px !important;'; var newuriparam = { aurl: 'data:text/css,' + encodeuricomponent(css), aorigincharset: null, abaseuri: null }; var cssuri = services.io.newuri(newuriparam.aurl, newuriparam.aorigincharset, newuriparam.abaseuri); sss.loadandregistersheet(cssuri, sss.author_sheet);
i tried var css = '#toolbar-menubar[type="menubar"][autohide="true"][inactive="true"]:not([customizing="true"]) { height: 50px !important; min-height: 50px !important;';
notoice how used #toolbar-menubar
id instead of tag selector, id has highest importance, didnt work though kept selectivity after it.
option 2
mutation observer, whenever inactive=true gets attached, remove it. sure fire without thinking guranteed. think css option preferred gives better performance.
Comments
Post a Comment