Evtl. das
Nein, nicht das. Das von BrokenHeart
Das hier:
Code
(function() {
if (!window.gBrowser)
return;
function setFunction() {
const css =`
.countClass::after {
content: attr(data-value);
color: red;
}
`;
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 persToolBar = document.getElementById('PersonalToolbar');
persToolBar.addEventListener('popupshowing', 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.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++;
}
}
}
let label = item.childNodes[1]; //label.menu-iconic-text
label.classList.add('countClass');
let strCountOut = " (" + menuCount + "/" + menuitemCount + ")"
label.setAttribute('data-value', strCountOut);
}, 100);
}
});
}
setTimeout(function() {
setFunction();
},50);
})();
Alles anzeigen