Jup hab habe ich
CSS
(function() {
/*******************************************************************************/
if (location != 'chrome://browser/content/browser.xhtml') {
return;
}
/*******************************************************************************/
// Background Color
var vb_bg_color = 'rgba( 255 , 0 , 255 , 0.75 )';
// Border Color
var vb_border_color = 'rgb( 0 , 0 , 0 )';
// Number of columns
var vb_cols = 1;
// Visibility on Start
var vb_visibilityOnStart = 1;
// Button Icon, if Toolbar is visible
vb_isVisibleImage = 'url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="context-fill" d="M11.414 10l2.293-2.293a1 1 0 0 0 0-1.414 4.418 4.418 0 0 0-.8-.622L11.425 7.15h.008l-4.3 4.3v-.017l-1.48 1.476a3.865 3.865 0 0 0 .692.834 1 1 0 0 0 1.37-.042L10 11.414l3.293 3.293a1 1 0 0 0 1.414-1.414zm3.293-8.707a1 1 0 0 0-1.414 0L9.7 4.882A2.382 2.382 0 0 1 8 2.586V2a1 1 0 0 0-1.707-.707l-5 5A1 1 0 0 0 2 8h.586a2.382 2.382 0 0 1 2.3 1.7l-3.593 3.593a1 1 0 1 0 1.414 1.414l12-12a1 1 0 0 0 0-1.414zm-9 6a4.414 4.414 0 0 0-1.571-1.015l2.143-2.142a4.4 4.4 0 0 0 1.013 1.571 4.191 4.191 0 0 0 .9.684L6.39 8.2a4.2 4.2 0 0 0-.683-.907z"></path></svg>\')';
// Button Icon, if Toolbar is hidden
vb_isHiddenImage = 'url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="context-fill" d="M14.707 13.293L11.414 10l2.293-2.293a1 1 0 0 0 0-1.414A4.384 4.384 0 0 0 10.586 5h-.172A2.415 2.415 0 0 1 8 2.586V2a1 1 0 0 0-1.707-.707l-5 5A1 1 0 0 0 2 8h.586A2.415 2.415 0 0 1 5 10.414v.169a4.036 4.036 0 0 0 1.337 3.166 1 1 0 0 0 1.37-.042L10 11.414l3.293 3.293a1 1 0 0 0 1.414-1.414zm-7.578-1.837A2.684 2.684 0 0 1 7 10.583v-.169a4.386 4.386 0 0 0-1.292-3.121 4.414 4.414 0 0 0-1.572-1.015l2.143-2.142a4.4 4.4 0 0 0 1.013 1.571A4.384 4.384 0 0 0 10.414 7h.172a2.4 2.4 0 0 1 .848.152z"></path></svg>\')';
/*******************************************************************************/
var vb_h = window.outerHeight;
var vb_minH = vb_h/10;
var vb_maxH = vb_h/2;
var vb_width = 32;
var vb_totalwidth = vb_cols * vb_width;
var vb_style = '\
box-sizing: content-box !important; \
background-color: ' + vb_bg_color + ' !important; \
min-width: ' + vb_totalwidth + 'px !important; \
max-width: ' + vb_totalwidth + 'px !important; \
min-height: ' + vb_minH + 'px !important; \
max-height: ' + vb_maxH + 'px !important; \
position: absolute !important; \
right: 30px !important; \
padding: 10px 0px !important; \
border: 1px solid ' + vb_border_color + '; \
border-radius: 5px !important; \
box-shadow: 0px 0px 2px 2px rgba(0,0,0,.25); \
';
var vb_element = document.getElementById('navigator-toolbox');
var vb_toolbar = document.createElement('toolbar');
vb_toolbar.id = 'fp-toolbar';
vb_toolbar.setAttribute('customizable', true);
vb_toolbar.setAttribute('mode', 'icons');
vb_toolbar.setAttribute('style', vb_style);
vb_element.appendChild( vb_toolbar );
vb_toolbar.setAttribute('collapsed', false);
CustomizableUI.registerArea( 'fp-toolbar' , { legacy: true } );
CustomizableUI.registerToolbarNode(vb_toolbar);
setTimeout(function(){
var tmp_positionInfo = vb_toolbar.getBoundingClientRect();
var tmp_height = tmp_positionInfo.height;
var vb_ptop = ( vb_h - tmp_height ) / 2;
vb_toolbar.style.top = vb_ptop + 'px';
if( vb_visibilityOnStart == 0 ) {
vb_toolbar.setAttribute('collapsed', true);
}
}, 500);
/*******************************************************************************/
try {
Components.utils.import("resource:///modules/CustomizableUI.jsm");
CustomizableUI.createWidget({
id: "fp-toggle-toolbar",
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: "Toggle Toolbar",
tooltiptext: "Toggle Toolbar",
onClick: function() {
var node = document.getElementById('fp-toolbar');
var isVisible = node.getAttribute('collapsed');
if( isVisible == 'false' ) {
node.setAttribute( 'collapsed' , 'true' );
document.getElementById(this.id).style.listStyleImage = vb_isHiddenImage;
} else {
node.setAttribute( 'collapsed' , 'false' );
document.getElementById(this.id).style.listStyleImage = vb_isVisibleImage;
}
},
onCreated: function(aNode) {
if( vb_visibilityOnStart == 1 ) {
aNode.style.listStyleImage = vb_isVisibleImage;
} else {
aNode.style.listStyleImage = vb_isHiddenImage;
}
return aNode;
}
});
} catch (e) {
Components.utils.reportError(e);
};
/*******************************************************************************/
})();
Alles anzeigen