Beiträge von FuchsFan
-
-
-
-
Du kannst ja mal diese Version testen, ich kann nicht, bei mir stellt sich der schalter immer wieder auf true um. Muss erst mal forschen wieso.
CSS
Alles anzeigen/* // ==UserScript== // @name extras_config_menu.uc.js // @compatibility Firefox 135+ (getestet bis 155+) // @include main // @version 1.0.20260810 // @edit Eval-freie Version // ==/UserScript== */ var uProfMenu = { // === KONFIGURATION === TextOpenExe: 'C:\\Program Files\\Notepad++\\notepad++.exe', vFileManager: '', warpmenuto: 'helpMenu', sortScripts: 0, gmOrdner: 0, cssOrdner: 1, scriptFolder: 'Scripte', abouts: [ 'about:about', 'about:addons', 'about:cache', 'about:config', 'about:crashes', 'about:downloads', 'about:home', 'about:logins', 'about:memory', 'about:support', 'about:preferences', 'about:performance', 'about:profiles' ], showNormalPrefs: 1, enableScriptsToClip: 2, enableRestart: 0, // === ENDE KONFIGURATION === // === INITIALISIERUNG === init: function() { if (this.warpmenuto.toLowerCase() === 'menu') { var zielmenu = document.getElementById('menu_ToolsPopup'); if (!zielmenu) { console.error( "extras_config_menu.uc.js: Zielmenü nicht gefunden." ); return; } var menu = zielmenu.appendChild( this.createME( "menu", "Config Menü", 0, 0, "ExtraConfigMenu" ) ); menu.setAttribute("class", "menu-iconic"); menu.addEventListener("dblclick", function() { openTrustedLinkIn("about:config", "tab"); }, true); } else { if (window.__SSi === "window0") { CustomizableUI.createWidget({ id: "ExtraConfigMenu-button", defaultArea: CustomizableUI.AREA_NAVBAR, label: "Extra Config Menü", tooltiptext: "Extra Config Menü\nRechtsklick öffnet about:config" }); } var menu = document.getElementById( "ExtraConfigMenu-button" ); if (menu) { menu.setAttribute("type", "menu"); menu.addEventListener('click', function(event) { if (event.button === 2 && !this.open) { openTrustedLinkIn( "about:config", "tab" ); event.preventDefault(); } }, true); } } // CSS für Menü/Button var css = ` #ExtraConfigMenu, #ExtraConfigMenu-button { list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACnElEQVR4Xm2RzYtbZRSHn/fr3pvJzTB3qiNM2k2pMBUGhEHaqsUqdeFGQalCobgREaFu/B/cqCtxVSjoQhBEQRBmIfWDKgNGJUPt0Nhah9JJ4iSd5E6+bu5972tAO4SS5/DjXZ1znsMrNiq1eikMQqYYJCmjxNH5+zdW777L0J5KKl9VPmnf+ut9KWkwhbheuzNcOVYOmGKc5iRO0r1ykeXCx0h7kt4fC3z5wfqbQnAJwQHa5S7jAZSRuJ0mkf81cheobhBXZa+ri1uptQjHAZoZCEC1PiPgDuwxCfwerBU7b73zXn//3usCcdt4HkZ7SGZg431U51NUCgwlO3cV/bVXhR/6p9ut+nP9QYeNn7/n8qUPZxvQ/Q6VVWHk4ZqWRvlJjpx9hcGfW2wO95N2q8m3618A2WwDt/0RplSAXsBed57eyossHl5GYdHacG3zGpADM06wjQ1UUIN+CLHPvfAxojPnKLiE+bDE1R9+5GatAmgPeGCAteQ7l5GBhGSyuROyd/gFouUyWkqEErR2mwXAAA8BRS0AgMQBjSra30ZkEeDzz9Dn4ZcvMO51SMcJcTdGChmA0ABA6cAgzyG3I8jLEBylV4fWoaeIc0V7t0Uv7pFbC+CA+28mp/8+SwXKnMVmz1O9HpE+eobMZdjcoY1GIHD/NwIdoH1fBaNguzlg88pVyoUi4vTbFI8eJxsNAIfSkrliESllH/L0v0jktNNomFGv1TFrL3Fo9QSMR3jaEEXzLC09gjaKp595No0WjyCEB4zRclICUMDxtRMce/wJ1MIi2SglXShhfI/cOjxPoZRmbq4gXzt/gVrtBrdvbiG+Wf+p/mvll1BpiVAGhCDPxuAUDotz4HKHlIJON6bRbL4hhPjcMx5mkn8BBLEUrsVZbq0AAAAASUVORK5CYII="); margin-top: 0px !important; opacity: 1 !important; } #ExtraConfigMenu-button > dropmarker, #ExtraConfigMenu-button > hbox > .toolbarbutton-menu-dropmarker { display: none !important; } `; var sss = Cc['@mozilla.org/content/style-sheet-service;1'] .getService(Ci.nsIStyleSheetService); var uri = makeURI( 'data:text/css;charset=UTF-8,' + encodeURIComponent(css) ); sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET); // Menü-Popup erstellen var menuElement = document.getElementById( this.warpmenuto.toLowerCase() === 'menu' ? 'ExtraConfigMenu' : 'ExtraConfigMenu-button' ); if (!menuElement) { console.error( "extras_config_menu.uc.js: Menü-Element nicht gefunden." ); return; } menuElement.addEventListener('popupshowing', function() { uProfMenu.getScripts(0); uProfMenu.getCss(3); uProfMenu.getCss(4); uProfMenu.getCss(5); }, true); var menupopup = menuElement.appendChild( this.createME( "menupopup", 0, 0, 0, "ExtraConfigMenu-popup" ) ); // === UNTERMENÜS === var submenu = menupopup.appendChild( this.createME( "menu", "Meine Scripte", 0, 0, "submenu-ucjs" ) ); submenu.appendChild( this.createME( "menupopup", 0, 0, 0, "submenu-ucjs-items" ) ); submenu = menupopup.appendChild( this.createME( "menu", "css", 0, 0, "submenu-css" ) ); submenu.appendChild( this.createME( "menupopup", 0, 0, 0, "submenu-css-items" ) ); submenu = menupopup.appendChild( this.createME( "menu", "CSSShadow", 0, 0, "submenu-CSSShadow" ) ); submenu.appendChild( this.createME( "menupopup", 0, 0, 0, "submenu-CSSShadow-items" ) ); submenu = menupopup.appendChild( this.createME( "menu", "cssweb", 0, 0, "submenu-cssweb" ) ); submenu.appendChild( this.createME( "menupopup", 0, 0, 0, "submenu-cssweb-items" ) ); // Skriptliste in Zwischenablage if (this.enableScriptsToClip) { menupopup.appendChild( this.createME( "menuitem", "Skriptliste in Zwischenablage", function() { uProfMenu.getScripts(1); }, "uProfMenu_clipboard", 0 ) ); } menupopup.appendChild( document.createXULElement('menuseparator') ); // === KONFIGDATEIEN === var configFiles = [ { label: "Bild Url", file: "Bild Url.css", mode: 0 }, { label: "config Einträge.css", file: "config Einträge.css", mode: 0 }, { label: "userChrome.css", file: "userChrome.css", mode: 0 }, { label: "userChromeShadow.css", file: "userChromeShadow.css", mode: 0 }, { label: "userContent.css", file: "userContent.css", mode: 0 }, { label: "userChrome.js", file: "userChrome.js", mode: 0 }, { label: "prefs.js", file: "prefs.js", mode: 1 }, { label: "user.js", file: "user.js", mode: 1 } ]; configFiles.forEach(function(item) { menupopup.appendChild( uProfMenu.createME( "menuitem", item.label, function() { uProfMenu.edit(item.mode, item.file); }, "uProfMenu_edit", 0 ) ); }); menupopup.appendChild( document.createXULElement('menuseparator') ); // === ORDNER === switch (this.gmOrdner) { case 1: menupopup.appendChild( this.createME( "menuitem", "GM-skripty", function() { uProfMenu.dirOpen( uProfMenu.getPrefDirectoryPath("ProfD") + uProfMenu.getDirSep() + "gm_scripts" ); }, "uProfMenu_folder", 0 ) ); break; case 2: menupopup.appendChild( this.createME( "menuitem", "USL-skripty", function() { uProfMenu.dirOpen( uProfMenu.getPrefDirectoryPath("UChrm") + uProfMenu.getDirSep() + "UserScriptLoader" ); }, "uProfMenu_folder", 0 ) ); break; case 3: menupopup.appendChild( this.createME( "menuitem", "Skripty Scriptish", function() { uProfMenu.dirOpen( uProfMenu.getPrefDirectoryPath("ProfD") + uProfMenu.getDirSep() + "scriptish_scripts" ); }, "uProfMenu_folder", 0 ) ); break; } menupopup.appendChild( this.createME( "menuitem", "CSS-Ordner", function() { uProfMenu.dirOpen( uProfMenu.getPrefDirectoryPath("UChrm") + uProfMenu.getDirSep() + "css" ); }, "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "CSSShadow-Ordner", function() { uProfMenu.dirOpen( uProfMenu.getPrefDirectoryPath("UChrm") + uProfMenu.getDirSep() + "CSSShadow" ); }, "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "CSSWeb-Ordner", function() { uProfMenu.dirOpen( uProfMenu.getPrefDirectoryPath("UChrm") + uProfMenu.getDirSep() + "CSSWeb" ); }, "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Chromeordner", function() { uProfMenu.prefDirOpen("UChrm"); }, "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Profilordner", function() { uProfMenu.prefDirOpen("ProfD"); }, "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Icons-Ordner", function() { uProfMenu.dirOpen( uProfMenu.getPrefDirectoryPath("UChrm") + uProfMenu.getDirSep() + "Icons" ); }, "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Ordner Scripte", function() { uProfMenu.dirOpen( uProfMenu.getPrefDirectoryPath("UChrm") + uProfMenu.getDirSep() + uProfMenu.scriptFolder ); }, "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Installationsordner", function() { uProfMenu.prefDirOpen("CurProcD"); }, "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Addonordner", function() { uProfMenu.dirOpen( uProfMenu.getPrefDirectoryPath("ProfD") + uProfMenu.getDirSep() + "extensions" ); }, "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Startup-Cacheordner", function() { uProfMenu.dirOpen( uProfMenu.getPrefDirectoryPath("ProfLD") + uProfMenu.getDirSep() + "startupCache" ); }, "uProfMenu_folder", 0 ) ); // === ABOUT-SEITEN === if (this.abouts.length > 0) { menupopup.appendChild( document.createXULElement('menuseparator') ); if (this.abouts[0] === '0') { for (var i = 1; i < this.abouts.length; i++) { (function(url) { menupopup.appendChild( uProfMenu.createME( "menuitem", url, function() { openTrustedLinkIn(url, "tab"); }, "uProfMenu_about", 0 ) ); })(this.abouts[i]); } } else { var submenuAbout = menupopup.appendChild( this.createME( "menu", "uc.js", 0, 0, "submenu-about" ) ); submenuAbout.appendChild( this.createME( "menupopup", 0, 0, 0, "submenu-about-items" ) ); this.fillMenu( "submenu-about", "submenu-about-items", "about:", this.abouts, "uProfMenu_about", 1 ); } } if ( this.abouts.length === 0 && ( this.showNormalPrefs || typeof ToolRstartMod !== "undefined" ) ) { menupopup.appendChild( document.createXULElement('menuseparator') ); } // Normale Einstellungen if (this.showNormalPrefs) { menupopup.appendChild( this.createME( "menuitem", "Einstellungen", function() { try { openOptionsDialog(); } catch (e) { openPreferences(); } }, "uProfMenu_prefs", 0 ) ); } // Neustart if (this.enableRestart) { menupopup.appendChild( this.createME( "menuitem", "Neustart", function() { Services.appinfo.invalidateCachesOnRestart(); Services.startup.quit( Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit, 0 ); }, 0, 0 ) ); } }, // === HILFSFUNKTIONEN === getDirSep: function() { var osString = Cc['@mozilla.org/xre/app-info;1'] .getService(Ci.nsIXULRuntime).OS; switch (osString) { case "WINNT": return "\\"; case "Linux": case "Darwin": return "/"; default: return "/"; } }, edit: function(OpenMode, Filename) { var Path = ""; var dSep = this.getDirSep(); switch (OpenMode) { case 0: Path = this.getPrefDirectoryPath("UChrm") + dSep + Filename; break; case 1: Path = this.getPrefDirectoryPath("ProfD") + dSep + Filename; break; case 2: Path = Filename; break; case 3: Path = this.getPrefDirectoryPath("UChrm") + dSep + "CSS" + dSep + Filename; break; case 4: Path = this.getPrefDirectoryPath("UChrm") + dSep + "CSSWeb" + dSep + Filename; break; case 5: Path = this.getPrefDirectoryPath("UChrm") + dSep + "CSSShadow" + dSep + Filename; break; } this.launch(this.TextOpenExe, Path); }, editPath: function(Path) { this.launch(this.TextOpenExe, Path); }, dirOpen: function(Path) { if (this.vFileManager.length !== 0) { var file = Cc['@mozilla.org/file/local;1'] .createInstance(Ci.nsIFile); var process = Cc['@mozilla.org/process/util;1'] .createInstance(Ci.nsIProcess); var args = [Path]; file.initWithPath(this.vFileManager); process.init(file); process.run(false, args, args.length); } else { var dir = Cc['@mozilla.org/file/local;1'] .createInstance(Ci.nsIFile); dir.initWithPath(Path); dir.launch(); } }, prefDirOpen: function(prefDir) { this.dirOpen( this.getPrefDirectoryPath(prefDir) ); }, getPrefDirectoryPath: function(str) { var file = Cc['@mozilla.org/file/directory_service;1'] .getService(Ci.nsIProperties) .get(str, Ci.nsIFile); if (str === 'CurProcD') { file = file.parent; } return file.path; }, launch: function(RanPath, OpenPath) { var editor = Cc['@mozilla.org/file/local;1'] .createInstance(Ci.nsIFile); var process = Cc['@mozilla.org/process/util;1'] .createInstance(Ci.nsIProcess); try { editor.initWithPath(RanPath); if (!editor.exists() || !editor.isFile()) { var prefs = Cc['@mozilla.org/preferences-service;1'] .getService(Ci.nsIPrefBranch); if (prefs.prefHasUserValue( "view_source.editor.path" )) { RanPath = prefs.getCharPref( "view_source.editor.path" ); editor.initWithPath(RanPath); } } if (!editor.exists() || !editor.isFile()) { console.error( "extras_config_menu.uc.js: Editor nicht gefunden: " + RanPath ); return; } var target = Cc['@mozilla.org/file/local;1'] .createInstance(Ci.nsIFile); target.initWithPath(OpenPath); if (!target.exists() || !target.isFile()) { console.error( "extras_config_menu.uc.js: Datei nicht gefunden: " + OpenPath ); return; } var args = [OpenPath]; process.init(editor); if (typeof process.runwAsync === "function") { process.runwAsync(args, args.length); } else if (typeof process.runw === "function") { process.runw(false, args, args.length); } else { process.run(false, args, args.length); } } catch (e) { console.error( "extras_config_menu.uc.js: Datei konnte nicht geöffnet werden", e ); } }, stringComparison: function(a, b) { a = a.toLowerCase() .replace(/ä/g, "a") .replace(/ö/g, "o") .replace(/ü/g, "u") .replace(/ß/g, "s"); b = b.toLowerCase() .replace(/ä/g, "a") .replace(/ö/g, "o") .replace(/ü/g, "u") .replace(/ß/g, "s"); return (a === b) ? 0 : (a > b) ? 1 : -1; }, getScripts: function(iType) { var scripts = []; var extjs = /\.uc\.js$/i; var dSep = this.getDirSep(); var chromePath = this.getPrefDirectoryPath("UChrm"); var readFolder = function(folderPath) { var folder = Cc['@mozilla.org/file/local;1'] .createInstance(Ci.nsIFile); folder.initWithPath(folderPath); if (!folder.exists() || !folder.isDirectory()) { return; } var files = folder.directoryEntries .QueryInterface(Ci.nsISimpleEnumerator); while (files.hasMoreElements()) { var file = files.getNext() .QueryInterface(Ci.nsIFile); if (file.isFile() && extjs.test(file.leafName)) { scripts.push({ name: file.leafName, path: file.path }); } } }; // Scripts direkt aus chrome readFolder(chromePath); // Scripts aus chrome/Scripte readFolder( chromePath + dSep + this.scriptFolder ); if (this.sortScripts) { scripts.sort(function(a, b) { return uProfMenu.stringComparison( a.name, b.name ); }); } if (iType === 0) { this.fillMenu( "submenu-ucjs", "submenu-ucjs-items", "Meine Scripte", scripts, "uProfMenu_ucjs", 0 ); } else { var names = []; for (var i = 0; i < scripts.length; i++) { names.push(scripts[i].name); } var result = this.fillClipboardValue(names, []); Cc['@mozilla.org/widget/clipboardhelper;1'] .getService(Ci.nsIClipboardHelper) .copyString(result); } }, getCss: function(iType) { var cssFiles = []; var extcss = /\.css$/i; var aFolder = Cc['@mozilla.org/file/local;1'] .createInstance(Ci.nsIFile); var subfolder = ""; switch (iType) { case 3: subfolder = "CSS"; break; case 4: subfolder = "CSSWeb"; break; case 5: subfolder = "CSSShadow"; break; default: return; } aFolder.initWithPath( this.getPrefDirectoryPath("UChrm") + this.getDirSep() + subfolder ); if (!aFolder.exists()) { return; } var files = aFolder.directoryEntries .QueryInterface(Ci.nsISimpleEnumerator); while (files.hasMoreElements()) { var file = files.getNext() .QueryInterface(Ci.nsIFile); if (file.isFile() && extcss.test(file.leafName)) { cssFiles.push(file.leafName); } } if (this.sortScripts) { cssFiles.sort(this.stringComparison); } var menuId; var label; switch (iType) { case 3: menuId = "submenu-css"; label = "Meine CSS-Dateien"; break; case 4: menuId = "submenu-cssweb"; label = "Meine CSSWeb-Dateien"; break; case 5: menuId = "submenu-CSSShadow"; label = "Meine CSSShadow-Dateien"; break; } this.fillMenu( menuId, menuId + "-items", label, cssFiles, "uProfMenu_css", iType ); }, fillMenu: function( whichsubmenu, whichsubmenuitems, strlabel, scriptArray, sClass, sTyp ) { var e = document.getElementById(whichsubmenu); if (e) { e.setAttribute( 'label', strlabel + ' (' + scriptArray.length + ')' ); } var popup = document.getElementById(whichsubmenuitems); if (!popup) { return; } while (popup.hasChildNodes()) { popup.removeChild(popup.firstChild); } for (var i = scriptArray.length - 1; i >= 0; i--) { var mitem; var current = scriptArray[i]; var scriptName = typeof current === "string" ? current : current.name; switch (sTyp) { case 0: if (typeof current === "string") { mitem = this.createME( "menuitem", scriptName, function() { uProfMenu.edit(0, scriptName); }, sClass, 0 ); } else { (function(script) { mitem = uProfMenu.createME( "menuitem", script.name, function() { uProfMenu.editPath(script.path); }, sClass, 0 ); })(current); } (function(script) { mitem.addEventListener('click', function(event) { if (event.button === 1) { uProfMenu.openAtGithub( event, script ); } else if (event.button === 2) { event.preventDefault(); var sUrl = "https://github.com/search?langOverride=&language=&q=" + encodeURIComponent(script) + "&repo=&start_value=1&type=Code"; openTrustedLinkIn(sUrl, 'tab'); } }, true); })(scriptName); mitem.setAttribute( "tooltiptext", "Linksklick: Bearbeiten,\n" + "Mittelklick: GitHub öffnen,\n" + "Rechtsklick: Suche auf GitHub" ); break; case 1: (function(url) { mitem = uProfMenu.createME( "menuitem", url, function() { openTrustedLinkIn(url, "tab"); }, sClass, 0 ); })(scriptName); break; case 3: case 4: case 5: (function(name, mode) { mitem = uProfMenu.createME( "menuitem", name, function() { uProfMenu.edit(mode, name); }, sClass, 0 ); })(scriptName, sTyp); break; } if (mitem) { popup.insertBefore(mitem, popup.firstChild); } } }, fillClipboardValue: function(sArray, xArray) { var s = sArray.length; var x = xArray.length; var retValue; switch (this.enableScriptsToClip) { case 1: retValue = "userChromeJS/uc.js (" + s + "):\n" + "------------------------\n" + sArray.join("\n") + "\n\nuserChromeJS/uc.xul (" + x + "):\n" + "-------------------------\n" + xArray.join("\n"); break; default: retValue = "userChromeJS/uc.js (" + s + "):\n" + "------------------------"; for (var i = 0; i < s; i++) { retValue += "\n" + (i + 1) + ". " + sArray[i]; } retValue += "\n\nuserChromeJS/uc.xul (" + x + "):\n" + "-------------------------"; if (this.enableScriptsToClip === 2) { s = 0; } for (var j = 0; j < x; j++) { retValue += "\n" + (j + s + 1) + ". " + xArray[j]; } break; } return retValue; }, createME: function(sTyp, sLabel, sCommand, sClass, sId) { const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var m = document.createElementNS(XUL_NS, sTyp); switch (sTyp) { case "menuitem": m.setAttribute('label', sLabel); if (sClass) { m.setAttribute('class', sClass); } if (sId) { m.setAttribute('id', sId); } if (typeof sCommand === "function") { m.addEventListener( 'command', sCommand ); } break; case "menu": m.setAttribute('label', sLabel); if (sId) { m.setAttribute('id', sId); } break; case "menupopup": if (sId) { m.setAttribute('id', sId); } break; } return m; }, openAtGithub: function(e, sScript) { if (e.button === 1) { var sUrl = "https://github.com/ardiman/userChrome.js/tree/master/" + this.cleanFileName(sScript); openTrustedLinkIn(sUrl, 'tab'); } }, cleanFileName: function(sName) { sName = sName.toLowerCase(); var regs = [ /\.uc\.js$/, /\.uc\.xul$/, /^ucjs_/, /_\d.+/, /_fx\d+/, /[-+\.]/g, /_v\d+/ ]; for (var i = 0; i < regs.length; i++) { sName = sName.replace(regs[i], ""); } return sName; } }; // Initialisierung uProfMenu.init(); -
-
Mira_Belle , omar1979 ,
das Script von hier habe ich mit KI überarbeitet, ist getestet bis Version 155. Das sind die Änderungen:
Desweiteren werden Scripte aus dem Ordner chrome, als auch aus dem Ordner Scripte (wenn in chrome angelegt) ausgelesen. omar1979, das solltest du dann mal probieren, denn das, was du bisher nutzt ist auf gut deutsch gesagt, Schrott.
Dann zum Test:
CSS
Alles anzeigen// ==UserScript== // @name extras_config_menu.uc.js // @compatibility Firefox 135+ (getestet bis v155) // @include main // @version 1.0.1 // ==/UserScript== var uProfMenu = { // === KONFIGURATION === // In der folgenden Zeile (13) den Pfad zum Texteditor eintragen (unter Ubuntu 10.04 z.B.: '/usr/bin/gedit'). Bei Fehleintrag wird view_source.editor.path ausgelesen: //TextOpenExe: 'C:\\notepad++\\notepad++.exe', TextOpenExe: 'C:\\Program Files\\Notepad++\\notepad++.exe', // Falls gewuenscht, in Zeile 15 einen Dateimanager eintragen (komplett leer lassen fuer Dateimanager des Systems) Beispiele: // vFileManager: 'E:\\Total Commander\\Totalcmd.exe', // vFileManager: 'C:\\Program Files (x86)\\FreeCommander\\FreeCommander.exe' vFileManager: '', // In der folgenden Zeile (22) 'menu' eintragen, damit es unter "Extras" als Menue erscheint, // sonst frei lassen, Button ist verschiebbar warpmenuto: '', // Unter Linux sollte/kann versucht werden, die userChromeJS-Skripte zu sortieren, unter Windows ist das evtl. nicht noetig (die Sortierung wird Gross- und Kleinschreibung *nicht* beruecksichtigen - dazu wird die sort()-Funktion entsprechend mit einer Vergleichsfunktion aufgerufen) sortScripts: 0, // Einbindung GM-Skripte-Ordner (0: nein, 1: Greasemonkey [Profil-Verzeichnis], 2: UserScriptLoader [Chrome-Verzeichnis], 3: Scriptish [Profil-Verzeichnis]): gmOrdner: 0, // Einbindung CSS-Ordner (0: nein, 1: UserCSSLoader-Ordner im Chrome-Verzeichnis): cssOrdner: 0, // Zusätzlicher Scriptordner innerhalb von chrome scriptFolder: 'Scripte', abouts: [ 'about:about', 'about:addons', 'about:cache', 'about:config', 'about:crashes', 'about:downloads', 'about:home', 'about:logins', 'about:memory', 'about:support', 'about:preferences', 'about:performance', 'about:profiles' ], showNormalPrefs: 1, enableScriptsToClip: 2, enableRestart: 0, // === ENDE KONFIGURATION === // === INITIALISIERUNG === init: function() { if (this.warpmenuto.toLowerCase() === 'menu') { var zielmenu = document.getElementById('menu_ToolsPopup'); if (!zielmenu) { console.error( "extras_config_menu.uc.js: Zielmenü nicht gefunden." ); return; } var menu = zielmenu.appendChild( this.createME( "menu", "Config Menü", 0, 0, "ExtraConfigMenu" ) ); menu.setAttribute("class", "menu-iconic"); menu.setAttribute( "ondblclick", "openTrustedLinkIn('about:config', 'tab');" ); } else { if (window.__SSi === "window0") { CustomizableUI.createWidget({ id: "ExtraConfigMenu-button", defaultArea: CustomizableUI.AREA_NAVBAR, label: "Extra Config Menü", tooltiptext: "Extra Config Menü\nRechtsklick öffnet about:config" }); } var menu = document.getElementById( "ExtraConfigMenu-button" ); if (menu) { menu.setAttribute("type", "menu"); menu.addEventListener('click', function(event) { if (event.button === 2 && !this.open) { openTrustedLinkIn("about:config", "tab"); event.preventDefault(); } }, true); } } // CSS für Menü/Button var css = ` #ExtraConfigMenu, #ExtraConfigMenu-button { list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACnElEQVR4Xm2RzYtbZRSHn/fr3pvJzTB3qiNM2k2pMBUGhEHaqsUqdeFGQalCobgREaFu/B/cqCtxVSjoQhBEQRBmIfWDKgNGJUPt0Nhah9JJ4iSd5E6+bu5972tAO4SS5/DjXZ1znsMrNiq1eikMQqYYJCmjxNH5+zdW777L0J5KKl9VPmnf+ut9KWkwhbheuzNcOVYOmGKc5iRO0r1ykeXCx0h7kt4fC3z5wfqbQnAJwQHa5S7jAZSRuJ0mkf81cheobhBXZa+ri1uptQjHAZoZCEC1PiPgDuwxCfwerBU7b73zXn//3usCcdt4HkZ7SGZg431U51NUCgwlO3cV/bVXhR/6p9ut+nP9QYeNn7/n8qUPZxvQ/Q6VVWHk4ZqWRvlJjpx9hcGfW2wO95N2q8m3618A2WwDt/0RplSAXsBed57eyossHl5GYdHacG3zGpADM06wjQ1UUIN+CLHPvfAxojPnKLiE+bDE1R9+5GatAmgPeGCAteQ7l5GBhGSyuROyd/gFouUyWkqEErR2mwXAAA8BRS0AgMQBjSra30ZkEeDzz9Dn4ZcvMO51SMcJcTdGChmA0ABA6cAgzyG3I8jLEBylV4fWoaeIc0V7t0Uv7pFbC+CA+28mp/8+SwXKnMVmz1O9HpE+eobMZdjcoY1GIHD/NwIdoH1fBaNguzlg88pVyoUi4vTbFI8eJxsNAIfSkrliESllH/L0v0jktNNomFGv1TFrL3Fo9QSMR3jaEEXzLC09gjaKp595No0WjyCEB4zRclICUMDxtRMce/wJ1MIi2SglXShhfI/cOjxPoZRmbq4gXzt/gVrtBrdvbiG+Wf+p/mvll1BpiVAGhCDPxuAUDotz4HKHlIJON6bRbL4hhPjcMx5mkn8BBLEUrsVZbq0AAAAASUVORK5CYII="); margin-top: 0px !important; opacity: 1 !important; } #ExtraConfigMenu-button > dropmarker, #ExtraConfigMenu-button > hbox > .toolbarbutton-menu-dropmarker { display: none !important; } `; var sss = Cc['@mozilla.org/content/style-sheet-service;1'] .getService(Ci.nsIStyleSheetService); var uri = makeURI( 'data:text/css;charset=UTF-8,' + encodeURIComponent(css) ); sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET); // Menü-Popup erstellen var menuElement = document.getElementById( this.warpmenuto.toLowerCase() === 'menu' ? 'ExtraConfigMenu' : 'ExtraConfigMenu-button' ); if (!menuElement) { console.error( "extras_config_menu.uc.js: Menü-Element nicht gefunden." ); return; } menuElement.addEventListener('popupshowing', function() { uProfMenu.getScripts(0); uProfMenu.getCss(3); uProfMenu.getCss(4); uProfMenu.getCss(5); }, true); var menupopup = menuElement.appendChild( this.createME( "menupopup", 0, 0, 0, "ExtraConfigMenu-popup" ) ); // === UNTERMENÜS === var submenu = menupopup.appendChild( this.createME( "menu", "Meine Scripte", 0, 0, "submenu-ucjs" ) ); submenu.appendChild( this.createME( "menupopup", 0, 0, 0, "submenu-ucjs-items" ) ); submenu = menupopup.appendChild( this.createME( "menu", "css", 0, 0, "submenu-css" ) ); submenu.appendChild( this.createME( "menupopup", 0, 0, 0, "submenu-css-items" ) ); submenu = menupopup.appendChild( this.createME( "menu", "CSSShadow", 0, 0, "submenu-CSSShadow" ) ); submenu.appendChild( this.createME( "menupopup", 0, 0, 0, "submenu-CSSShadow-items" ) ); submenu = menupopup.appendChild( this.createME( "menu", "cssweb", 0, 0, "submenu-cssweb" ) ); submenu.appendChild( this.createME( "menupopup", 0, 0, 0, "submenu-cssweb-items" ) ); if (this.enableScriptsToClip) { menupopup.appendChild( this.createME( "menuitem", "Skriptliste in Zwischenablage", "uProfMenu.getScripts(1)", "uProfMenu_clipboard", 0 ) ); } menupopup.appendChild( document.createXULElement('menuseparator') ); // === KONFIGDATEIEN === var configFiles = [ { label: "Bild Url", file: "Bild Url.css", mode: 0 }, { label: "config Einträge.css", file: "config Einträge.css", mode: 0 }, { label: "userChrome.css", file: "userChrome.css", mode: 0 }, { label: "userChromeShadow.css", file: "userChromeShadow.css", mode: 0 }, { label: "userContent.css", file: "userContent.css", mode: 0 }, { label: "userChrome.js", file: "userChrome.js", mode: 0 }, { label: "prefs.js", file: "prefs.js", mode: 1 }, { label: "user.js", file: "user.js", mode: 1 } ]; configFiles.forEach(function(item) { menupopup.appendChild( uProfMenu.createME( "menuitem", item.label, "uProfMenu.edit(" + item.mode + ",'" + item.file + "')", "uProfMenu_edit", 0 ) ); }); menupopup.appendChild( document.createXULElement('menuseparator') ); // === ORDNER === switch (this.gmOrdner) { case 1: menupopup.appendChild( this.createME( "menuitem", "GM-skripty", "uProfMenu.dirOpen(uProfMenu.getPrefDirectoryPath('ProfD')+uProfMenu.getDirSep()+'gm_scripts')", "uProfMenu_folder", 0 ) ); break; case 2: menupopup.appendChild( this.createME( "menuitem", "USL-skripty", "uProfMenu.dirOpen(uProfMenu.getPrefDirectoryPath('UChrm')+uProfMenu.getDirSep()+'UserScriptLoader')", "uProfMenu_folder", 0 ) ); break; case 3: menupopup.appendChild( this.createME( "menuitem", "Skripty Scriptish", "uProfMenu.dirOpen(uProfMenu.getPrefDirectoryPath('ProfD')+uProfMenu.getDirSep()+'scriptish_scripts')", "uProfMenu_folder", 0 ) ); break; } menupopup.appendChild( this.createME( "menuitem", "CSS-Ordner", "uProfMenu.dirOpen(uProfMenu.getPrefDirectoryPath('UChrm')+uProfMenu.getDirSep()+'css')", "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "CSSShadow-Ordner", "uProfMenu.dirOpen(uProfMenu.getPrefDirectoryPath('UChrm')+uProfMenu.getDirSep()+'CSSShadow')", "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "CSSWeb-Ordner", "uProfMenu.dirOpen(uProfMenu.getPrefDirectoryPath('UChrm')+uProfMenu.getDirSep()+'CSSWeb')", "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Chromeordner", "uProfMenu.prefDirOpen('UChrm')", "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Profilordner", "uProfMenu.prefDirOpen('ProfD')", "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Icons-Ordner", "uProfMenu.dirOpen(uProfMenu.getPrefDirectoryPath('UChrm')+uProfMenu.getDirSep()+'Icons')", "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Ordner Scripte", "uProfMenu.dirOpen(uProfMenu.getPrefDirectoryPath('UChrm')+uProfMenu.getDirSep()+uProfMenu.scriptFolder)", "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Installationsordner", "uProfMenu.prefDirOpen('CurProcD')", "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Addonordner", "uProfMenu.dirOpen(uProfMenu.getPrefDirectoryPath('ProfD')+uProfMenu.getDirSep()+'extensions')", "uProfMenu_folder", 0 ) ); menupopup.appendChild( this.createME( "menuitem", "Startup-Cacheordner", "uProfMenu.dirOpen(uProfMenu.getPrefDirectoryPath('ProfLD')+uProfMenu.getDirSep()+'startupCache')", "uProfMenu_folder", 0 ) ); // === ABOUT-SEITEN === if (this.abouts.length > 0) { menupopup.appendChild( document.createXULElement('menuseparator') ); if (this.abouts[0] === '0') { for (var i = 1; i < this.abouts.length; i++) { menupopup.appendChild( this.createME( "menuitem", this.abouts[i], "openTrustedLinkIn('" + this.abouts[i] + "','tab')", "uProfMenu_about", 0 ) ); } } else { var submenuAbout = menupopup.appendChild( this.createME( "menu", "uc.js", 0, 0, "submenu-about" ) ); submenuAbout.appendChild( this.createME( "menupopup", 0, 0, 0, "submenu-about-items" ) ); this.fillMenu( "submenu-about", "submenu-about-items", "about:", this.abouts, "uProfMenu_about", 1 ); } } if ( this.abouts.length === 0 && ( this.showNormalPrefs || typeof ToolRstartMod !== "undefined" ) ) { menupopup.appendChild( document.createXULElement('menuseparator') ); } if (this.showNormalPrefs) { menupopup.appendChild( this.createME( "menuitem", "Einstellungen", "try{openOptionsDialog();}catch(e){openPreferences();}", "uProfMenu_prefs", 0 ) ); } if (this.enableRestart) { menupopup.appendChild( this.createME( "menuitem", "Neustart", "Services.appinfo.invalidateCachesOnRestart(); Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit, 0);", 0, 0 ) ); } }, // === HILFSFUNKTIONEN === getDirSep: function() { var osString = Cc['@mozilla.org/xre/app-info;1'] .getService(Ci.nsIXULRuntime).OS; switch (osString) { case "WINNT": return "\\"; case "Linux": case "Darwin": return "/"; default: return "/"; } }, edit: function(OpenMode, Filename) { var Path = ""; var dSep = this.getDirSep(); switch (OpenMode) { // Dateien direkt im chrome-Ordner case 0: Path = this.getPrefDirectoryPath("UChrm") + dSep + Filename; break; // Dateien direkt im Profilordner case 1: Path = this.getPrefDirectoryPath("ProfD") + dSep + Filename; break; // Vollständiger Pfad case 2: Path = Filename; break; // CSS-Ordner case 3: Path = this.getPrefDirectoryPath("UChrm") + dSep + "CSS" + dSep + Filename; break; // CSSWeb-Ordner case 4: Path = this.getPrefDirectoryPath("UChrm") + dSep + "CSSWeb" + dSep + Filename; break; // CSSShadow-Ordner case 5: Path = this.getPrefDirectoryPath("UChrm") + dSep + "CSSShadow" + dSep + Filename; break; } this.launch(this.TextOpenExe, Path); }, // Öffnet einen vollständigen Dateipfad editPath: function(Path) { this.launch(this.TextOpenExe, Path); }, dirOpen: function(Path) { if (this.vFileManager.length !== 0) { var file = Cc['@mozilla.org/file/local;1'] .createInstance(Ci.nsIFile); var process = Cc['@mozilla.org/process/util;1'] .createInstance(Ci.nsIProcess); var args = [Path]; file.initWithPath(this.vFileManager); process.init(file); process.run(false, args, args.length); } else { var dir = Cc['@mozilla.org/file/local;1'] .createInstance(Ci.nsIFile); dir.initWithPath(Path); dir.launch(); } }, prefDirOpen: function(prefDir) { var Path = this.getPrefDirectoryPath(prefDir); this.dirOpen(Path); }, getPrefDirectoryPath: function(str) { var file = Cc['@mozilla.org/file/directory_service;1'] .getService(Ci.nsIProperties) .get(str, Ci.nsIFile); if (str === 'CurProcD') { file = file.parent; } return file.path; }, launch: function(RanPath, OpenPath) { var editor = Cc['@mozilla.org/file/local;1'] .createInstance(Ci.nsIFile); var process = Cc['@mozilla.org/process/util;1'] .createInstance(Ci.nsIProcess); try { editor.initWithPath(RanPath); if (!editor.exists() || !editor.isFile()) { var prefs = Cc['@mozilla.org/preferences-service;1'] .getService(Ci.nsIPrefBranch); if (prefs.prefHasUserValue( "view_source.editor.path" )) { RanPath = prefs.getCharPref( "view_source.editor.path" ); editor.initWithPath(RanPath); } } if (!editor.exists() || !editor.isFile()) { console.error( "extras_config_menu.uc.js: Editor nicht gefunden: " + RanPath ); return; } var target = Cc['@mozilla.org/file/local;1'] .createInstance(Ci.nsIFile); target.initWithPath(OpenPath); if (!target.exists() || !target.isFile()) { console.error( "extras_config_menu.uc.js: Datei nicht gefunden: " + OpenPath ); return; } var args = [OpenPath]; process.init(editor); if (typeof process.runwAsync === "function") { process.runwAsync(args, args.length); } else if (typeof process.runw === "function") { process.runw(false, args, args.length); } else { process.run(false, args, args.length); } } catch (e) { console.error( "extras_config_menu.uc.js: Datei konnte nicht geöffnet werden", e ); } }, stringComparison: function(a, b) { a = a.toLowerCase() .replace(/ä/g, "a") .replace(/ö/g, "o") .replace(/ü/g, "u") .replace(/ß/g, "s"); b = b.toLowerCase() .replace(/ä/g, "a") .replace(/ö/g, "o") .replace(/ü/g, "u") .replace(/ß/g, "s"); return (a === b) ? 0 : (a > b) ? 1 : -1; }, getScripts: function(iType) { var scripts = []; var extjs = /\.uc\.js$/i; var dSep = this.getDirSep(); var chromePath = this.getPrefDirectoryPath("UChrm"); var readFolder = function(folderPath) { var folder = Cc['@mozilla.org/file/local;1'] .createInstance(Ci.nsIFile); folder.initWithPath(folderPath); if (!folder.exists() || !folder.isDirectory()) { return; } var files = folder.directoryEntries .QueryInterface(Ci.nsISimpleEnumerator); while (files.hasMoreElements()) { var file = files.getNext() .QueryInterface(Ci.nsIFile); if (file.isFile() && extjs.test(file.leafName)) { scripts.push({ name: file.leafName, path: file.path }); } } }; // Scripts direkt aus chrome lesen readFolder(chromePath); // Scripts aus chrome/Scripte lesen readFolder( chromePath + dSep + this.scriptFolder ); if (this.sortScripts) { scripts.sort(function(a, b) { return uProfMenu.stringComparison( a.name, b.name ); }); } if (iType === 0) { this.fillMenu( "submenu-ucjs", "submenu-ucjs-items", "Meine Scripte", scripts, "uProfMenu_ucjs", 0 ); } else { var names = []; for (var i = 0; i < scripts.length; i++) { names.push(scripts[i].name); } var result = this.fillClipboardValue(names, []); Cc['@mozilla.org/widget/clipboardhelper;1'] .getService(Ci.nsIClipboardHelper) .copyString(result); } }, getCss: function(iType) { var cssFiles = []; var extcss = /\.css$/i; var aFolder = Cc['@mozilla.org/file/local;1'] .createInstance(Ci.nsIFile); var subfolder = ""; switch (iType) { case 3: subfolder = "CSS"; break; case 4: subfolder = "CSSWeb"; break; case 5: subfolder = "CSSShadow"; break; default: return; } aFolder.initWithPath( this.getPrefDirectoryPath("UChrm") + this.getDirSep() + subfolder ); if (!aFolder.exists()) { return; } var files = aFolder.directoryEntries .QueryInterface(Ci.nsISimpleEnumerator); while (files.hasMoreElements()) { var file = files.getNext() .QueryInterface(Ci.nsIFile); if (file.isFile() && extcss.test(file.leafName)) { cssFiles.push(file.leafName); } } if (this.sortScripts) { cssFiles.sort(this.stringComparison); } var menuId; var label; switch (iType) { case 3: menuId = "submenu-css"; label = "Meine CSS-Dateien"; break; case 4: menuId = "submenu-cssweb"; label = "Meine CSSWeb-Dateien"; break; case 5: menuId = "submenu-CSSShadow"; label = "Meine CSSShadow-Dateien"; break; } this.fillMenu( menuId, menuId + "-items", label, cssFiles, "uProfMenu_css", iType ); }, fillMenu: function( whichsubmenu, whichsubmenuitems, strlabel, scriptArray, sClass, sTyp ) { var e = document.getElementById(whichsubmenu); if (e) { e.setAttribute( 'label', strlabel + ' (' + scriptArray.length + ')' ); } var popup = document.getElementById( whichsubmenuitems ); if (!popup) { return; } while (popup.hasChildNodes()) { popup.removeChild(popup.firstChild); } for (var i = scriptArray.length - 1; i >= 0; i--) { var mitem; var current = scriptArray[i]; var scriptName = typeof current === "string" ? current : current.name; switch (sTyp) { case 0: if (typeof current === "string") { mitem = this.createME( "menuitem", scriptName, "uProfMenu.edit(0,'" + scriptName + "')", sClass, 0 ); } else { mitem = this.createME( "menuitem", scriptName, "uProfMenu.editPath(" + JSON.stringify(current.path) + ")", sClass, 0 ); } (function(script) { mitem.addEventListener( 'click', function(event) { if (event.button === 1) { uProfMenu.openAtGithub( event, script ); } else if (event.button === 2) { event.preventDefault(); var sUrl = "https://github.com/search?langOverride=&language=&q=" + encodeURIComponent(script) + "&repo=&start_value=1&type=Code"; openTrustedLinkIn( sUrl, 'tab' ); } }, true ); })(scriptName); mitem.setAttribute( "tooltiptext", "Linksklick: Bearbeiten,\n" + "Mittelklick: GitHub öffnen,\n" + "Rechtsklick: Suche auf GitHub" ); break; case 1: mitem = this.createME( "menuitem", scriptName, "openTrustedLinkIn('" + scriptName + "','tab')", sClass, 0 ); break; case 3: case 4: case 5: mitem = this.createME( "menuitem", scriptName, "uProfMenu.edit(" + sTyp + ",'" + scriptName + "')", sClass, 0 ); break; } if (mitem) { popup.insertBefore( mitem, popup.firstChild ); } } }, fillClipboardValue: function(sArray, xArray) { var s = sArray.length; var x = xArray.length; var retValue; switch (this.enableScriptsToClip) { case 1: retValue = "userChromeJS/uc.js (" + s + "):\n" + "------------------------\n" + sArray.join("\n") + "\n\nuserChromeJS/uc.xul (" + x + "):\n" + "-------------------------\n" + xArray.join("\n"); break; default: retValue = "userChromeJS/uc.js (" + s + "):\n" + "------------------------"; for (var i = 0; i < s; i++) { retValue += "\n" + (i + 1) + ". " + sArray[i]; } retValue += "\n\nuserChromeJS/uc.xul (" + x + "):\n" + "-------------------------"; if (this.enableScriptsToClip === 2) { s = 0; } for (var j = 0; j < x; j++) { retValue += "\n" + (j + s + 1) + ". " + xArray[j]; } break; } return retValue; }, createME: function(sTyp, sLabel, sCommand, sClass, sId) { const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var m = document.createElementNS( XUL_NS, sTyp ); switch (sTyp) { case "menuitem": m.setAttribute( 'label', sLabel ); if (sClass) { m.setAttribute( 'class', sClass ); } if (sId) { m.setAttribute( 'id', sId ); } if (sCommand) { m.addEventListener( 'command', function() { new Function(sCommand)(); } ); } break; case "menu": m.setAttribute( 'label', sLabel ); if (sId) { m.setAttribute( 'id', sId ); } break; case "menupopup": if (sId) { m.setAttribute( 'id', sId ); } break; } return m; }, openAtGithub: function(e, sScript) { if (e.button === 1) { var sUrl = "https://github.com/ardiman/userChrome.js/tree/master/" + this.cleanFileName(sScript); openTrustedLinkIn( sUrl, 'tab' ); } }, cleanFileName: function(sName) { sName = sName.toLowerCase(); var regs = [ /\.uc\.js$/, /\.uc\.xul$/, /^ucjs_/, /_\d.+/, /_fx\d+/, /[-+\.]/g, /_v\d+/ ]; for (var i = 0; i < regs.length; i++) { sName = sName.replace( regs[i], "" ); } return sName; } }; // Initialisierung uProfMenu.init(); -
-
Herzlichen Dank, das hast du super gemacht
. Muss ich noch etwas anpassen, aber es macht was es soll. 

-
Das komplette CSS, oder Script, dazu bitte posten
1059 Zeilen Code, nicht eine davon hat mit dem Problem etwas zu tun, begreife es jetzt bitte. Und nicht umsonst habe ich hier um Hilfe gebeten, weil ich nichts dazu finden konnte. Und wenn 2002Andreas , grisu2099 und Dharkness das genau so sehen, warum willst du das nicht verstehen. Gesagt hatte ich, es bleibt so wie es ist i.M.
-
oder vorhandenes CSS rechts unten roter Pfeil eine andere Farbe?
Nicht rechts unten, siehe Beitrag #1.
-
Die Bilder vom Kunden sind zu wenig aussagend, man sieht nicht das ganze, zumal da schon mit CSS rumfuhrwerkt wurde und kein Original zu sehen ist. Bilder also bitte mit mehr Zusammenhang anbieten!
Du fährst hier aber Geschütze auf, rumfuhrwerkt.
Ist nicht mein lieber Kritiker, alles wohl durchdacht. Für dich also noch einmal ganz konkret, mir geht es nur darum den Text (Label) zentriert in das Feld einzupassen, und eventuell eine andere Farbe (siehe Beitrag #5). Und weil du das erste Bild nicht deuten konntest, hier die Auflösung.
Mit diesen ↓ CSS-Schnipseln könntest Du beide unterschiedlich gestalten, oder eben nur eines, entweder Erweiterungen oder Themes.
Danke, Ralf, ich gebe erst einmal auf. Das ist wirklich eine verzwickte Sache, was Mozilla neuerdings gebaut hat.
-
Wie man das nur in der Rubrik Erweiterungen ansprechen kann, da muss ich leider passen
Danke für deine Bemühungen.
Den Code verwende ich für die Meldungen bisher, nur diese eine macht Schwierigkeiten.
CSS
Alles anzeigen/* die Meldungen bei Update-Suche */ #updates-message[state="updating"], #updates-message[state="none-found"], #updates-message[state="installed"] { min-width: 255px !important; max-width: 255px !important; margin-inline-end: 1px !important; background: lightblue !important; color: blue !important; } #updates-message[state="manual-updates-found"] { min-width: 265px !important; max-width: 265px !important; margin-inline-end: 1px !important; background: lightblue !important; color: blue !important; } addon-page-header#page-header[current-view="detail"] #updates-message[state="updating"], addon-page-header#page-header[current-view="detail"] #updates-message[state="none-found"], addon-page-header#page-header[current-view="detail"] #updates-message[state="manual-updates-found"], addon-page-header#page-header[current-view="detail"] #updates-message[state="installed"] { margin-left: 154px !important; } #updates-message[state="none-found"][data-l10n-id="addon-updates-none-found"] { color: #409DD9 !important; } [data-l10n-id="addon-updates-updating"], [data-l10n-id="addon-updates-none-found"], [data-l10n-id="addon-updates-installed"] { padding: 0 !important; margin: 0 auto !important; } [data-l10n-id="addon-updates-manual-updates-found"] { width: calc(100% + 10px) !important; min-height: 26px !important; max-height: 26px !important; padding: 0 !important; margin: 0 !important; } -
So sieht es mit der Meldung korrekt aus.

Wie lautet das denn für Themes und Erweiterungen ?
für Themes:
[data-l10n-id="addon-category-theme-title"] {für Erweiterungen:
[data-l10n-id="addon-category-extension-title"] {Den Rest kannst du dir dann nach dem Muster anpassen.
-
Meinst du den hier?
Daneben, Andreas, sei gegrüßt.

Das hatte ich vor, wenn ich manuell Updates suche.
-
-
Sieht hier dann so aus:
Stimmt!
-
-
das funktioniert hier mit einer kleinen Änderung so, wie ich es haben möchte
Prima, dann passt es.

-
Ich nutze das folgende Script, wenn du dort die Zeilen 174 bis 183 auskommentierst, dann hast du das Ergebnis:
JavaScript
Alles anzeigen// basiert auf Sript von BrokenHeart // Firefox 154+ (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 = "Bild36.png"; let cs_font_size = 12; let cs_font_weight = 700; let cs_font_color = "blue"; // Fix: feste Spaltenbreite (anpassen, wenn du mehrstellig erwartest) let colWidthCh = 4; 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: flex !important; align-items: center !important; justify-content: flex-end !important; /* nach rechts drücken innerhalb von menu-text */ margin-left: auto !important; height: 16px !important; white-space: nowrap !important; margin-top: -14px !important; } .bmIcon1 { width: 16px; height: 16px; background: url("${ProfilePath}/${icon1}") no-repeat center; background-size: 16px 16px; /* Icon kommt NACH dem Wert => Abstand links ist das relevante */ margin-left: 6px; margin-right: 0; margin-top: -2px; flex: 0 0 auto; } .bmIcon2 { width: 16px; height: 16px; background: url("${ProfilePath}/${icon2}") no-repeat center; background-size: 12px 12px; margin-left: 6px; margin-right: 0; margin-top: -2px; flex: 0 0 auto; } .bmValue { color: ${cs_font_color} !important; flex: 0 0 auto; min-width: ${colWidthCh}ch; /* gleiche Flucht über Zeilen */ text-align: right; } .bmSlash { color: ${cs_font_color} !important; margin-left: 3px !important; margin-right: -7px !important; } /* Hover-Farbwechsel */ menupopup[placespopup="true"] > menu.bookmark-item:hover > .menu-text > #bmContent .bmValue { color: red !important; fill: red !important; } menupopup[placespopup="true"] > menu.bookmark-item:hover > .menu-text > #bmContent .bmSlash { color: #000 !important; fill: #000 !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"; let strCountOut1 = menuCount; // Ordner let strCountOut2 = menuitemCount; // Lesezeichen // DOM: value1 + Icon1 + "/" + value2 + Icon2 let v1 = document.createElement("span"); v1.className = "bmValue"; v1.textContent = strCountOut1; let icon1El = document.createElement("span"); icon1El.className = "bmIcon1"; let slash = document.createElement("span"); slash.className = "bmSlash"; slash.textContent = "/"; // ohne Leerzeichen let v2 = document.createElement("span"); v2.className = "bmValue"; v2.textContent = strCountOut2; let icon2El = document.createElement("span"); icon2El.className = "bmIcon2"; // Ausblenden-Logik: Wenn ein Zähler 0 ist, alles rechts davon konsequent ausblenden if (strCountOut1 === 0) { v1.style.display = "none"; icon1El.style.display = "none"; slash.style.display = "none"; } if (strCountOut2 === 0) { v2.style.display = "none"; icon2El.style.display = "none"; slash.style.display = "none"; } bmContent.appendChild(v1); bmContent.appendChild(icon1El); bmContent.appendChild(slash); bmContent.appendChild(v2); bmContent.appendChild(icon2El); bmCounta.appendChild(bmContent); }, 100); } } })(); -
In dem Skript von hier #375 wird beim Entpacken des Archivs der gesamte Inhalt des Profilordners aufgeführt. Das habe ich in dem folgenden Skript dahingehend geändert, dass beim Entpacken der vollständige Profilordner mit seinem richtigen Namen erstellt wird. Ist sehr viel einfacher, wenn ein Archiv mal für die Herstellung des Profils genutzt werden muss.
JavaScript
Alles anzeigen// ==UserScript== // @name ProfileBackupRestore@Fu_combo_zipRoot_withlog.uc.js // @description Navbar: Backup(Ordner1 + ZIP2) + Restore(Backup1->Profil) + Log in Ordner1 // @version 2026.07-combo-zip-root-log // ==/UserScript== (function () { "use strict"; if (location.href !== "chrome://browser/content/browser.xhtml") return; if (typeof CustomizableUI === "undefined") return; if (!window.gBrowser) return; const PROFILES = [ { label: "Reserve 3", profilePath: "C:\\Users\\Old Man\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\Reserve 3", profileName: "Reserve 3", backup1Path: "G:\\BackupRestore Firefox\\Reserve 3", archiveRootPath: "E:\\BackupRestore Firefox\\Reserve 3", iconPath: "file:///C:/FoxIcons2/Finale.png" }, { label: "Portable.Firefox.Updater.3_Stable ", profilePath: "G:\\Portable.Firefox.Updater.3\\Firefox Stable x64\\profile", profileName: "profile", backup1Path: "G:\\BackupRestore Firefox\\Portable.Firefox.Updater.3_Stable", archiveRootPath: "E:\\BackupRestore Firefox\\Portable.Firefox.Updater.3_Stable", iconPath: "file:///C:/FoxIcons2/Finale.png" }, { label: "Portable.Firefox.Updater.3_Nightly ", profilePath: "G:\\Portable.Firefox.Updater.3\\Firefox Nightly x64\\profile", profileName: "profile", backup1Path: "G:\\BackupRestore Firefox\\Portable.Firefox.Updater.3_Nightly", archiveRootPath: "E:\\BackupRestore Firefox\\Portable.Firefox.Updater.3_Nightly", iconPath: "file:///C:/FoxIcons2/Nightly.png" } ]; const BTN_ID = "profilebackup_restore_combo_ziproot_withlog"; const POPUP_ID = BTN_ID + "_popup"; const btnIconPath = "file:///C:/FoxIcons2/backup.png"; // ========================= // Logging helpers // ========================= function pad2(n) { return String(n).padStart(2, "0"); } function timeHHMM(d) { return "[" + pad2(d.getHours()) + ":" + pad2(d.getMinutes()) + "]"; } function formatHeaderDateGermanLong(d) { const weekdays = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"]; const months = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]; const wd = weekdays[d.getDay()]; const mn = months[d.getMonth()]; return "am " + wd + ", " + pad2(d.getDate()) + ". " + mn + " " + d.getFullYear() + ", " + pad2(d.getHours()) + ":" + pad2(d.getMinutes()) + ":" + pad2(d.getSeconds()) + " Uhr"; } function getLogFile(profile) { const f = new FileUtils.File(profile.backup1Path); f.append("ProfileBackupRestore.log"); return f; } function ensureParentForFile(file) { const parent = file.parent; if (!parent || !parent.exists()) { // backup1Path ist bei dir der Parent; falls nicht existiert, versuche zu erstellen // (best effort) try { parent.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755); } catch (_) {} } } function appendTextToFile(file, text) { try { ensureParentForFile(file); if (!file.exists()) { file.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o644); } const fos = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); fos.init(file, 0x02 | 0x08 | 0x10, 0o644, 0); // write | create | append const conv = Cc["@mozilla.org/intl/converter-output-stream;1"].createInstance(Ci.nsIConverterOutputStream); conv.init(fos, "UTF-8", 0, 0); conv.writeString(text); conv.close(); try { fos.close(); } catch (_) {} } catch (e) { console.error("Log Fehler:", e); } } function logRestore(profile, destProfilePath) { const dStart = new Date(); const header = "Profil in alten Zustand versetzt " + formatHeaderDateGermanLong(dStart) + "\n\n"; const lines = timeHHMM(dStart) + " Restore gestartet (Firefox-Erkennung deaktiviert).\n" + timeHHMM(dStart) + " Lösche vorhandenen Profilordner: " + destProfilePath + "\n" + timeHHMM(dStart) + " Kopiere Sicherung nach: " + destProfilePath + "\n" + timeHHMM(new Date()) + " Restore erfolgreich abgeschlossen.\n"; appendTextToFile(getLogFile(profile), header + "\n" + lines + "\n"); } function logBackup(profile, backupTargetPath, zipPath) { const dStart = new Date(); const header = "Profil gesichert " + formatHeaderDateGermanLong(dStart) + "\n\n"; const lines = timeHHMM(dStart) + " Backup gestartet (Firefox-Erkennung deaktiviert).\n" + timeHHMM(dStart) + " Lösche vorhandenen Profilordner: " + backupTargetPath + "\n" + timeHHMM(dStart) + " Kopiere Profil nach: " + backupTargetPath + "\n" + timeHHMM(new Date()) + " Erzeuge Archiv ZIP: " + zipPath + "\n" + timeHHMM(new Date()) + " Backup erfolgreich abgeschlossen.\n"; appendTextToFile(getLogFile(profile), header + "\n" + lines + "\n"); } // ========================= // Alert // ========================= function showAlert(text) { try { let w = null; try { w = Services.wm.getMostRecentWindow("navigator:browser"); } catch (_) {} Services.prompt.alert(w || null, "Profilsicherung", text); } catch (e) { console.error("Alert Fehler:", e); } } // ========================= // Date/Zähler ZIP2 // ========================= function pad2Str(n) { const x = parseInt(n, 10); if (isNaN(x)) return "00"; return pad2(x); } function getDateStrYYYYMMDD(d) { return d.getFullYear() + "-" + pad2(d.getMonth() + 1) + "-" + pad2(d.getDate()); } function escapeRegExp(s) { return String(s).replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } function getNextDailyZipIndex(archiveRootFile, profileName, dateStr) { let max = 0; const re = new RegExp("^" + escapeRegExp(profileName) + "_" + escapeRegExp(dateStr) + "_(\\d{2})\\.zip$"); let entries = archiveRootFile.directoryEntries; while (entries.hasMoreElements()) { const entry = entries.getNext().QueryInterface(Ci.nsIFile); if (!entry.isFile()) continue; const m = re.exec(entry.leafName); if (m) { const n = parseInt(m[1], 10); if (!isNaN(n) && n > max) max = n; } } return max + 1; // => startet bei 01 } // ========================= // Skip-Dateien (WAL/SHM/Locks) // ========================= function shouldSkipEntryByName(name) { if (name === "parent.lock") return true; if (name === "lock") return true; if (name === "recovery.jsonlz4") return true; if (name.endsWith(".sqlite-wal")) return true; if (name.endsWith(".sqlite-shm")) return true; return false; } // ========================= // Copy helpers // ========================= function copyDirectoryContents(srcDir, destDir) { let entries = srcDir.directoryEntries; while (entries.hasMoreElements()) { const entry = entries.getNext().QueryInterface(Ci.nsIFile); if (shouldSkipEntryByName(entry.leafName)) continue; const destEntry = destDir.clone(); destEntry.append(entry.leafName); try { if (entry.isDirectory()) { if (!destEntry.exists()) destEntry.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755); copyDirectoryContents(entry, destEntry); } else { if (destEntry.exists()) destEntry.remove(false); entry.copyTo(destDir, entry.leafName); } } catch (e) { console.warn("⚠️ Kopie fehlgeschlagen:", entry.path, e); } } } function clearDirectoryContents(dir) { let entries = dir.directoryEntries; while (entries.hasMoreElements()) { const entry = entries.getNext().QueryInterface(Ci.nsIFile); try { entry.remove(true); } catch (e) { console.warn("⚠️ Clear fehlgeschlagen:", entry.path, e); } } } // ========================= // ZIP erstellen: Inhalt + Root = profile.profileName // ========================= function zipDirectoryWithRoot(sourceDir, zipFile, rootNameInZip) { const baseDirPath = sourceDir.path; if (zipFile.exists()) zipFile.remove(true); const zipWriter = Cc["@mozilla.org/zipwriter;1"].createInstance(Ci.nsIZipWriter); const PR_WRONLY = 0x02; const PR_CREATE_FILE = 0x08; const PR_TRUNCATE = 0x20; zipWriter.open(zipFile, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE); function walk(dir) { let entries = dir.directoryEntries; while (entries.hasMoreElements()) { const entry = entries.getNext().QueryInterface(Ci.nsIFile); if (entry.path === zipFile.path) continue; if (shouldSkipEntryByName(entry.leafName)) continue; if (entry.isDirectory()) { walk(entry); continue; } // relPath relativ zum sourceDir, ohne führenden Slash let relPath = entry.path.replace(baseDirPath, ""); if (!relPath) return; if (relPath[0] === "\\" || relPath[0] === "/") relPath = relPath.substring(1); const saveInZipAs = (rootNameInZip + "/" + relPath).replace(/\\/g, "/"); try { zipWriter.addEntryFile( saveInZipAs, Ci.nsIZipWriter.COMPRESSION_FASTEST, entry, false ); } catch (e) { console.warn("⚠️ ZIP Eintrag fehlgeschlagen:", saveInZipAs, e); } } } walk(sourceDir); zipWriter.close(); } // ========================= // Backup (Ordner1 + ZIP2) // ========================= function runBackup(profile) { let backupTarget = null; let zipFile = null; try { const now = new Date(); const profileDir = new FileUtils.File(profile.profilePath); if (!profileDir.exists()) throw new Error("Profilordner existiert nicht: " + profile.profilePath); const backupRoot = new FileUtils.File(profile.backup1Path); if (!backupRoot.exists()) backupRoot.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755); const archiveRoot = new FileUtils.File(profile.archiveRootPath); if (!archiveRoot.exists()) archiveRoot.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755); // BACKUP 1 Ziel: backupRoot/<profileName> backupTarget = backupRoot.clone(); backupTarget.append(profile.profileName); if (backupTarget.exists()) backupTarget.remove(true); backupTarget.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755); copyDirectoryContents(profileDir, backupTarget); // BACKUP 2 ZIP: archiveRoot/<profileName>_YYYY-MM-DD_XX.zip (XX ab 01) const dateStr = getDateStrYYYYMMDD(now); const nextIdx = getNextDailyZipIndex(archiveRoot, profile.profileName, dateStr); const idxStr = pad2Str(nextIdx); const zipName = profile.profileName + "_" + dateStr + "_" + idxStr + ".zip"; zipFile = archiveRoot.clone(); zipFile.append(zipName); // ZIP-Inhalt soll als Root den profile.profileName Ordner haben. // Wir zippen den Inhalt von backupTarget, Root in der ZIP = profile.profileName. zipDirectoryWithRoot(backupTarget, zipFile, profile.profileName); if (!zipFile.exists()) throw new Error("ZIP wurde nicht erstellt: " + zipFile.path); // Log in Ordner 1 try { logBackup(profile, backupTarget.path, zipFile.path); } catch (_) {} setTimeout(() => { showAlert( "✅ Backup abgeschlossen!\n\n" + "👤 Profil: " + profile.label + "\n\n" + "📁 Backup Ordner 1: " + backupTarget.path + "\n" + "📦 Archiv ZIP: " + zipFile.path ); }, 50); } catch (e) { console.error("Backup Fehler:", e); // Best effort Cleanup ZIP, falls vorhanden try { if (zipFile && zipFile.exists()) zipFile.remove(false); } catch (_) {} setTimeout(() => showAlert("❌ Backup Fehler: " + e.message), 0); } } // ========================= // Restore (Backup1 -> Profil überschreibt; Wrapper fix!) // ========================= function runRestore(profile) { let profileDir = null; let backupRootDir = null; let backupProfileDir = null; try { profileDir = new FileUtils.File(profile.profilePath); if (!profileDir.exists()) throw new Error("Zielprofil existiert nicht: " + profile.profilePath); backupRootDir = new FileUtils.File(profile.backup1Path); if (!backupRootDir.exists()) throw new Error("Backup1 Ordner existiert nicht: " + profile.backup1Path); // Wrapper fix: // Backup1 enthält i.d.R. <profileName>/... -> daraus restaurieren: backupProfileDir = backupRootDir.clone(); backupProfileDir.append(profile.profileName); // Fallback falls Backup1 doch direkt Root ist if (!backupProfileDir.exists()) backupProfileDir = backupRootDir; const ok = Services.prompt.confirm( null, "Profilsicherung (Restore)", "Restore jetzt starten für: " + profile.label + "\n\n" + "Quelle: " + backupProfileDir.path + "\n" + "Ziel: " + profileDir.path + "\n\n" + "WICHTIG: Firefox bitte vorher vollständig beenden.\nFortfahren?" ); if (!ok) return; clearDirectoryContents(profileDir); copyDirectoryContents(backupProfileDir, profileDir); try { logRestore(profile, profileDir.path); } catch (_) {} setTimeout(() => { showAlert( "✅ Restore abgeschlossen!\n\n" + "👤 Profil: " + profile.label + "\n\n" + "📁 Quelle: " + backupProfileDir.path + "\n" + "📁 Ziel: " + profileDir.path + "\n\n" + "Hinweis: Starte Firefox danach neu." ); }, 50); } catch (e) { console.error("Restore Fehler:", e); setTimeout(() => showAlert("❌ Restore Fehler: " + e.message), 0); } } // ========================= // Menü // ========================= function createMenu(doc) { const menupopup = doc.createXULElement("menupopup"); menupopup.setAttribute("id", POPUP_ID); PROFILES.forEach((profile) => { const backupItem = doc.createXULElement("menuitem"); backupItem.setAttribute("label", "Backup: " + profile.label); backupItem.setAttribute("class", "menuitem-iconic"); if (profile.iconPath) backupItem.setAttribute("image", profile.iconPath); backupItem.addEventListener("command", () => { const ok = Services.prompt.confirm( null, "Profilsicherung", "Backup jetzt starten für: " + profile.label + " ?" ); if (ok) runBackup(profile); }); menupopup.appendChild(backupItem); }); const sep = doc.createXULElement("menuseparator"); menupopup.appendChild(sep); PROFILES.forEach((profile) => { const restoreItem = doc.createXULElement("menuitem"); restoreItem.setAttribute("label", "Restore: " + profile.label); restoreItem.setAttribute("class", "menuitem-iconic"); if (profile.iconPath) restoreItem.setAttribute("image", profile.iconPath); restoreItem.addEventListener("command", () => runRestore(profile)); menupopup.appendChild(restoreItem); }); return menupopup; } // ========================= // Button Patch // ========================= function patchButton(btn) { if (!btn) return false; const oldPopup = btn.querySelector("#" + POPUP_ID); if (oldPopup) oldPopup.remove(); btn.setAttribute("type", "menu"); btn.setAttribute("aria-haspopup", "true"); btn.setAttribute("tooltiptext", "Backup & Restore"); btn.setAttribute("image", btnIconPath); btn.appendChild(createMenu(btn.ownerDocument)); btn.addEventListener("click", (ev) => { if (ev.button !== 0) return; try { const p = btn.querySelector("#" + POPUP_ID); if (p) p.openPopup(btn, "after_start", 0, 0, false, false); } catch (_) {} }, false); return true; } // ========================= // Widget erstellen // ========================= try { if (CustomizableUI.getWidget && CustomizableUI.getWidget(BTN_ID)) { try { CustomizableUI.destroyWidget(BTN_ID); } catch (_) {} } } catch (_) {} try { const el = document.getElementById(BTN_ID); if (el) el.remove(); } catch (_) {} CustomizableUI.createWidget({ id: BTN_ID, defaultArea: CustomizableUI.AREA_NAVBAR, label: "Profilsicherung", tooltiptext: "Backup & Restore (ZIP Root = profileName) + Log", onCreated: (button) => setTimeout(() => patchButton(button), 0) }); // ========================= // CSS (dein Layout) // ========================= const css = ` #${BTN_ID} .toolbarbutton-icon { width: 31px !important; height: 31px !important; padding: 5px !important; } #${BTN_ID}_popup { max-width: 250px !important; min-width: 250px !important; } #${BTN_ID}_popup menuitem.menuitem-iconic img.menu-icon { margin-left: -28px !important; } #${BTN_ID}_popup menuitem.menuitem-iconic label.menu-text { margin-left: 6px !important; } `; const sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService); const ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); const uri = ios.newURI("data:text/css;charset=utf-8," + encodeURIComponent(css), null, null); sss.loadAndRegisterSheet(uri, sss.USER_SHEET); })();