- Firefox-Version
- 112.0
- Betriebssystem
- Windows 11 Home (64-Bit)
Hallo @llen..
Ich benutze das unten gepostete script von aborix aber heute hab ich gemerkt, dass es nicht mehr funkt.
Es sollte die Anzahl ordner und links im ordner anzeigen. Kennt jemand den grund?
JavaScript
(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 (typeof this.options.extraClasses.entry == "string") {
aPopup._endOptOpenAllInTabs.classList.add(
this.options.extraClasses.entry
);
}
if (typeof this.options.extraClasses.footer == "string") {
aPopup._endOptOpenAllInTabs.classList.add(
this.options.extraClasses.footer
);
}
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);
}
}
let intId = setInterval(function() {
if (window.PlacesViewBase) {
clearInterval(intId);
setFunction();
}
}, 500);
})();
(function() {
if (!window.gBrowser)
return;
function setFunction() {
PlacesViewBase.prototype._onPopupShowing = function PVB__onPopupShowing(aEvent) {
let popup = aEvent.originalTarget;
this._ensureMarkers(popup);
if ("_delayedRemovals" in popup) {
while (popup._delayedRemovals.length) {
popup.removeChild(popup._delayedRemovals.shift());
}
}
if (popup._placesNode && PlacesUIUtils.getViewForNode(popup) == this) {
if (!popup._placesNode.containerOpen) {
popup._placesNode.containerOpen = true;
}
if (!popup._built) {
this._rebuildPopup(popup);
}
this._mayAddCommandsItems(popup);
}
/* original function end */
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++;
}
}
}
if (!item.labelOriginal) {
item.labelOriginal = item.label;
}
item.labelSuffix = ' ' + menuitemCount + ' / ' + menuCount;
item.label = item.labelOriginal + item.labelSuffix;
}, 100);
}
popup.addEventListener('popuphidden', function onPopuphidden(event) {
if (event.target != this)
return;
popup.removeEventListener('popuphidden', onPopuphidden);
for (let item of popup.children) {
if (item.localName == 'menu') {
if (item.labelOriginal) {
item.label = item.labelOriginal;
item.labelOriginal = undefined;
}
}
}
});
}
}
let intId = setInterval(() => {
if (window.PlacesViewBase) {
clearInterval(intId);
setFunction();
}
}, 500);
})();
Alles anzeigen
PS: hab grad gemerkt, dass es 2 scripte in einer datei sind.