War ja auch nur eine Idee. Das Nightly-Profil, in dem mir die Dateien aufgefallen sind, nutze ich zum Testen von CSS-Anpassungen für Nova - mit entsprechend häufigen Neustarts. ![]()
Beiträge von grisu2099
-
-
Mir ist diese Datei in den letzten Tagen auch aufgefallen...
Könnte eine Ursache für das Anlegen ein häufiger ausgeführter Neustart des betreffenden Profils sein?

-

Danke 2002Andreas. Nun läuft es wieder. Bis auf ein mickriges Komma (das ich vergessen hatte), war ich der Lösung im zweiten Anlauf auch auf der Spur...

-
Siehe mein Edit von eben...

Sorry für die Verwirrung - ich versuche mein Glück noch mal...
-
Ja, nur die main.js geändert. Im zweiten Test wie gesagt sogar nur die Zeile 86 entsprechend angepaßt.
Ich habe jetzt noch nicht alles getestet, aber zumindest auf den ersten Blick laufen die Skripte, z.B.: Restart, zusätzliche Leisten, Datum/Uhrzeit, Versionsanzeige, zusätzliche Buttons...
EDIT: Kommando zurück! Da ist doch noch was faul...
-
Ich habe mich mal an der Änderung in der main.js versucht. Einfach die geänderte Datei im Programm-Ordner->userChromeJS einfügen und Nightly (mit Cache-Leerung) neu starten. Vorher natürlich die Änderung in about-config wieder zurückdrehen...
Wenn jemand testen möchte:
Code
Alles anzeigen// main.js /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is the userChrome.js component. * * The Initial Developer of the Original Code is * Simon Bünzli <zeniko@gmail.com> * * Portions created by the Initial Developer are Copyright (C) 2007 * the Initial Developer. All Rights Reserved. * * Contributor(s): * alta88 <alta88@gmail.com> * aborix <www.camp-firefox.de/forum> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ const { FileUtils } = ChromeUtils.importESModule( 'resource://gre/modules/FileUtils.sys.mjs' ); let UserChrome_js = { init: function() { Services.obs.addObserver(this, "final-ui-startup", false); Services.obs.addObserver(this, "domwindowopened", false); }, // observer observe: function(aSubject, aTopic, aData) { switch (aTopic) { case "final-ui-startup": let path = PathUtils.profileDir; let ucFilePath = PathUtils.join(path, "chrome", "userChrome.js"); let ucFile = new FileUtils.File(ucFilePath); if (!ucFile.exists()) { let path = PathUtils.join(ucjsDirPath, "Readme.txt"); let readmeFile = new FileUtils.File(path); readmeFile.copyTo(ucFile.parent, "userChrome.js"); }; if (ucFile.exists() && ucFile.isFile()) { let path = PathUtils.join(ucjsDirPath, "utilities.js"); this.utilFileURI = PathUtils.toFileURI(path); this.ucFileURI = PathUtils.toFileURI(ucFilePath); }; Services.obs.removeObserver(this, "final-ui-startup"); break; case "domwindowopened": aSubject.addEventListener("load", this, {capture: true, once: true}); break; } }, // event listener for load handleEvent: function(aEvent) { let document = aEvent.originalTarget; let window = document.defaultView; if (document.location && document.location.protocol == "chrome:") { try { // Services.scriptloader.loadSubScript(this.utilFileURI, window, "UTF-8"); // Services.scriptloader.loadSubScript(this.ucFileURI, window, "UTF-8"); Services.scriptloader.loadSubScriptWithOptions(this.utilFileURI, { target: window, charset: 'UTF-8', allowUnsafeURL: true }); Services.scriptloader.loadSubScriptWithOptions(this.ucFileURI, { target: window, charset: 'UTF-8', allowUnsafeURL: true }); } catch (ex) { // script execution can be stopped with |throw "stop";| if (ex != "stop") { Cu.reportError(ex); } } }; } }; UserChrome_js.init();Bei mir funktioniert das auf 2 Rechnern mit Win11. Trotzdem natürlich ohne Gewähr!!


Edit: Ich habe lediglich die beiden Vorkommen in Zeile 85+86 geändert...
Edit2: Es scheint sogar zu reichen, wenn nur Zeile 86 entsprechend angepaßt wird - also Services.scriptloader.loadSubScript(this.ucFileURI, window, "UTF-8");
-
-
Wer weiß, aus welcher obskuren Quelle diese Version stammt...

-
-
-
In Zeile 46 alles auf 0
Ah, dann bin ich vorhin in der falschen Zeile gelandet. Schön, wenn es jetzt paßt.
@Dharkness: Da muß wohl eine Änderung am Skript erfolgen. Da bin ich dann überfragt. Ich habe diesen Fall bei mir nicht, deswegen war mir das noch nicht aufgefallen.
-
Ich schau mir das später nochmal an - jetzt ist Tour de France dran...

-
-
Spiel mal mit dem 1. Wert in Zeile 47...

-
Notfalls zum Testen eigene Icons verwenden und die Zeilen 17+18 entsprechend anpassen. Icons in den Ordner icons im chrome-Ordner.
-
Komisch - ich habe eben das Archiv von hier heruntergeladen und entpackt - kein Problem...

-
Ich stehe gerade auf dem Schlauch...
Das bekommst du nach dem Entpacken zu sehen?
-
-
hier funktioniert Script und CSS wunderbar.
So wunderbar nicht...

Eigentlich sollte das so aussehen:
Hier die Icons:

-
Dann teste mal folgende Skript-Version (das CSS von oben nicht vergessen):
JavaScript
Alles anzeigen// bmcount testa neu D TEST! für Mira // basiert auf Sript von BrokenHeart // https://www.camp-firefox.de/forum/thema/136572-nur-die-anzeige-der-ordner-lesezeichenanzahl-in-einer-anderen-farbe-darstellen/?postID=1269879#post1269879 // funktioniert in Nightly 142 (function() { if (!window.gBrowser) return; setTimeout(function() { setFunction(); },50); //Custom icons in profile/chrome/icons folder let ProfilePath = PathUtils.toFileURI(PathUtils.join(PathUtils.profileDir, 'chrome', 'icons')); let icon1 = "Ordner.png" let icon2 = "Stern.svg" let cs_font_size = 12 let cs_font_weight = 600 let cs_font_color = "rgb(144,238,144)" function setFunction() { const css =` #bmContent { font-family: "Courier New", monospace !important; font-size: ${cs_font_size}px !important; font-weight: ${cs_font_weight} !important; display: inline-flex !important; justify-content: space-between !important; height: 16px !important; margin-inline: auto -1px !important; /* border: 1px solid green; */ } #bmContent::before { content: attr(data-value1) " /"; background: url("${ProfilePath}/${icon1}") no-repeat 8px 0; color: ${cs_font_color}; align-items: center; display: inline-flex; justify-content: flex-end; width: 23px; padding: 4px 0 0 10px; margin-inline: 20px 2px; /* border: 1px solid blue; */ } #bmContent::after { content: attr(data-value2); background: url("${ProfilePath}/${icon2}") no-repeat right 0; background-size: 16px 16px; color: ${cs_font_color}; align-items: center; display: flex; justify-content: flex-end; width: 23px; padding: 4px 17px 0 0; /* border: 1px solid red; */ } /* ::before oder ::after ausblenden, wenn der Zähler 0 anzeigen würde */ #bmContent[data-value1="0"]::before, #bmContent[data-value2="0"]::after { display: none !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 bookMenu = document.getElementById('bookmarksMenu'); let persToolBar = document.getElementById('PersonalToolbar'); if(bookMenu) { bookMenu.addEventListener('popupshown', 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 bmCounta = item.childNodes[1]; bmCounta.innerHTML = "" let bmContent = document.createElement("bmContent"); bmContent.id = "bmContent"; bmCounta.appendChild(bmContent); let strCountOut1 = menuCount; bmContent.setAttribute('data-value1', strCountOut1); let strCountOut2 = menuitemCount; bmContent.setAttribute('data-value2', strCountOut2); }, 100); } } })();