- Firefox-Version
- FF139
- Betriebssystem
- Win11
Hallöle...
Nach dem Update auf 139 muß in meinem Script wohl was geändert werden:
JavaScript
// 29_FolderContentCounter.uc.js
//
// 230709 Brokenheart, s.u. :
// https://www.camp-firefox.de/forum/thema/136572?postID=1229696#post1229696
// https://www.camp-firefox.de/forum/thema/136572?postID=1229792#post1229792 <=== !!!! für Zeile 85
//
// 230707: sörens Anpassung:
// https://www.camp-firefox.de/forum/thema/136572/?postID=1229555#post1229555
//
// 230707: grisu2099 Anpassungen
// https://www.camp-firefox.de/forum/thema/136572/?postID=1229578#post1229578
// ==UserScript==
// @name BookmarkCount.uc.js
// @namespace https://www.camp-firefox.de/forum/thema/136572/?postID=1229696#post1229696
// @description Zeigt bei Menü - Lesezeichen, Lesezeichen Symbolleiste, bei Ordnern die Anzahl
// @description der enthaltenen Unterordner und Lesezeichen an.
// @compatibility Firefox 115
// @author BrokenHeart
(function() {
if (!window.gBrowser)
return;
setTimeout(function() {
setFunction();
},50);
function setFunction() {
const css =`
.countClass::after {
content: attr(data-value);
color: blue;
padding-right: 5px;
}
`;
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 bmbMenu = document.getElementById('bookmarks-menu-button');
let bookMenu = document.getElementById('bookmarksMenu');
let persToolBar = document.getElementById('PersonalToolbar');
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;
let label = item.childNodes[3]; //label.menu-iconic-text
label.classList.add('countClass');
let strCountOut = + menuCount + " 📁 - " + String(menuitemCount).padStart(2, '0') + " 📚 "
label.setAttribute('data-value', strCountOut);
}, 100);
}
}
})();
Alles anzeigen
Was muß ich ändern?