- Firefox-Version
- 138 und 140
- Betriebssystem
- Windows 11 Pro
Das folgende Skript funktioniert nicht mehr richtig - allerdings nur in neuen Profilen. In bestehenden Profilen, egal ob Release oder Nightly, läuft es einwandfrei.
Kann das jemand bestätigen? Problem tritt hier auf zwei Rechnern mit Win11Pro auf. Wäre toll, wenn das wieder gangbar gemacht werden könnte...
Danke schon mal vorab.
JavaScript
(function() {
if (location != 'chrome://browser/content/browser.xhtml') {
return;
}
/*******************************************************************************/
// Config-Bereich
// Background Color
var vb_bg_color = 'rgb(40,40,42)';
// Border Color
var vb_border_color = 'rgb(0,128,0)';
// Number of columns
var vb_cols = 1;
// Sichtbarkeit beim Start (0-> Aus 1-> An)
var vb_visibilityOnStart = 1;
// Button Icon, if Toolbar is visible
vb_isVisibleImage = 'url("file:///F:/ICONS/FF/pin-grün.png")';
// Button Icon, if Toolbar is hidden
vb_isHiddenImage = 'url("file:///F:/ICONS/FF/pin-rot.png")';
/*******************************************************************************/
var vb_h = window.outerHeight;
var vb_minH = vb_h/20;
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: 60px !important; \
padding: 5px 0 !important; \
border: 2px ridge ' + vb_border_color + '; \
border-radius: 10px !important; \
z-index: 3 !important; \
';
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");
ChromeUtils.importESModule("resource:///modules/CustomizableUI.sys.mjs");
CustomizableUI.createWidget({
id: "fp-toggle-toolbar",
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: "Vertical Toolbar",
tooltiptext: "Vertical Toolbar",
onClick: function() {
var node = document.getElementById('fp-toolbar');
var isCollapsed = node.getAttribute('collapsed');
if( isCollapsed == 'false' ) {
node.setAttribute( 'collapsed' , 'true' );
node.style.visibility = 'collapse';
document.getElementById(this.id).style.listStyleImage = vb_isHiddenImage;
} else {
node.setAttribute( 'collapsed' , 'false' );
node.style.visibility = 'visible';
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
Ergänzung: Eigentlich wird die Toolbar korrekt erzeugt und auch der Button zum Ein-/Ausblenden ist vorhanden. Allerdings ist die Toolbar ausschließlich im Modus "Symbolleiste anpassen" sichtbar. Sobald das Fenster allerdings geschlossen wird, ist die Leiste unsichtbar. Eine Erhöhung des z-index per CSS brachte da auch keine Abhilfe...