Probier spasseshalber mal das:
JavaScript Alles anzeigen// BookmarkCount.uc.js /* ******************************************************************************************************************* */ /* Author BrokenHeart => https://www.camp-firefox.de/forum/thema/136572/?postID=1229536#post1229536 **** */ /* Correction from BrokenHeart => https://www.camp-firefox.de/forum/thema/136572/?postID=1229696#post1229696 **** */ /* Extension from Sören Henschel => https://www.camp-firefox.de/forum/thema/136572/?postID=1229555#post1229555 **** */ /* Customized by Mira inspired by grisu2099 ********************************************************************** */ /* Source => https://www.camp-firefox.de/forum/thema/136572/?postID=1229875#post1229883 **** */ /* Customized by Mira inspired by Horstmann ********************************************************************** */ /* Source => https://www.camp-firefox.de/forum/thema/136572/?postID=1229993#post1229993 **** */ /* ******************************************************************************************************************* */ /* Finaly Source => https://www.camp-firefox.de/forum/thema/136572/?postID=1230128#post1230128 **** */ /* ******************************************************************************************************************* */ /* Custom Counter in the Bookmarks for folders and links ************************************************************* */ /* ******************************************************************************************************************* */ (function() { if (!window.gBrowser) return; setTimeout(function() { setFunction(); },50); let profilePath = PathUtils.toFileURI(PathUtils.join(PathUtils.profileDir, 'chrome', 'icons')) let icon1 = "Folder.png" let icon2 = "Link.png" function setFunction() { const css =` .countClass1::before { content: ""; background-image: url(${profilePath}/${icon1}); background-repeat: no-repeat; background-size: 16px; /* icon size */ //background-position: center; margin-right: -10px !important; /* Abstand bis zum "Wert" der Ordner */ margin-left: 15px !important; /* Abstand bis zum Icon der Ordner */ height: 16px; width: 16px; fill: #c0c0c0; fill-opacity: 1; } .countClass1::after { content: attr(data-value1) !important; font-family: Consolas, "Lucida Console", "Courier New", monospace !important; font-size: 12px !important; font-weight: 900 !important; color: #FFB90F !important; padding-top: 1px !important; } .countClass2::before { content: ""; background-image: url(${profilePath}/${icon2}); background-repeat: no-repeat; background-size: 16px; /* icon size */ background-position: center; margin-right: 6px !important; /* Abstand bis zum "Wert" der Links */ margin-left: 10px !important; /* Abstand bis zum Icon der Links */ height: 16px; width: 16px; fill: #c0c0c0; fill-opacity: 1; } .countClass2::after { content: attr(data-value2); font-family: Consolas, "Lucida Console", "Courier New", monospace !important; font-size: 12px !important; font-weight: 900 !important; color: #FFD700 !important; margin-right: -6px !important; /* Abstand zum Pfeil rechts */ } .countClass2 image { order: 1; /* Pfeil hinter dem "Wert" der Links */ } /* Ergaenzungen */ .countClass1 label { margin-inline: 0px !important; } .menu-right.countClass2 { margin-inline: 0px !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 newbarMenu = document.getElementById('fp-statusbar-1'); let bmbMenu = document.getElementById('bookmarks-menu-button'); let bookMenu = document.getElementById('bookmarksMenu'); let persToolBar = document.getElementById('PersonalToolbar'); if(newbarMenu) newbarMenu.addEventListener('popupshowing', onPopupShowing ); if(bmbMenu) bmbMenu.addEventListener('popupshowing', onPopupShowing ); if(bookMenu) bookMenu.addEventListener('popupshowing', 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; item.style.color = '#c0c0c0'; let label1 = item.childNodes[3]; label1.classList.add('countClass1'); let strCountOut1 = String(menuCount).padEnd(2) + '\xa0'; // padEnd2 => zwei Stellen, plus Abstand label1.setAttribute('data-value1', strCountOut1); let label2 = item.childNodes[4]; label2.classList.add('countClass2'); let strCountOut2 = String(menuitemCount).padEnd(3, '\xa0'); // padEnd3 => drei Stellen, Abstand bei nur einer Ziffer label2.setAttribute('data-value2', strCountOut2); }, 100); } } })(); //Fügt in den Lesezeichen Ordner ganz oben die Anzahl von Links und Unterordner hinzu. (function() { if (!window.gBrowser) return; function setFunction() { PlacesViewBase.prototype._mayAddCommandsItems = function PVB__mayAddCommandsItems(aPopup) { let hasMultipleURIs = false; let menuitemCount = 0; let menuCount = 0; if (aPopup._placesNode.childCount > 0) { for (let item of aPopup.children) { if (item._placesNode) { if (item.localName == 'menuitem') { menuitemCount++; } else if (item.localName == 'menu') { menuCount++; } } } if (menuitemCount > 0 || menuCount > 0) { hasMultipleURIs = true; } } if (!hasMultipleURIs) { aPopup.setAttribute("nofooterpopup", "true"); if (aPopup._endOptOpenAllInTabs) { aPopup.removeChild(aPopup._endOptOpenAllInTabs); aPopup._endOptOpenAllInTabs = null; aPopup.removeChild(aPopup._endOptSeparator); aPopup._endOptSeparator = null; } return; } aPopup.removeAttribute("nofooterpopup"); if (!aPopup._endOptOpenAllInTabs) { aPopup._endOptSeparator = document.createXULElement("menuseparator"); aPopup._endOptSeparator.className = "bookmarks-actions-menuseparator"; aPopup.insertBefore(aPopup._endOptSeparator, aPopup.firstChild); aPopup._endOptOpenAllInTabs = document.createXULElement("menuitem"); aPopup._endOptOpenAllInTabs.className = "openintabs-menuitem"; if (this.options?.extraClasses?.entry) { aPopup._endOptOpenAllInTabs.classList.add( this.options.extraClasses.entry ); } aPopup._endOptOpenAllInTabs.setAttribute( "oncommand", "PlacesUIUtils.openMultipleLinksInTabs(this.parentNode._placesNode, event, " + "PlacesUIUtils.getViewForNode(this));" ); aPopup._endOptOpenAllInTabs.setAttribute( "onclick", "checkForMiddleClick(this, event); event.stopPropagation();" ); aPopup.insertBefore(aPopup._endOptOpenAllInTabs, aPopup.firstChild); } let label = menuitemCount + " Link"; if (menuitemCount != 1) { label += "s"; } label += " / " + menuCount + " Ordner." if (menuitemCount == 1) { label += " -> Link in Tab öffnen." } else if (menuitemCount > 1) { label += " -> Links in Tabs öffnen." } aPopup._endOptOpenAllInTabs.setAttribute("label", label); } } setTimeout(function() { setFunction(); },50); })();
Was hast Du denn geändert?
omar1979 hat sein ganzes Lesezeichenmenü verbogen.Glaube nicht, dass der Fehler am Skript liegt, eher an einem der Maßnahmen, die er fürs Verbiegen verwendet.