Spiel mal mit dem 1. Wert in Zeile 47...
Das ist jetzt aber an Boersenfeger gerichtet, richtig?
Spiel mal mit dem 1. Wert in Zeile 47...
Das ist jetzt aber an Boersenfeger gerichtet, richtig?
Ich schau mir das später nochmal an - jetzt ist Tour de France dran... ![]()
Bei mir dann ab 1800 Uhr das Testspiel meiner Eintracht in Österreich
Boersenfeger Schau Dir doch mal das korrigierte Skript an.
Dann teste mal folgende Skript-Version (das CSS von oben nicht vergessen):
Das sieht doch schon ganz gut aus, Dankeschön.
Wenn keine Lesezeichen vorhanden sind, sondern nur weitere Ordner mit Lesezeichen wäre eine 0 als Zähler für eine saubere Einrückung nicht schlecht, siehe Grafiken, das gleiche Ergebnis ergibt sich auch ohne meine vorhandenen Anpassungen.
Siehe oben den Ordner shorts, in dem sind nur Ordner mit Lesezeichen vorhanden, keine Lesezeichen direkt in shorts.
Siehe hier die vollständig fehlende Anzeige von Ordnern und Lesezeichen.
auch mit diesen Werten tut sich bei der 1. Zahl nix

Teste bitte mal.
In Zeile 46 alles auf 0
Danke, jetzt passt es. 😃
Mira_Belle Sorry, wir reden hier über das Script aus #6 und nicht über deins, das war hier auch überhaupt kein Thema. Es ist schlicht verwirrend, wenn du es ohne Not hier einbringen möchtest. Danke für dein Verständnis!
Danke, jetzt passt es
![]()
![]()
In Zeile 46 alles auf 0
Ah, dann bin ich vorhin in der falschen Zeile gelandet. Schön, wenn es jetzt paßt.
@Dharkness: Da muß wohl eine Änderung am Skript erfolgen. Da bin ich dann überfragt. Ich habe diesen Fall bei mir nicht, deswegen war mir das noch nicht aufgefallen.
Ich nutze das folgende Script, wenn du dort die Zeilen 174 bis 183 auskommentierst, dann hast du das Ergebnis:

// basiert auf Sript von BrokenHeart
// Firefox 154+
(function() {
if (!window.gBrowser)
return;
setTimeout(function() {
setFunction();
}, 50);
// Custom icons in profile/chrome/icons folder
let ProfilePath = PathUtils.toFileURI(PathUtils.join(PathUtils.profileDir, 'chrome', 'icons'));
let icon1 = "Ordner.png";
let icon2 = "Bild36.png";
let cs_font_size = 12;
let cs_font_weight = 700;
let cs_font_color = "blue";
// Fix: feste Spaltenbreite (anpassen, wenn du mehrstellig erwartest)
let colWidthCh = 4;
function setFunction() {
const css = `
#bmContent {
font-family: "Courier New", monospace !important;
font-size: ${cs_font_size}px !important;
font-weight: ${cs_font_weight} !important;
display: flex !important;
align-items: center !important;
justify-content: flex-end !important;
/* nach rechts drücken innerhalb von menu-text */
margin-left: auto !important;
height: 16px !important;
white-space: nowrap !important;
margin-top: -14px !important;
}
.bmIcon1 {
width: 16px;
height: 16px;
background: url("${ProfilePath}/${icon1}") no-repeat center;
background-size: 16px 16px;
/* Icon kommt NACH dem Wert => Abstand links ist das relevante */
margin-left: 6px;
margin-right: 0;
margin-top: -2px;
flex: 0 0 auto;
}
.bmIcon2 {
width: 16px;
height: 16px;
background: url("${ProfilePath}/${icon2}") no-repeat center;
background-size: 12px 12px;
margin-left: 6px;
margin-right: 0;
margin-top: -2px;
flex: 0 0 auto;
}
.bmValue {
color: ${cs_font_color} !important;
flex: 0 0 auto;
min-width: ${colWidthCh}ch; /* gleiche Flucht über Zeilen */
text-align: right;
}
.bmSlash {
color: ${cs_font_color} !important;
margin-left: 3px !important;
margin-right: -7px !important;
}
/* Hover-Farbwechsel */
menupopup[placespopup="true"] > menu.bookmark-item:hover > .menu-text > #bmContent .bmValue {
color: red !important;
fill: red !important;
}
menupopup[placespopup="true"] > menu.bookmark-item:hover > .menu-text > #bmContent .bmSlash {
color: #000 !important;
fill: #000 !important;
}
`;
const sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
const uri = Services.io.newURI('data:text/css,' + encodeURIComponent(css));
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
let bookMenu = document.getElementById('bookmarksMenu');
let persToolBar = document.getElementById('PersonalToolbar');
if (bookMenu) {
bookMenu.addEventListener('popupshown', onPopupShowing);
}
if (persToolBar) {
persToolBar.addEventListener('popupshowing', onPopupShowing);
}
}
function onPopupShowing(aEvent) {
let popup = aEvent.originalTarget;
for (let item of popup.children) {
if (item.localName != 'menu' || item.id?.startsWith('history'))
continue;
setTimeout(() => {
let itemPopup = item.menupopup;
itemPopup.hidden = true;
itemPopup.collapsed = true;
itemPopup.openPopup();
itemPopup.hidePopup();
let menuitemCount = 0;
let menuCount = 0;
for (let subitem of itemPopup.children) {
if (subitem.classList.contains('bookmark-item') && !subitem.disabled && !subitem.hidden) {
if (subitem.localName == 'menuitem') {
menuitemCount++;
} else if (subitem.localName == 'menu') {
menuCount++;
}
}
}
itemPopup.hidden = false;
itemPopup.collapsed = false;
let bmCounta = item.childNodes[1];
bmCounta.innerHTML = "";
let bmContent = document.createElement("bmContent");
bmContent.id = "bmContent";
let strCountOut1 = menuCount; // Ordner
let strCountOut2 = menuitemCount; // Lesezeichen
// DOM: value1 + Icon1 + "/" + value2 + Icon2
let v1 = document.createElement("span");
v1.className = "bmValue";
v1.textContent = strCountOut1;
let icon1El = document.createElement("span");
icon1El.className = "bmIcon1";
let slash = document.createElement("span");
slash.className = "bmSlash";
slash.textContent = "/"; // ohne Leerzeichen
let v2 = document.createElement("span");
v2.className = "bmValue";
v2.textContent = strCountOut2;
let icon2El = document.createElement("span");
icon2El.className = "bmIcon2";
// Ausblenden-Logik: Wenn ein Zähler 0 ist, alles rechts davon konsequent ausblenden
if (strCountOut1 === 0) {
v1.style.display = "none";
icon1El.style.display = "none";
slash.style.display = "none";
}
if (strCountOut2 === 0) {
v2.style.display = "none";
icon2El.style.display = "none";
slash.style.display = "none";
}
bmContent.appendChild(v1);
bmContent.appendChild(icon1El);
bmContent.appendChild(slash);
bmContent.appendChild(v2);
bmContent.appendChild(icon2El);
bmCounta.appendChild(bmContent);
}, 100);
}
}
})();
Alles anzeigen
Ich nutze das folgende Script, wenn du dort die Zeilen 174 bis 183 auskommentierst, dann hast du das Ergebnis:
Hallo FuchsFan,
jupp, das funktioniert hier mit einer kleinen Änderung so, wie ich es haben möchte, Dankeschön dafür.
das funktioniert hier mit einer kleinen Änderung so, wie ich es haben möchte
Prima, dann passt es.![]()
Hallo zusammen.
Ich benutze das Script aus #32, Habe es für mich angepasst.
Nur leider habe ich unter Menüleiste- Lesezeichen eine Überlagerung.
Siehe Bild:
Hier mein verwendete Version:
// basiert auf Sript von BrokenHeart
// Firefox 154+
(function() {
if (!window.gBrowser)
return;
setTimeout(function() {
setFunction();
}, 50);
// Custom icons in profile/chrome/icons folder
let ProfilePath = PathUtils.toFileURI(PathUtils.join(PathUtils.profileDir, 'chrome', 'icons'));
let icon1 = "folder.png";
let icon2 = "sidebar-lesezeichen.png";
let cs_font_size = 16;
let cs_font_weight = 700;
let cs_font_color = "red";
// Fix: feste Spaltenbreite (anpassen, wenn du mehrstellig erwartest)
let colWidthCh = 4;
function setFunction() {
const css = `
#bmContent {
font-family: "Courier New", monospace !important;
font-size: ${cs_font_size}px !important;
font-weight: ${cs_font_weight} !important;
display: flex !important;
align-items: center !important;
justify-content: flex-end !important;
/* nach rechts drücken innerhalb von menu-text */
margin-left: auto !important;
height: 16px !important;
white-space: nowrap !important;
margin-top: -14px !important;
}
.bmIcon1 {
width: 18px;
height: 18px;
background: url("${ProfilePath}/${icon1}") no-repeat center;
background-size: 16px 16px;
/* Icon kommt NACH dem Wert => Abstand links ist das relevante */
margin-left: 6px;
margin-right: 0;
margin-top: -2px;
flex: 0 0 auto;
}
.bmIcon2 {
width: 18px;
height: 18px;
background: url("${ProfilePath}/${icon2}") no-repeat center;
background-size: 12px 12px;
margin-left: 6px;
margin-right: 0;
margin-top: -2px;
flex: 0 0 auto;
}
.bmValue {
color: ${cs_font_color} !important;
flex: 0 0 auto;
min-width: ${colWidthCh}ch; /* gleiche Flucht über Zeilen */
text-align: right;
}
.bmSlash {
color: ${cs_font_color} !important;
margin-left: 3px !important;
margin-right: -7px !important;
}
/* Hover-Farbwechsel */
menupopup[placespopup="true"] > menu.bookmark-item:hover > .menu-text > #bmContent .bmValue {
color: red !important;
fill: red !important;
}
menupopup[placespopup="true"] > menu.bookmark-item:hover > .menu-text > #bmContent .bmSlash {
color: #000 !important;
fill: #000 !important;
}
`;
const sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
const uri = Services.io.newURI('data:text/css,' + encodeURIComponent(css));
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
let bookMenu = document.getElementById('bookmarksMenu');
let persToolBar = document.getElementById('PersonalToolbar');
if (bookMenu) {
bookMenu.addEventListener('popupshown', onPopupShowing);
}
if (persToolBar) {
persToolBar.addEventListener('popupshowing', onPopupShowing);
}
}
function onPopupShowing(aEvent) {
let popup = aEvent.originalTarget;
for (let item of popup.children) {
if (item.localName != 'menu' || item.id?.startsWith('history'))
continue;
setTimeout(() => {
let itemPopup = item.menupopup;
itemPopup.hidden = true;
itemPopup.collapsed = true;
itemPopup.openPopup();
itemPopup.hidePopup();
let menuitemCount = 0;
let menuCount = 0;
for (let subitem of itemPopup.children) {
if (subitem.classList.contains('bookmark-item') && !subitem.disabled && !subitem.hidden) {
if (subitem.localName == 'menuitem') {
menuitemCount++;
} else if (subitem.localName == 'menu') {
menuCount++;
}
}
}
itemPopup.hidden = false;
itemPopup.collapsed = false;
let bmCounta = item.childNodes[1];
bmCounta.innerHTML = "";
let bmContent = document.createElement("bmContent");
bmContent.id = "bmContent";
let strCountOut1 = menuCount; // Ordner
let strCountOut2 = menuitemCount; // Lesezeichen
// DOM: value1 + Icon1 + "/" + value2 + Icon2
let v1 = document.createElement("span");
v1.className = "bmValue";
v1.textContent = strCountOut1;
let icon1El = document.createElement("span");
icon1El.className = "bmIcon1";
let slash = document.createElement("span");
slash.className = "bmSlash";
slash.textContent = ""; // ohne Leerzeichen
let v2 = document.createElement("span");
v2.className = "bmValue";
v2.textContent = strCountOut2;
let icon2El = document.createElement("span");
icon2El.className = "bmIcon2";
bmContent.appendChild(v1);
bmContent.appendChild(icon1El);
bmContent.appendChild(slash);
bmContent.appendChild(v2);
bmContent.appendChild(icon2El);
bmCounta.appendChild(bmContent);
}, 100);
}
}
})();
Alles anzeigen
Lässt sich das eventuell anpassen.
Mfg.
Endor
Dann grätscht da was dazwischen.
Melde mich gleich.
Mfg.
Endor
Das liegt an diesem Script von @jeez - benzBrake zur Mehrspaltigen Anzeige
der Lesezeichen:
// ==UserScript==
// @name BMMultiColumn.uc.js
// @description Lesezeichenmenü automatisch in Spalten anzeigen (zuerst nach oben und unten, dann nach links und rechts).
// @author Ryan, ding
// @include main
// @charset UTF-8
// @version 2026.08.10
// @compatibility Firefox 153
// @async
// @shutdown window.BMMultiColumn.destroy();
// @homepageURL https://github.com/benzBrake/FirefoxCustomize/blob/master/userChromeJS
// @note 2026.08.10 Das Problem der wiederholten Zerstörung während des Hot-Reloads des Loaders wurde behoben, und es wurde verhindert, dass die vorzeitige Abmeldung gemeinsam genutzter Stile und die verzögerte Bereinigung neue Instanzen in Umgebungen mit mehreren Fenstern verunreinigten.
// @note 2026.04.09 Kompatibel mit den neuen Firefox-Regeln für die Breite des
// @note Lesezeichenmenüs; behebt ein Problem, bei dem mehrspaltige
// @note Lesezeichentitel nach dem Aufklappen nicht vollständig angezeigt wurden.
// @note 2025.07.03 Problem, dass das Überlaufmenüs der Lesezeichen-Symbolleiste nicht vollständig angezeigt wurde, behoben #50
// @note 2025.05.13 Optimiertes horizontales Scrollen dank ylcs006
// @note 2025.03.27 Behobene Höhen-/Breitenverwechselung, die zu einer Breitenanomalie führte, Unterstützung für vertikales Scrollrad
// @note 2025.02.19 fx133
// @note 2024.10.18 fx131
// @note 2024.10.07 fx131
// @note 2024.04.20 Fehler in der UC-Umgebung behoben, Hauptkommentar @include wurde nicht unterstützt
// @note 2022.12.22 Integrieren Sie bookmarksmenu_scrollbar.uc.js, um den Fehler zu beheben, dass die horizontale Bildlaufleiste auch dann angezeigt wird, wenn die maximale Breite nicht überschritten wird, und unterstützen Sie das Lesezeichenmenü des Hauptmenüs
// @note 2022.12.17 Anomalie der festen Breite. Wenn sich zu viele Lesezeichen in der Leiste befinden, kann sie nicht horizontal scrollen. Mit Script bookmarksmenu_scrollbar.uc.js abhilfe schaffen
// @note 2022.11.19 fx 108 Anpassung
// @note 2022.09.02 Fehler, dass das Menü die Anpassung der Breite verzögerte, wurde behoben
// @note Randprobleme behoben, Überlaufmenü der Lesezeichen-Symbolleiste wird unterstützt
// @note Problem wurde behoben, bei dem die Aktivierung manchmal fehlschlug
// @note Kompatibel mit Firefox 57+
// @ignorecache
// ==/UserScript==
location.href.startsWith("chrome://browser/content/browser.x") && (function (css) {
function uninitBMMultiColumn (instance) {
for (let i = 0; i < instance.menupopup.length; i++) {
clearInterval(instance.timer[i]);
instance.timer[i] = null;
const menupopup = document.getElementById(instance.menupopup[i]);
if (!menupopup) continue;
instance.resetPopup(menupopup);
menupopup.removeEventListener('popupshowing', instance, false);
menupopup.removeEventListener('DOMMenuItemActive', instance, false);
}
}
function hasOtherBMMultiColumnWindow () {
const windows = Services.wm.getEnumerator("navigator:browser");
while (windows.hasMoreElements()) {
const win = windows.getNext();
if (win !== window && win.BMMultiColumn && !win.BMMultiColumn._destroyed) {
return true;
}
}
return false;
}
function destroyBMMultiColumn (instance) {
if (!instance || instance._destroyed) return;
instance._destroyed = true;
window.removeEventListener('unload', instance, false);
window.removeEventListener("aftercustomization", instance, false);
if (window.BMMultiColumn === instance) {
delete window.BMMultiColumn;
}
uninitBMMultiColumn(instance);
if (!hasOtherBMMultiColumnWindow()
&& instance.style
&& instance.sss.sheetRegistered(instance.style, instance.sss.AUTHOR_SHEET)) {
instance.sss.unregisterSheet(instance.style, instance.sss.AUTHOR_SHEET);
}
instance.style = null;
}
destroyBMMultiColumn(window.BMMultiColumn);
window.BMMultiColumn = {
_destroyed: false,
menupopup: ["historyMenuPopup",
"bookmarksMenuPopup",
'PlacesToolbar',
'BMB_bookmarksPopup'],
timer: [],
count: [],
sss: Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService),
init: function () {
this.style = makeURI('data:text/css;charset=UTF=8,' + encodeURIComponent(css));
if (!this.sss.sheetRegistered(this.style, this.sss.AUTHOR_SHEET)) {
this.sss.loadAndRegisterSheet(this.style, this.sss.AUTHOR_SHEET);
}
window.removeEventListener("load", this, false);
window.addEventListener('unload', this, false);
window.addEventListener("aftercustomization", this, false);
this.delayedStartup();
},
delayedStartup: function () {
if (this._destroyed) return;
//wait till construction of bookmarksBarContent is completed.
for (var i = 0; i < this.menupopup.length; i++) {
clearInterval(this.timer[i]);
this.count[i] = 0;
this.timer[i] = setInterval(function (self, i) {
if (self._destroyed || ++self.count[i] > 50 || document.getElementById(self.menupopup[i])) {
clearInterval(self.timer[i]);
var menupopup = document.getElementById(self.menupopup[i]);
if (!self._destroyed && menupopup) {
menupopup.addEventListener('popupshowing', self, false);
menupopup.addEventListener('DOMMenuItemActive', self, false);
}
}
}, 250, this, i);
}
},
uninit: function () {
uninitBMMultiColumn(this);
},
destroy () {
destroyBMMultiColumn(this);
},
hasOtherActiveWindow () {
return hasOtherBMMultiColumnWindow();
},
handleEvent (event) {
if (this._destroyed) return;
switch (event.type) {
case 'popupshowing':
let menupopup;
if (event.target.tagName == 'menu' || event.target.tagName == 'toolbarbutton') {
menupopup = event.target.menupopup;
} else if (event.target.tagName == 'menupopup') {
menupopup = event.target;
} else return;
this.initHorizontalScroll(event);
if (menupopup.id === "PlacesChevronPopup") {
setTimeout(_ => {
if (!this._destroyed) {
this.initMultiColumn(menupopup, event);
}
}, 10);
} else {
this.initMultiColumn(menupopup, event);
}
break;
case 'aftercustomization':
setTimeout(() => this.delayedStartup(), 0);
break;
case 'unload':
this.destroy();
break;
}
},
initHorizontalScroll (event) {
let scrollBox = event.originalTarget.scrollBox;
scrollBox.scrollbox.style.setProperty("overflow-y", "auto", "important");
scrollBox.scrollbox.style.setProperty("margin-top", "0", "important");
scrollBox.scrollbox.style.setProperty("margin-bottom", "0", "important");
scrollBox.scrollbox.style.setProperty("padding-top", "0", "important");
scrollBox.scrollbox.style.setProperty("padding-bottom", "0", "important");
// Scroll-Tasten nach oben und unten
event.originalTarget.on_DOMMenuItemActive = function (event) {
/*
if (super.on_DOMMenuItemActive) {
super.on_DOMMenuItemActive(event);
}
*/
let elt = event.target;
if (elt.parentNode != this) {
return;
}
if (window.XULBrowserWindow) {
let placesNode = elt._placesNode;
var linkURI;
if (placesNode && PlacesUtils.nodeIsURI(placesNode)) {
linkURI = placesNode.uri;
} else if (elt.hasAttribute("targetURI")) {
linkURI = elt.getAttribute("targetURI");
}
if (linkURI) {
window.XULBrowserWindow.setOverLink(linkURI);
}
}
}.bind(event.originalTarget);
scrollBox._scrollButtonUp.style.display = "none";
scrollBox._scrollButtonDown.style.display = "none";
},
initMultiColumn (menupopup) {
menupopup.style.maxWidth = "calc(100vw - 20px)";
let arrowscrollbox = menupopup.shadowRoot.querySelector("::part(arrowscrollbox)");
let scrollbox = arrowscrollbox.shadowRoot.querySelector('[part~=scrollbox]');
if (scrollbox) {
Object.assign(scrollbox.style, {
minHeight: "21px",
height: "auto",
display: "flex",
flexFlow: "column wrap",
// overflow: "-moz-hidden-unscrollable",
width: "unset",
scrollSnapType: "x mandatory",
});
arrowscrollbox.style.width = "auto";
arrowscrollbox.style.maxHeight = "calc(100vh - 129px)";
let slot = scrollbox.querySelector('slot');
slot.style.display = "contents";
let maxWidth = calcWidth(-129);
let columnWidth = getColumnWidth(menupopup, maxWidth);
for (let item = menupopup.firstElementChild; item; item = item.nextElementSibling) {
if (!item.matches?.("menu, menuitem, menuseparator")) {
continue;
}
item.style.setProperty("min-width", "0", "important");
item.style.setProperty("max-width", columnWidth + "px", "important");
item.style.setProperty("width", columnWidth + "px", "important");
}
if (maxWidth < scrollbox.scrollWidth) {
scrollbox.style.setProperty("overflow-x", "auto", "important");
scrollbox.style.setProperty("width", maxWidth + "px");
} else {
scrollbox.style.setProperty("width", scrollbox.scrollWidth + "px", "important");
scrollbox.clientWidth = scrollbox.scrollWidth;
}
bindWheelEvent(scrollbox);
}
function bindWheelEvent (item) {
if (item._bmMultiColumnWheelHandler) return;
const wheelHandler = (e) => {
e.preventDefault();
const delta = e.deltaY || e.detail || e.wheelDelta;
item.scrollLeft += delta * 50;
};
item.addEventListener('wheel', wheelHandler, { passive: false });
item._bmMultiColumnWheelHandler = wheelHandler;
}
},
resetPopup (menupopup) {
let arrowscrollbox = menupopup?.shadowRoot?.querySelector("::part(arrowscrollbox)");
if (!arrowscrollbox) return;
menupopup.style.maxWidth = "";
arrowscrollbox.style.width = "";
arrowscrollbox.style.maxHeight = "";
let scrollbox = arrowscrollbox.shadowRoot.querySelector('[part~=scrollbox]');
if (!scrollbox) return;
if (scrollbox._bmMultiColumnWheelHandler) {
scrollbox.removeEventListener('wheel', scrollbox._bmMultiColumnWheelHandler);
delete scrollbox._bmMultiColumnWheelHandler;
}
let slot = scrollbox.querySelector('slot');
if (slot) {
slot.style.display = "";
}
Object.assign(scrollbox.style, {
minHeight: "",
height: "",
display: "",
flexFlow: "",
overflow: "",
overflowX: "",
overflowY: "",
maxHeight: "",
width: "",
scrollSnapType: "",
});
let menuitem = menupopup.lastElementChild;
while (menuitem) {
menuitem.style.minWidth = "";
menuitem.style.maxWidth = "";
menuitem.style.width = "";
menuitem = menuitem.previousElementSibling;
}
}
}
function getColumnWidth (menupopup, maxWidth) {
let fontSize = parseFloat(getComputedStyle(menupopup).fontSize) || 16;
let preferredWidth = Math.round(fontSize * 26);
let minWidth = Math.round(fontSize * 18);
return Math.max(Math.min(preferredWidth, maxWidth), Math.min(minWidth, maxWidth));
}
function calcWidth (offset) {
if (typeof offset == 'number') {
return window.innerWidth + offset;
} else if (typeof offset == 'string') {
if (/^-?\d+px$/.test(offset.trim())) {
return window.innerWidth + parseInt(offset.trim().match(/^-?(\d+)px$/)[1]);
}
}
throw new Error('Invalid offset value');
}
window.BMMultiColumn.init();
})(`
#PlacesToolbarItems menupopup {
max-width: calc(100vw - 20px);
max-height: calc(100vh - 129px);
}
#PlacesToolbarItems menupopup > * {
scroll-snap-align: start;
}
`)
Alles anzeigen
Jedes alleine geht, aber zusammen beißen sie sich.
Mfg.
Endor
Jedes alleine geht
Dann muss sich jemand das mal ansehen, der sich mit Skripten auskennt.
Geändert habe ich vor allem die Icon-Erzeugung, die explizite Größe und die URL-Behandlung. Außerdem wird der / wieder tatsächlich ausgegeben. Sieht hier so aus: ![]()
Dann teste bitte mal:
// basiert auf Script von BrokenHeart
// Firefox 154+
(function() {
if (!window.gBrowser)
return;
setTimeout(function() {
setFunction();
}, 50);
// ============================================================
// Custom icons in profile/chrome/icons folder
// ============================================================
let ProfilePath = PathUtils.toFileURI(
PathUtils.join(PathUtils.profileDir, 'chrome', 'icons')
);
let icon1 = "folder.png";
let icon2 = "Bild36.png";
let icon1URL = `${ProfilePath}/${icon1}`;
let icon2URL = `${ProfilePath}/${icon2}`;
// ============================================================
// Einstellungen
// ============================================================
let cs_font_size = 14;
let cs_font_weight = 600;
let cs_font_color = "brown";
// feste Spaltenbreite
let colWidthCh = 4;
// ============================================================
// CSS
// ============================================================
function setFunction() {
const css = `
/*===== Counter rechtsbündig =====*/
#bmContent {
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: -15px;
margin-right: 0px;
font-family: Consolas, "Lucida Console", "Courier New", monospace;
font-size: ${cs_font_size}px;
font-weight: ${cs_font_weight};
height: 18px;
white-space: nowrap;
}
/*============*/
/* Icon 1 */
/*============*/
.bmIcon1 {
display: inline-block;
width: 18px;
min-width: 18px;
height: 18px;
min-height: 18px;
flex: 0 0 18px;
background-image: url("${icon1URL}");
background-repeat: no-repeat;
background-position: center;
background-size: 16px 16px;
margin-left: 6px;
margin-right: 0;
margin-top: 0px;
}
/*============*/
/* Icon 2 */
/*============*/
.bmIcon2 {
display: inline-block;
width: 13px;
min-width: 13px;
height: 13px;
min-height: 13px;
flex: 0 0 13px;
background-image: url("${icon2URL}");
background-repeat: no-repeat;
background-position: center;
background-size: 13px 13px;
margin-left: 6px;
margin-right: 0;
margin-top: 0px;
}
/*===== Zahlen =====*/
.bmValue {
color: ${cs_font_color} !important;
flex: 0 0 auto;
min-width: ${colWidthCh}ch;
text-align: right;
}
/*===== Slash =====*/
.bmSlash {
color: ${cs_font_color} !important;
margin-left: 3px !important;
margin-right: -7px !important;
}
/*===== Hover-Farbwechsel =====*/
menupopup[placespopup="true"]
> menu.bookmark-item:hover
> .menu-text
> #bmContent
.bmValue {
color: red !important;
}
menupopup[placespopup="true"]
> menu.bookmark-item:hover
> .menu-text
> #bmContent
.bmSlash {
color: #000 !important;
}
`;
const sss =
Cc['@mozilla.org/content/style-sheet-service;1']
.getService(Ci.nsIStyleSheetService);
const uri = Services.io.newURI(
'data:text/css,' + encodeURIComponent(css)
);
sss.loadAndRegisterSheet(
uri,
sss.AGENT_SHEET
);
// ========================================================
// Bookmarks-Menü
// ========================================================
let bookMenu =
document.getElementById('bookmarksMenu');
let persToolBar =
document.getElementById('PersonalToolbar');
if (bookMenu) {
bookMenu.addEventListener(
'popupshown',
onPopupShowing
);
}
if (persToolBar) {
persToolBar.addEventListener(
'popupshowing',
onPopupShowing
);
}
}
// ============================================================
// Popup
// ============================================================
function onPopupShowing(aEvent) {
let popup = aEvent.originalTarget;
for (let item of popup.children) {
if (
item.localName != 'menu' ||
item.id?.startsWith('history')
)
continue;
setTimeout(() => {
let itemPopup = item.menupopup;
if (!itemPopup)
return;
// ------------------------------------------------
// Popup kurz öffnen, damit die Children
// zuverlässig vorhanden sind
// ------------------------------------------------
itemPopup.hidden = true;
itemPopup.collapsed = true;
itemPopup.openPopup();
itemPopup.hidePopup();
// ------------------------------------------------
// Zähler
// ------------------------------------------------
let menuitemCount = 0;
let menuCount = 0;
for (let subitem of itemPopup.children) {
if (
subitem.classList.contains('bookmark-item') &&
!subitem.disabled &&
!subitem.hidden
) {
if (subitem.localName == 'menuitem') {
menuitemCount++;
}
else if (subitem.localName == 'menu') {
menuCount++;
}
}
}
itemPopup.hidden = false;
itemPopup.collapsed = false;
// ------------------------------------------------
// Container für den Counter
// ------------------------------------------------
let bmCounta = item.childNodes[1];
if (!bmCounta)
return;
bmCounta.innerHTML = "";
let bmContent =
document.createXULElement("box");
bmContent.id = "bmContent";
// =================================================
// Anzahl Ordner
// =================================================
let v1 =
document.createXULElement("label");
v1.className = "bmValue";
v1.textContent = menuCount;
// =================================================
// Icon 1 = Ordner
// =================================================
let icon1El =
document.createXULElement("box");
icon1El.className = "bmIcon1";
// =================================================
// Slash
// =================================================
let slash =
document.createXULElement("label");
slash.className = "bmSlash";
slash.textContent = "/";
// =================================================
// Anzahl Lesezeichen
// =================================================
let v2 =
document.createXULElement("label");
v2.className = "bmValue";
v2.textContent = menuitemCount;
// =================================================
// Icon 2 = Lesezeichen
// =================================================
let icon2El =
document.createXULElement("box");
icon2El.className = "bmIcon2";
// =================================================
// Reihenfolge
//
// Zahl1 Icon1 / Zahl2 Icon2
// =================================================
bmContent.appendChild(v1);
bmContent.appendChild(icon1El);
bmContent.appendChild(slash);
bmContent.appendChild(v2);
bmContent.appendChild(icon2El);
// =================================================
// Einfügen
// =================================================
bmCounta.appendChild(bmContent);
}, 100);
}
}
})();
Alles anzeigen
Zusammen getestet mit deinem zweiten Script:
Das Überlagerungsproblem besteht auch mit der neuen Version:
Sobald der Text des Ordners länger ist wird er überlagert.
In Deinem Script wird die Breite des Popups beeinflusst - fixiert.
Daher dieses Problem. Kann man die irgendwie flexibel machen?
Ps. Da ich keinen Slash möchte habe ich den entfernt.
Mfg.
Endor