Profilmanager
-
Mira_Belle -
12. Mai 2026 um 17:19 -
Erledigt
-
-
Das ist jetzt meine favorisierte Version, alle Profile können beliebig oft gestartet werden. Dieses Script, getestet von v150 bis
v152, funktioniert ohne Probleme. Alle Profile müssen manuell eingetragen werden, wobei Unterschiede bei installierten und portablen Versionen weiterhin bestehen. Bei den installierten Versionen wird bei profile: immer der Name des Profils eingegeben (bei about:profiles entnehmen), bei den portablen dagegen muss hier immer der genaue Pfad zum Profilordner angegeben werden.
Alle Versionen werden grundsätzlich über die firefox.exe aus dem Installationsordner gestartet (also nicht über die FirefoxLoader.exe, usw.). Dafür ist dementsprechend bei exe: der genaue Pfad zur firefox.exe anzugeben. Beispiele sind dafür im Script für alle Versionen enthalten. Dann bitte testen!CSS
Alles anzeigen// ==UserScript== // @name FoxStarter Auto Stable + Icons // @description Firefox / Portable Starter mit Icons + CSS // @author FuchsFan (KI) // @version 1.3.1 150+ // @note -no-remote entfernt // @include main // ==/UserScript== (function () { if (!window.gBrowser) return; const btn_id = "foxstarter_auto"; const POPUP_ID = btn_id + "-popup"; const btn_icon = "file:///C:/FoxIcons2/Bild206.png"; const ICON_BASE = "file:///C:/FoxIcons2/"; const btn_tooltiptext = "Firefox Profile starten (Auswahl)"; const { classes: Cc, interfaces: Ci } = Components; let cssInjected = false; // ========================================================= // CSS // ========================================================= function injectUserCSS() { try { if (cssInjected) return; const css = ` #${btn_id} image.toolbarbutton-icon { transform: scale(1.0) !important; padding: 6px !important; } #${POPUP_ID} { max-width: 285px !important; } #${POPUP_ID} menuitem { padding-inline-start: 8px !important; padding-inline-end: 8px !important; margin: 0 !important; min-height: 24px !important; } #${POPUP_ID} menuitem.menuitem-iconic .menu-icon { margin-inline-end: 8px !important; margin-inline-start: -30px !important; width: 16px !important; height: 16px !important; } #${POPUP_ID} menuitem.menuitem-iconic .menu-text { margin-left: 8px !important; font-weight: 500 !important; padding: 2px 0 2px 0 !important; } #${POPUP_ID} menuitem.menuitem-iconic:hover .menu-text { margin-left: 8px !important; font-weight: 600 !important; color: red !important; } `; const sss = Cc["@mozilla.org/content/style-sheet-service;1"] .getService(Ci.nsIStyleSheetService); const uri = Services.io.newURI( "data:text/css;charset=utf-8," + encodeURIComponent(css) ); if (!sss.sheetRegistered(uri, sss.AUTHOR_SHEET)) { sss.loadAndRegisterSheet(uri, sss.AUTHOR_SHEET); } cssInjected = true; } catch (e) { console.error("[FoxStarter CSS]", e); } } // ========================================================= // ITEMS + ICONS // ========================================================= const ITEMS = { // installierte Versionen "ArbeitsFox 🏠": { exe: "C:\\Program Files\\Mozilla Firefox\\firefox.exe", profile: "ArbeitsFox", icon: "Finale.png" }, "Reserve 1 🏠": { exe: "C:\\Program Files\\Mozilla Firefox\\firefox.exe", profile: "Reserve", icon: "Finale.png" }, "Reserve 2 🏠": { exe: "C:\\Program Files\\Mozilla Firefox\\firefox.exe", profile: "Reserve-Profil 2", icon: "Finale.png" }, // portable Versionen "Firefox3p > portable < 🟢": { exe: "G:\\Firefox Test\\Firefox3p\\Firefox64\\firefox.exe", profile: "G:\\Firefox Test\\Firefox3p\\Profilordner", icon: "Finale.png" }, "Nightly1 > portable < 🔵": { exe: "G:\\Firefox Test\\Nightly1\\Firefox64\\firefox.exe", profile: "G:\\Firefox Test\\Nightly1\\Profilordner", icon: "Nightly.png" }, "Portable U Stable 3 🔥": { exe: "G:\\Portable.Firefox.Updater.3\\Firefox Stable x64\\firefox.exe", profile: "G:\\Portable.Firefox.Updater.3\\Firefox Stable x64\\profile", icon: "Finale.png" } }; // ========================================================= // START // ========================================================= function launch(item) { try { const file = Cc["@mozilla.org/file/local;1"] .createInstance(Ci.nsIFile); file.initWithPath(item.exe); const process = Cc["@mozilla.org/process/util;1"] .createInstance(Ci.nsIProcess); process.init(file); let args = []; const isFirefox = item.exe.toLowerCase().includes("firefox.exe"); const isProfilePath = item.profile && (item.profile.includes("\\") || item.profile.includes("/")); if (isFirefox && isProfilePath) { // -no-remote entfernt args = [ "-profile", item.profile, "-foreground" ]; } else if (isFirefox) { // -no-remote entfernt args = [ "-P", item.profile, "-foreground" ]; } process.run(false, args, args.length); } catch (e) { console.error("[FoxStarter]", e); } } // ========================================================= // MENU MIT ICONS // ========================================================= function buildMenu() { const btn = document.getElementById(btn_id); if (!btn || btn.querySelector("menupopup")) return; const popup = document.createXULElement("menupopup"); popup.setAttribute("id", POPUP_ID); for (const key of Object.keys(ITEMS)) { const item = ITEMS[key]; const mi = document.createXULElement("menuitem"); mi.setAttribute("label", key); mi.setAttribute("class", "menuitem-iconic"); const icon = item.icon ? ICON_BASE + item.icon : btn_icon; mi.setAttribute("image", icon); mi.style.listStyleImage = `url("${icon}")`; mi.addEventListener("command", () => { launch(item); }); popup.appendChild(mi); } btn.appendChild(popup); } // ========================================================= // BUTTON // ========================================================= try { CustomizableUI.createWidget({ id: btn_id, defaultArea: CustomizableUI.AREA_NAVBAR, label: "FoxStart", tooltiptext: btn_tooltiptext, onCreated: (btn) => { btn.style.listStyleImage = `url("${btn_icon}")`; btn.setAttribute("type", "menu"); injectUserCSS(); buildMenu(); } }); } catch (e) {} setTimeout(() => { injectUserCSS(); buildMenu(); }, 500); })(); -
Beitrag von Mira_Belle (
18. Mai 2026 um 09:10 )Dieser Beitrag wurde vom Autor aus folgendem Grund gelöscht: Hat sich erledigt! (18. Mai 2026 um 09:12 ). -
Mag jemand testen?
Funktioniert das Skript auch aus einer installierten Nightly oder Beta?
Und was wichtiger ist, funktioniert es aus einer Portable?JavaScript
Alles anzeigen// FirefoxQuickStarter.uc.js // Das Script erstellt einen Button, der ein Menü zur Auswahl weiterer Instanzen öffnet. // Source file https://www.camp-firefox.de/forum/thema/xxx /* ----------------------------------------------------------------------------------- */ /* Zu beachten ist, dass die Grafiken sich im richtigen Ordner befinden müssen */ /* %appdata%\Mozilla\Firefox\Profiles\"Profilname"\chrome\icons */ /* ----------------------------------------------------------------------------------- */ (function() { if (!window.gBrowser || !CustomizableUI) return; const // ■■ START UserConfiguration ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ id = 'aboutprofiles-Start', // Id des Buttons label = 'Profil zusätzlich starten', // Bezeichnung des Buttons tooltiptext = 'Firefox Profile starten (Auswahl)', // Icon------------------------------------------------------- icon = 'profile.svg', // [Name.Dateiendung] des Symbols iconPath = 'file:///C:/FoxIcons/'; // Pfad zum Ordner der die Icons beinhaltet /* Vor Verwendung, Pfad auf eigene Umgebung ändern(\ wird durch \\ ersetzt): C:\\Program Files\\Mozilla Firefox\\firefox.exe oder C:\\Program Files\\Firefox Nightly\\firefox.exe */ // Standard-Firefox-Profile const standardProfiles = [ { name: "Mira", exe: "C:\\Program Files\\Mozilla Firefox\\firefox.exe", profile: "C:\\Users\\Mira\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\Mira", icon: "Finale.svg" }, { name: "Testprofil", exe: "C:\\Program Files\\Mozilla Firefox\\firefox.exe", profile: "C:\\Users\\Mira\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\Testprofil", icon: "Finale.svg" }, { name: "TEST_24-03-29", exe: "C:\\Program Files\\Mozilla Firefox\\firefox.exe", profile: "C:\\Users\\Mira\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\yd7mkrc6.TEST_24-03-29", icon: "Finale.svg" }, { name: "Nightly", exe: "C:\\Program Files\\Firefox Nightly\\firefox.exe", profile: "C:\\Users\\Mira\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\umilg7ve.Nightly", icon: "Nightly.svg" } ]; // Portable Firefox-Pfade const portableProfiles = [ { name: "Portable Version 53.0 💛", exe: "C:\\Portable-Firefox\\Firefox_53.0\\Firefox\\firefox.exe", profile: "C:\\Portable-Firefox\\Firefox_53.0\\Profilordner", icon: "Finale.svg" }, { name: "Portable Beta 💙", exe: "C:\\Portable-Firefox\\Beta\\Firefox\\firefox.exe", profile: "C:\\Portable-Firefox\\Beta\\Profilordner", icon: "Beta.svg" }, { name: "Portable Nightly 💜", exe: "C:\\Portable-Firefox\\Nightly\\Firefox\\firefox.exe", profile: "C:\\Portable-Firefox\\Nightly\\Profilordner", icon: "Nightly.svg" } ]; // ■■ END UserConfiguration ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ // Alle Profile zusammenführen const allProfiles = [...standardProfiles, ...portableProfiles]; // SVG-Kontext-Eigenschaften aktivieren if (Services.prefs.getBoolPref('svg.context-properties.content.enabled') === false) { Services.prefs.setBoolPref('svg.context-properties.content.enabled', true); } // Button erstellen try { CustomizableUI.createWidget({ id: id, defaultArea: CustomizableUI.AREA_NAVBAR, label: label, tooltiptext: tooltiptext, onCreated: (button) => { button.style.MozContextProperties = 'fill, stroke, fill-opacity'; button.style.listStyleImage = `url("${iconPath}${icon}")`; button.style.minWidth = 'fit-content'; button.style.color = '#EE3939'; // Menü nach dem Erstellen des Buttons aufbauen buildMenu(button); } }); } catch (e) { console.error("Fehler beim Erstellen des Buttons:", e); } // Funktion zum Aufbau des Menüs function buildMenu(button) { if (!button || button.querySelector("menupopup")) return; const menu = document.createElementNS( "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menupopup" ); menu.id = `${id}-menu`; // Für jedes Profil einen Menüeintrag erstellen allProfiles.forEach((item) => { const menuItem = document.createElementNS( "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem" ); menuItem.setAttribute("label", item.name); menuItem.setAttribute("class", "menuitem-iconic"); menuItem.setAttribute("image", `${iconPath}${item.icon}`); menuItem.style.listStyleImage = `url("${iconPath}${item.icon}")`; menuItem.addEventListener("command", () => { launch(item); }); menu.appendChild(menuItem); }); button.appendChild(menu); // Menü beim Klick auf den Button öffnen button.addEventListener("click", (event) => { menu.openPopup(button, "after_start", 0, 0, false, false, event); }); } // Funktion zum Starten des Browsers mit dem ausgewählten Profil function launch(item) { try { const file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile); file.initWithPath(item.exe); const process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); process.init(file); let args = []; const isFirefox = item.exe.toLowerCase().includes("firefox.exe"); const isProfilePath = item.profile && (item.profile.includes("\\") || item.profile.includes("/")); if (isFirefox && isProfilePath) { args = ["-profile", item.profile, "-foreground"]; } else if (isFirefox) { args = ["-P", item.profile.split("\\").pop(), "-foreground"]; } process.run(false, args, args.length); } catch (e) { console.error("[FoxStarter]", e); } } })(); -
Mag jemand testen?
Getestet aus portable Nightly 153, funktioniert alles wie gewünscht. Nur als Hinweis, bei den installierten reicht es vollkommen aus, wenn nur der Name des Profiles angegeben wird. Aus installierter Beta/Nightly kann ich nicht testen, weil nicht vorhanden. Ein Nachteil deines Scriptes ist der, dass es den Elchtest nicht besteht.
-
Getestet aus portable Nightly 153, funktioniert alles wie gewünscht.
Danke für's testen. Ich habe das Skript in kürzester Zeit zusammen gezimmert, da ich gerade sehr eingebunden bin.
Aber so habe ich erst einmal einen Anfang.Nur als Hinweis, bei den installierten reicht es vollkommen aus, wenn nur der Name des Profiles angegeben wird.
Werde ich mir merken!
us installierter Beta/Nightly kann ich nicht testen,
Macht nichts, das konnte ich noch machen.
Ein Nachteil deines Scriptes ist der, dass es den Elchtest nicht besteht.
Mist, kannst Du mir den noch einmal erklären,
oder darauf verlinken, wenn es schon eine Erklärung hier im Board gibt?
Ich komme gerade nicht darauf, was genau das für ein Test war. -
Mist, kannst Du mir den noch einmal erklären,
oder darauf verlinken, wenn es schon eine Erklärung hier im Board gibt?
Ich komme gerade nicht darauf, was genau das für ein Test war.Das Script besteht nicht den Elchtest, dass heißt, im ersten Fenster wird das Script bedient, dann wird das Fenster geschlossen. Jetzt soll das Script auch in den weiteren geöffneten Fenstern funktionieren, aber das macht es nicht.
-