- Firefox-Version
- 139.0.1
- Betriebssystem
- Windows 11 Home (64-Bit-Betriebssystem) Version: 24H2
Hallo allen,
nachdem auf version 139.0 updatet habe, funkt folgendes Script nicht mehr.
ehm 2 zusammengefügte Scripte sind es. Sorry.
Kann Jemand helfen? Danke.
JavaScript
// 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: 30px !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: yellow !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: 2px !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: yellow !important;
margin-right: 20px !important; /* Abstand zum Pfeil rechts */
}
.countClass2 image {
order: 1; /* Pfeil hinter dem "Wert" der Links */
}
/* Ergaenzungen */
.countClass1 label {
margin-inline: 8px !important;
}
.menu-right.countClass2 {
margin-inline: 6px !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 = menuCount + " Ordner";
label += " / " + menuitemCount + " Link"
if (menuitemCount != 1) {
label += "s";
}
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);
})();
Alles anzeigen