auf der Suche nach ExtraConfigMenu.uc.js, welches mir passt.
-
omar1979 -
4. November 2026 um 14:02 -
Erledigt
-
-
Das Script ist jetzt auf dein System (Ordner chrome) zugeschnitten. Alle Funktionen für about-Seiten sind entfernt, können hier also nicht mehr aufgerufen werden. Wenn du noch Zusätze wünscht dann sag an, wir helfen dir. So, dann teste erst einmal das Script.
JavaScript
Alles anzeigen// ==UserScript== // @name config_menu_pro.uc.js // @compatibility Firefox 155+ // @include main // @version 1.5.2.1 // @description Konfigurationsmenü für Firefox 155+, Spezielles Menü für User omar1979 // ==/UserScript== /* ======================================================================== * 1. Konfiguration * ====================================================================== */ var uProfMenu = { TextOpenExe: 'C:\\Program Files\\Microsoft VS Code\\Code.exe', vFileManager: '', // leer = System-Dateimanager showAsButton: 1, // 1 = Toolbarbutton, 0 = Menü unter Extras cssOrdner: 1, jsSubfolder: 'Scripte', cssFolderName: 'CSS', cssShadowFolderName: 'CSSShadow', cssWebFolderName: 'CSSWeb', enableScriptsToClip: 2, // 0 = aus, 1 = ohne Nummer, 2 = nummeriert enableRestart: 0, // Interner Status, nicht ändern buttonInitRetry: false, initialized: false, customUI: null, /* ====================================================================== * 2. Start * ====================================================================== */ init() { if (this.initialized) return; const menu = this.showAsButton ? this.initAsButton() : this.initAsExtrasMenu(); if (!menu) return; if (menu.querySelector('#ExtraConfigMenu-popup')) { this.initialized = true; return; } this.installStyle(); const popup = menu.appendChild( this.createME('menupopup', null, null, null, 'ExtraConfigMenu-popup') ); popup.addEventListener('popupshowing', () => uProfMenu.refresh(), true); this.buildMenu(popup); this.initialized = true; }, initAsButton() { if (!this.loadCustomizableUI()) { this.retryInit(); return null; } if (!this.customUI.getWidget('ExtraConfigMenu-button')) { try { this.customUI.createWidget({ id: 'ExtraConfigMenu-button', type: 'custom', defaultArea: this.customUI.AREA_NAVBAR, label: 'Extra Config Menü', tooltiptext: 'Extra Config Menü\nRechtsklick öffnet about:config', onBuild: doc => { const btn = doc.createXULElement('toolbarbutton'); btn.setAttribute('id', 'ExtraConfigMenu-button'); btn.setAttribute('label', 'Extra Config Menü'); btn.setAttribute('tooltiptext', 'Extra Config Menü\nRechtsklick öffnet about:config'); btn.setAttribute('type', 'menu'); btn.setAttribute('class', 'toolbarbutton-1'); btn.setAttribute('removable', 'true'); btn.setAttribute('chromeclass', 'toolbar-additional'); return btn; } }); } catch (e) { this.log('CustomizableUI.createWidget fehlgeschlagen: ' + e); return null; } } const btn = document.getElementById('ExtraConfigMenu-button'); if (!btn) { this.retryInit(); return null; } if (!btn.hasAttribute('data-uProfMenu-context')) { btn.addEventListener('contextmenu', e => { e.preventDefault(); e.stopPropagation(); uProfMenu.openURL('about:config'); }, true); btn.setAttribute('data-uProfMenu-context', 'true'); } return btn; }, initAsExtrasMenu() { const toolsPopup = document.getElementById('menu_ToolsPopup'); if (!toolsPopup) { this.log('Das Extras-Menü wurde nicht gefunden.'); return null; } let menu = document.getElementById('ExtraConfigMenu'); if (!menu) { menu = toolsPopup.appendChild( this.createME('menu', 'Extra Config Menü', null, 'menu-iconic', 'ExtraConfigMenu') ); menu.addEventListener('dblclick', () => uProfMenu.openURL('about:config'), true); } return menu; }, retryInit() { if (this.buttonInitRetry) return; this.buttonInitRetry = true; setTimeout(() => { uProfMenu.buttonInitRetry = false; uProfMenu.init(); }, 500); }, refresh() { this.getScripts(0); if (this.cssOrdner) { [3, 4, 5].forEach(t => this.getCss(t)); } }, /* ====================================================================== * 3. Menüaufbau * ====================================================================== */ buildMenu(popup) { this.buildScriptMenu(popup); if (this.cssOrdner) this.buildCssMenus(popup); this.buildExtraFoldersMenu(popup); this.buildClipboardEntry(popup); this.buildConfigFiles(popup); this.buildChromeFolders(popup); this.buildPrefsRestart(popup); }, buildScriptMenu(popup) { this.createSubmenu(popup, 'Meine Scripte', 'submenu-ucjs', 'submenu-ucjs-items'); }, buildCssMenus(popup) { this.createSubmenu(popup, 'CSS', 'submenu-css', 'submenu-css-items'); this.createSubmenu(popup, 'CSSWeb', 'submenu-cssweb', 'submenu-cssweb-items'); this.createSubmenu(popup, 'CSSShadow', 'submenu-CSSShadow', 'submenu-CSSShadow-items'); }, buildExtraFoldersMenu(popup) { this.createSubmenu(popup, 'Weitere Ordner öffnen', 'submenu-weitere-ordner', 'submenu-weitere-ordner-items'); const fp = document.getElementById('submenu-weitere-ordner-items'); if (!fp) return; const folders = [ ['Installationsordner', this.getPrefPath('CurProcD')], ['Profilordner', this.getPrefPath('ProfD')], ['Startup-Cache-Ordner', this.getPrefPath('ProfLD') + this.getSep() + 'startupCache'], ['Add-ons-Ordner', this.getPrefPath('ProfD') + this.getSep() + 'extensions'], ['Icons-Ordner', this.getChromePath('icons')], ['Ordner HamburgerMenu', this.getChromePath('HamburgerMenu')], ['Ordner Leisten', this.getChromePath('Leisten')], ['Ordner Menuleiste', this.getChromePath('Menuleiste')] ]; folders.forEach(([label, path]) => this.addFolderItem(fp, label, path)); }, buildClipboardEntry(popup) { if (!this.enableScriptsToClip) return; this.addCommandItem(popup, 'Skriptliste in Zwischenablage', () => uProfMenu.getScripts(1), 'uProfMenu_clipboard'); }, buildConfigFiles(popup) { popup.appendChild(document.createXULElement('menuseparator')); const files = [ ['userChrome.css', 0], ['userContent.css', 0], ['userChromeShadow.css', 0], ['userChrome.js', 0], ['user.js', 1] ]; files.forEach(([name, mode]) => { this.addCommandItem(popup, name, () => uProfMenu.edit(mode, name), 'uProfMenu_edit'); }); popup.appendChild(document.createXULElement('menuseparator')); }, buildChromeFolders(popup) { this.addCommandItem(popup, 'Chrome-Ordner öffnen', () => uProfMenu.openPrefDir('UChrm'), 'uProfMenu_folder'); this.addFolderItem(popup, 'Scripte-Ordner öffnen', this.getChromePath(this.jsSubfolder)); if (!this.cssOrdner) return; this.addFolderItem(popup, 'CSS-Ordner öffnen', this.getChromePath(this.cssFolderName)); this.addFolderItem(popup, 'CSSWeb-Ordner öffnen', this.getChromePath(this.cssWebFolderName)); this.addFolderItem(popup, 'CSSshadow-Ordner öffnen', this.getChromePath(this.cssShadowFolderName)); }, buildPrefsRestart(popup) { if (this.enableRestart) { popup.appendChild(document.createXULElement('menuseparator')); this.addCommandItem(popup, 'Neustart', () => { try { if (typeof ToolRstartMod !== 'undefined' && ToolRstartMod && ToolRstartMod.restartApp) { ToolRstartMod.restartApp(false); } else { Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit); } } catch (e) { alert('Neustart nicht möglich:\n' + e); } }, 'uProfMenu_restart'); } }, /* ====================================================================== * 4. Mappings für CSS und Zähler * ====================================================================== */ cssInfo(type) { const map = { 3: [this.cssFolderName, 'submenu-css', 'submenu-css-items', 'Meine CSS-Dateien'], 4: [this.cssWebFolderName, 'submenu-cssweb', 'submenu-cssweb-items', 'Meine CSSWeb-Dateien'], 5: [this.cssShadowFolderName, 'submenu-CSSShadow', 'submenu-CSSShadow-items', 'Meine CSSShadow-Dateien'] }; return map[type]; }, countClassFor(type) { const map = { 0: 'uProfMenu-count-scripts', 3: 'uProfMenu-count-css', 4: 'uProfMenu-count-cssweb', 5: 'uProfMenu-count-cssshadow' }; return map[type] || ''; }, /* ====================================================================== * 5. Basis-Helfer für XUL * ====================================================================== */ createME(type, label, command, cls, id) { const el = document.createXULElement(type); if (label) el.setAttribute('label', label); if (cls) el.setAttribute('class', cls); if (id) el.setAttribute('id', id); if (type === 'menuitem' && typeof command === 'function') { el.addEventListener('command', command, true); } return el; }, createSubmenu(parent, label, menuId, popupId) { const menu = parent.appendChild(this.createME('menu', label, null, null, menuId)); menu.appendChild(this.createME('menupopup', null, null, null, popupId)); return menu; }, addCommandItem(parent, label, command, cls, attrs) { const item = this.createME('menuitem', label, command, cls, null); if (attrs) for (const n in attrs) item.setAttribute(n, attrs[n]); parent.appendChild(item); return item; }, addFolderItem(parent, label, path) { return this.addCommandItem( parent, label, e => uProfMenu.dirOpen(e.currentTarget.getAttribute('data-path')), 'uProfMenu_folder', { 'data-path': path } ); }, /* ====================================================================== * 6. Pfade, Öffnen, Bearbeiten * ====================================================================== */ getSep() { return Services.appinfo.OS === 'WINNT' ? '\\' : '/'; }, getPrefPath(name) { const f = Services.dirsvc.get(name, Ci.nsIFile); if (name === 'CurProcD') return f.parent.path; return f.path; }, getChromePath(sub) { const base = this.getPrefPath('UChrm'); return sub ? base + this.getSep() + sub : base; }, openPrefDir(name) { this.dirOpen(this.getPrefPath(name)); }, openURL(url) { try { openTrustedLinkIn(url, 'tab'); } catch (e) { try { gBrowser.addTrustedTab(url); } catch (e2) { openLinkIn(url, 'tab', { triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal() }); } } }, dirOpen(path) { if (this.vFileManager) { try { const fm = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile); const pr = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess); fm.initWithPath(this.vFileManager); pr.init(fm); pr.run(false, [path], 1); return; } catch (e) { alert('Dateimanager konnte nicht gestartet werden:\n' + e); return; } } try { const f = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile); f.initWithPath(path); if (f.exists()) f.launch(); else alert('Ordner nicht gefunden:\n' + path); } catch (e) { alert('Ordner konnte nicht geöffnet werden:\n' + e); } }, edit(mode, filename) { const sep = this.getSep(); // Pfad mit Unterordner, z.B. Scripte/test.uc.js if (/[\/]/.test(filename)) { this.launch(this.TextOpenExe, this.getChromePath(null) + sep + filename.replace(/[\/]/g, sep)); return; } let path = null; if (mode === 0) path = this.getChromePath(null) + sep + filename; else if (mode === 1) path = this.getPrefPath('ProfD') + sep + filename; else if (mode === 2) path = filename; else { const info = this.cssInfo(mode); if (!info) return; path = this.getChromePath(info[0]) + sep + filename; } this.launch(this.TextOpenExe, path); }, launch(editorPath, filePath) { try { const ed = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile); const pr = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess); ed.initWithPath(editorPath); if (!ed.exists()) { try { editorPath = Services.prefs.getStringPref('view_source.editor.path'); } catch (e) { alert('Editor nicht gefunden und view_source.editor.path ist nicht gesetzt.'); return; } ed.initWithPath(editorPath); } if (!ed.exists()) { alert('Editor nicht gefunden:\n' + editorPath); return; } pr.init(ed); pr.run(false, [filePath], 1); } catch (e) { alert('Datei konnte nicht geöffnet werden:\n' + e); } }, loadCustomizableUI() { if (this.customUI) return true; try { const m = ChromeUtils.importESModule('moz-src:///browser/components/customizableui/CustomizableUI.sys.mjs'); if (!m || !m.CustomizableUI) throw new Error('CustomizableUI-Export nicht vorhanden.'); this.customUI = m.CustomizableUI; return true; } catch (e) { this.customUI = null; Cu.reportError('config_menu_pro.uc.js: CustomizableUI konnte nicht geladen werden.\n' + e); return false; } }, /* ====================================================================== * 7. Script- und CSS-Listen * ====================================================================== */ getScripts(type) { const scripts = []; this.collectScripts(Services.dirsvc.get('UChrm', Ci.nsIFile), '', scripts); if (this.jsSubfolder) { const sf = Services.dirsvc.get('UChrm', Ci.nsIFile); sf.append(this.jsSubfolder); this.collectScripts(sf, this.jsSubfolder, scripts); } if (type === 0) { this.fillMenu('submenu-ucjs', 'submenu-ucjs-items', 'Meine Scripte', scripts, 'uProfMenu_ucjs', 0); return; } const names = scripts.map(s => s.split(/[\/]/).pop()); try { Cc['@mozilla.org/widget/clipboardhelper;1'] .getService(Ci.nsIClipboardHelper) .copyString(this.fillClipboardValue(names)); } catch (e) { alert('Zwischenablage konnte nicht gesetzt werden:\n' + e); } }, collectScripts(folder, rel, out) { if (!folder.exists() || !folder.isDirectory()) return; const en = folder.directoryEntries; while (en.hasMoreElements()) { const f = en.getNext().QueryInterface(Ci.nsIFile); if (f.isFile() && /.uc.js$/i.test(f.leafName)) { out.push(rel ? rel + '/' + f.leafName : f.leafName); } } }, getCss(type) { const info = this.cssInfo(type); if (!info) return; const folder = Services.dirsvc.get('UChrm', Ci.nsIFile); folder.append(info[0]); const files = []; if (folder.exists() && folder.isDirectory()) { const en = folder.directoryEntries; while (en.hasMoreElements()) { const f = en.getNext().QueryInterface(Ci.nsIFile); if (f.isFile() && /.css$/i.test(f.leafName)) files.push(f.leafName); } } this.fillMenu(info[1], info[2], info[3], files, 'uProfMenu_css', type); }, fillMenu(subId, popId, label, files, cls, type) { const sub = document.getElementById(subId); const pop = document.getElementById(popId); if (!sub || !pop) return; sub.classList.add('count-menu'); sub.setAttribute('label', label); sub.setAttribute('tooltiptext', label + ': ' + files.length + ' Einträge'); const old = sub.querySelector('.uProfMenu-count'); if (old) old.remove(); const counter = document.createXULElement('label'); counter.setAttribute('value', '(' + files.length + ')'); counter.classList.add('uProfMenu-count', this.countClassFor(type)); sub.appendChild(counter); while (pop.firstChild) pop.firstChild.remove(); for (let i = files.length - 1; i >= 0; i--) { const fn = files[i]; const item = this.createME('menuitem', fn.split(/[\/]/).pop(), null, cls, null); if (type === 0) { item.setAttribute('tooltiptext', 'Linksklick: Bearbeiten'); item.addEventListener('command', () => uProfMenu.edit(0, fn), true); } else { item.addEventListener('command', () => uProfMenu.edit(type, fn), true); } pop.insertBefore(item, pop.firstChild); } }, fillClipboardValue(scripts) { const head = 'Meine Skripte (' + scripts.length + '):\n------------------------'; if (this.enableScriptsToClip === 1) return head + '\n' + scripts.join('\n'); return head + scripts.map((s, i) => '\n' + (i + 1) + '. ' + s).join(''); }, /* ====================================================================== * 8. Stil und Protokoll * ====================================================================== */ installStyle() { const css = ` #ExtraConfigMenu, #ExtraConfigMenu-button { list-style-image: url("file:///C:/FoxIcons/1206.png") !important; margin-right: 10px !important; margin-bottom: 2px !important; margin-top: 2px !important; } #ExtraConfigMenu-button > dropmarker, #ExtraConfigMenu-button > hbox > .toolbarbutton-menu-dropmarker, #ExtraConfigMenu-button > .toolbarbutton-menu-dropmarker { display: none !important; } #ExtraConfigMenu-popup > menu.count-menu { min-width: 260px !important; } #ExtraConfigMenu-popup .uProfMenu-count { color: #ff9800 !important; font-weight: 600 !important; font-size: 13px !important; margin-inline-start: auto !important; margin-inline-end: 10px !important; min-width: 32px !important; text-align: right !important; } #ExtraConfigMenu-popup .uProfMenu-count-scripts { color: #b4292a !important; } #ExtraConfigMenu-popup .uProfMenu-count-css { color: #336634 !important; } #ExtraConfigMenu-popup .uProfMenu-count-cssweb { color: #85467b !important; } #ExtraConfigMenu-popup .uProfMenu-count-cssshadow { color: #004d33 !important; } #ExtraConfigMenu-popup menu.count-menu .menu-text { flex: 1 1 auto !important; } #ExtraConfigMenu-popup menu.count-menu > label.uProfMenu-count { margin-left: auto !important; margin-right: 8px !important; } `; try { 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.AGENT_SHEET)) sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET); } catch (e) { Cu.reportError('config_menu_pro.uc.js: CSS konnte nicht installiert werden:\n' + e); } }, log(msg) { if (typeof userChrome !== 'undefined' && typeof userChrome.log === 'function') { userChrome.log('config_menu_pro.uc.js: ' + msg); } else { try { console.log('config_menu_pro.uc.js: ' + msg); } catch (e) {} } } }; uProfMenu.init(); -
Das Script ist jetzt auf dein System (Ordner chrome) zugeschnitten.
Vielen Dank, werd ich bei Gelegenheit testen, aber fehlen auf dem Bild nicht die "about Seiten"?
-
aber fehlen auf dem Bild nicht die "about Seiten"?
RE: auf der Suche nach ExtraConfigMenu.uc.js, welches mir passt. Erste Zeile, du machst Sachen, überlege vorher was für dich wichtig ist. Und nun?
-
1. Kann man diese 5 Ordner die mit Klick im Explorer geöffnet werden, in den Ornder "Weitere Ordner öffnen" verschieben und den Ordner umändern zu "Ornder öffnen" ?
2. Kann man die 3 Ordner " Ordner HamburgerMenu, Ordner Leisten, Ordner Menuleiste" dort lassen, damit sie im Explorer geöffnet werden und zusätzlich diese 3 Ordner nach vor wie den Ordner "Meine Scripte" usw machen, dass die Inhalte angezeigt werden und auf klick darauf die Dateien aufgemacht werden im Notepad++ ?
Ist das viel Arbeit?
Erste Zeile, du machst Sachen, überlege vorher was für dich wichtig ist. Und nun?
Ok Sorry, dort meinte ich den Ordner der 0 (Null) anzeigte. Nicht wie im alten Script, die die about-seiten im browser öffnete.
Tut mir leid und vergiss bitte auch grad den vorherigen beitrag von mir. Das nimmt viel zeit.
Nochmals: Tut mir leid.
-
JavaScript
Alles anzeigen// ==UserScript== // @name config_menu_pro.uc.js // @compatibility Firefox 155+ // @include main // @version 1.5.3.0 // @description Konfigurationsmenü für Firefox 155+, Spezielles Menü für User omar1979 // ==/UserScript== /* ======================================================================== * 1. Konfiguration * ====================================================================== */ var uProfMenu = { TextOpenExe: 'C:\\Program Files\\Microsoft VS Code\\Code.exe', vFileManager: '', // leer = System-Dateimanager showAsButton: 1, // 1 = Toolbarbutton, 0 = Menü unter Extras cssOrdner: 1, jsSubfolder: 'Scripte', cssFolderName: 'CSS', cssShadowFolderName: 'CSSShadow', cssWebFolderName: 'CSSWeb', enableScriptsToClip: 2, // 0 = aus, 1 = ohne Nummer, 2 = nummeriert enableRestart: 0, abouts: [ 'about:about', 'about:config', 'about:logins', 'about:profiles', 'about:support', 'about:addons', 'about:preferences', 'about:debugging', 'about:cache', 'about:crashes', 'about:third-party', 'about:unloads', 'about:memory', 'about:performance', 'about:url-classifier', 'about:windows-messages' ], // Interner Status, nicht ändern buttonInitRetry: false, initialized: false, customUI: null, /* ====================================================================== * 2. Start * ====================================================================== */ init() { if (this.initialized) return; const menu = this.showAsButton ? this.initAsButton() : this.initAsExtrasMenu(); if (!menu) return; if (menu.querySelector('#ExtraConfigMenu-popup')) { this.initialized = true; return; } this.installStyle(); const popup = menu.appendChild( this.createME('menupopup', null, null, null, 'ExtraConfigMenu-popup') ); popup.addEventListener('popupshowing', () => uProfMenu.refresh(), true); this.buildMenu(popup); this.initialized = true; }, initAsButton() { if (!this.loadCustomizableUI()) { this.retryInit(); return null; } if (!this.customUI.getWidget('ExtraConfigMenu-button')) { try { this.customUI.createWidget({ id: 'ExtraConfigMenu-button', type: 'custom', defaultArea: this.customUI.AREA_NAVBAR, label: 'Extra Config Menü', tooltiptext: 'Extra Config Menü\nRechtsklick öffnet about:config', onBuild: doc => { const btn = doc.createXULElement('toolbarbutton'); btn.setAttribute('id', 'ExtraConfigMenu-button'); btn.setAttribute('label', 'Extra Config Menü'); btn.setAttribute('tooltiptext', 'Extra Config Menü\nRechtsklick öffnet about:config'); btn.setAttribute('type', 'menu'); btn.setAttribute('class', 'toolbarbutton-1'); btn.setAttribute('removable', 'true'); btn.setAttribute('chromeclass', 'toolbar-additional'); return btn; } }); } catch (e) { this.log('CustomizableUI.createWidget fehlgeschlagen: ' + e); return null; } } const btn = document.getElementById('ExtraConfigMenu-button'); if (!btn) { this.retryInit(); return null; } if (!btn.hasAttribute('data-uProfMenu-context')) { btn.addEventListener('contextmenu', e => { e.preventDefault(); e.stopPropagation(); uProfMenu.openURL('about:config'); }, true); btn.setAttribute('data-uProfMenu-context', 'true'); } return btn; }, initAsExtrasMenu() { const toolsPopup = document.getElementById('menu_ToolsPopup'); if (!toolsPopup) { this.log('Das Extras-Menü wurde nicht gefunden.'); return null; } let menu = document.getElementById('ExtraConfigMenu'); if (!menu) { menu = toolsPopup.appendChild( this.createME('menu', 'Extra Config Menü', null, 'menu-iconic', 'ExtraConfigMenu') ); menu.addEventListener('dblclick', () => uProfMenu.openURL('about:config'), true); } return menu; }, retryInit() { if (this.buttonInitRetry) return; this.buttonInitRetry = true; setTimeout(() => { uProfMenu.buttonInitRetry = false; uProfMenu.init(); }, 500); }, refresh() { this.getScripts(0); if (this.cssOrdner) { [3, 4, 5].forEach(t => this.getCss(t)); } [6, 7, 8].forEach(t => this.getCss(t)); const subAbout = document.getElementById('submenu-about'); if (subAbout) this.fillAboutItems(subAbout); }, /* ====================================================================== * 3. Menüaufbau * ====================================================================== */ buildMenu(popup) { this.buildScriptMenu(popup); if (this.cssOrdner) this.buildCssMenus(popup); this.buildCustomFolderMenus(popup); this.buildAboutMenu(popup); this.buildExtraFoldersMenu(popup); this.buildClipboardEntry(popup); this.buildConfigFiles(popup); this.buildPrefsRestart(popup); }, buildCustomFolderMenus(popup) { this.createSubmenu(popup, 'Ordner HamburgerMenu', 'submenu-hamburgermenu', 'submenu-hamburgermenu-items'); this.createSubmenu(popup, 'Ordner Leisten', 'submenu-leisten', 'submenu-leisten-items'); this.createSubmenu(popup, 'Ordner Menuleiste', 'submenu-menuleiste', 'submenu-menuleiste-items'); }, buildScriptMenu(popup) { this.createSubmenu(popup, 'Meine Scripte', 'submenu-ucjs', 'submenu-ucjs-items'); }, buildCssMenus(popup) { this.createSubmenu(popup, 'CSS', 'submenu-css', 'submenu-css-items'); this.createSubmenu(popup, 'CSSWeb', 'submenu-cssweb', 'submenu-cssweb-items'); this.createSubmenu(popup, 'CSSShadow', 'submenu-CSSShadow', 'submenu-CSSShadow-items'); }, buildAboutMenu(popup) { if (!this.abouts.length) return; popup.appendChild(document.createXULElement('menuseparator')); // Erster Eintrag "0" = direkt im Hauptmenü zeigen if (this.abouts[0] === '0') { for (let i = 1; i < this.abouts.length; i++) { const url = this.abouts[i]; this.addCommandItem(popup, url, () => uProfMenu.openURL(url), 'uProfMenu_about'); } return; } this.createSubmenu(popup, 'about-Seiten', 'submenu-about', 'submenu-about-items'); this.fillAboutItems(document.getElementById('submenu-about')); }, fillAboutItems(sub) { if (!sub) return; const pop = sub.querySelector('#submenu-about-items'); if (!pop) return; while (pop.firstChild) pop.firstChild.remove(); this.abouts.forEach(url => { const item = this.addCommandItem(pop, url, () => uProfMenu.openURL(url), 'uProfMenu_about'); item.setAttribute('tooltiptext', url); }); sub.classList.add('count-menu'); sub.setAttribute('tooltiptext', 'about-Seiten: ' + this.abouts.length + ' Einträge'); const old = sub.querySelector('.uProfMenu-count'); if (old) old.remove(); const counter = document.createXULElement('label'); counter.setAttribute('value', '(' + this.abouts.length + ')'); counter.classList.add('uProfMenu-count', 'uProfMenu-count-about'); sub.appendChild(counter); }, buildExtraFoldersMenu(popup) { this.createSubmenu(popup, 'Ordner öffnen', 'submenu-weitere-ordner', 'submenu-weitere-ordner-items'); const fp = document.getElementById('submenu-weitere-ordner-items'); if (!fp) return; const folders = [ ['Installationsordner', this.getPrefPath('CurProcD')], ['Profilordner', this.getPrefPath('ProfD')], ['Startup-Cache-Ordner', this.getPrefPath('ProfLD') + this.getSep() + 'startupCache'], ['Add-ons-Ordner', this.getPrefPath('ProfD') + this.getSep() + 'extensions'], ['Icons-Ordner', this.getChromePath('icons')], ['Chrome-Ordner öffnen', this.getChromePath(null)], ['Scripte-Ordner öffnen', this.getChromePath(this.jsSubfolder)] ]; if (this.cssOrdner) { folders.push( ['CSS-Ordner öffnen', this.getChromePath(this.cssFolderName)], ['CSSWeb-Ordner öffnen', this.getChromePath(this.cssWebFolderName)], ['CSSshadow-Ordner öffnen', this.getChromePath(this.cssShadowFolderName)] ); } folders.forEach(([label, path]) => this.addFolderItem(fp, label, path)); }, buildClipboardEntry(popup) { if (!this.enableScriptsToClip) return; this.addCommandItem(popup, 'Skriptliste in Zwischenablage', () => uProfMenu.getScripts(1), 'uProfMenu_clipboard'); }, buildConfigFiles(popup) { popup.appendChild(document.createXULElement('menuseparator')); const files = [ ['userChrome.css', 0], ['userContent.css', 0], ['userChromeShadow.css', 0], ['userChrome.js', 0], ['user.js', 1] ]; files.forEach(([name, mode]) => { this.addCommandItem(popup, name, () => uProfMenu.edit(mode, name), 'uProfMenu_edit'); }); popup.appendChild(document.createXULElement('menuseparator')); }, buildPrefsRestart(popup) { if (this.enableRestart) { popup.appendChild(document.createXULElement('menuseparator')); this.addCommandItem(popup, 'Neustart', () => { try { if (typeof ToolRstartMod !== 'undefined' && ToolRstartMod && ToolRstartMod.restartApp) { ToolRstartMod.restartApp(false); } else { Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit); } } catch (e) { alert('Neustart nicht möglich:\n' + e); } }, 'uProfMenu_restart'); } }, /* ====================================================================== * 4. Mappings für CSS und Zähler * ====================================================================== */ cssInfo(type) { const map = { 3: [this.cssFolderName, 'submenu-css', 'submenu-css-items', 'Meine CSS-Dateien'], 4: [this.cssWebFolderName, 'submenu-cssweb', 'submenu-cssweb-items', 'Meine CSSWeb-Dateien'], 5: [this.cssShadowFolderName, 'submenu-CSSShadow', 'submenu-CSSShadow-items', 'Meine CSSShadow-Dateien'], 6: ['HamburgerMenu', 'submenu-hamburgermenu', 'submenu-hamburgermenu-items', 'Ordner HamburgerMenu'], 7: ['Leisten', 'submenu-leisten', 'submenu-leisten-items', 'Ordner Leisten'], 8: ['Menuleiste', 'submenu-menuleiste', 'submenu-menuleiste-items', 'Ordner Menuleiste'] }; return map[type]; }, countClassFor(type) { const map = { 0: 'uProfMenu-count-scripts', 3: 'uProfMenu-count-css', 4: 'uProfMenu-count-cssweb', 5: 'uProfMenu-count-cssshadow', 6: 'uProfMenu-count-hamburgermenu', 7: 'uProfMenu-count-leisten', 8: 'uProfMenu-count-menuleiste' }; return map[type] || ''; }, /* ====================================================================== * 5. Basis-Helfer für XUL * ====================================================================== */ createME(type, label, command, cls, id) { const el = document.createXULElement(type); if (label) el.setAttribute('label', label); if (cls) el.setAttribute('class', cls); if (id) el.setAttribute('id', id); if (type === 'menuitem' && typeof command === 'function') { el.addEventListener('command', command, true); } return el; }, createSubmenu(parent, label, menuId, popupId) { const menu = parent.appendChild(this.createME('menu', label, null, null, menuId)); menu.appendChild(this.createME('menupopup', null, null, null, popupId)); return menu; }, addCommandItem(parent, label, command, cls, attrs) { const item = this.createME('menuitem', label, command, cls, null); if (attrs) for (const n in attrs) item.setAttribute(n, attrs[n]); parent.appendChild(item); return item; }, addFolderItem(parent, label, path) { return this.addCommandItem( parent, label, e => uProfMenu.dirOpen(e.currentTarget.getAttribute('data-path')), 'uProfMenu_folder', { 'data-path': path } ); }, /* ====================================================================== * 6. Pfade, Öffnen, Bearbeiten * ====================================================================== */ getSep() { return Services.appinfo.OS === 'WINNT' ? '\\' : '/'; }, getPrefPath(name) { const f = Services.dirsvc.get(name, Ci.nsIFile); if (name === 'CurProcD') return f.parent.path; return f.path; }, getChromePath(sub) { const base = this.getPrefPath('UChrm'); return sub ? base + this.getSep() + sub : base; }, openPrefDir(name) { this.dirOpen(this.getPrefPath(name)); }, openURL(url) { try { openTrustedLinkIn(url, 'tab'); } catch (e) { try { gBrowser.addTrustedTab(url); } catch (e2) { openLinkIn(url, 'tab', { triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal() }); } } }, dirOpen(path) { if (this.vFileManager) { try { const fm = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile); const pr = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess); fm.initWithPath(this.vFileManager); pr.init(fm); pr.run(false, [path], 1); return; } catch (e) { alert('Dateimanager konnte nicht gestartet werden:\n' + e); return; } } try { const f = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile); f.initWithPath(path); if (f.exists()) f.launch(); else alert('Ordner nicht gefunden:\n' + path); } catch (e) { alert('Ordner konnte nicht geöffnet werden:\n' + e); } }, edit(mode, filename) { const sep = this.getSep(); // Pfad mit Unterordner, z.B. Scripte/test.uc.js if (/[/]/.test(filename)) { this.launch(this.TextOpenExe, this.getChromePath(null) + sep + filename.replace(/[/]/g, sep)); return; } let path = null; if (mode === 0) path = this.getChromePath(null) + sep + filename; else if (mode === 1) path = this.getPrefPath('ProfD') + sep + filename; else if (mode === 2) path = filename; else { const info = this.cssInfo(mode); if (!info) return; path = this.getChromePath(info[0]) + sep + filename; } this.launch(this.TextOpenExe, path); }, launch(editorPath, filePath) { try { const ed = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile); const pr = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess); ed.initWithPath(editorPath); if (!ed.exists()) { try { editorPath = Services.prefs.getStringPref('view_source.editor.path'); } catch (e) { alert('Editor nicht gefunden und view_source.editor.path ist nicht gesetzt.'); return; } ed.initWithPath(editorPath); } if (!ed.exists()) { alert('Editor nicht gefunden:\n' + editorPath); return; } pr.init(ed); pr.run(false, [filePath], 1); } catch (e) { alert('Datei konnte nicht geöffnet werden:\n' + e); } }, loadCustomizableUI() { if (this.customUI) return true; try { const m = ChromeUtils.importESModule('moz-src:///browser/components/customizableui/CustomizableUI.sys.mjs'); if (!m || !m.CustomizableUI) throw new Error('CustomizableUI-Export nicht vorhanden.'); this.customUI = m.CustomizableUI; return true; } catch (e) { this.customUI = null; Cu.reportError('config_menu_pro.uc.js: CustomizableUI konnte nicht geladen werden.\n' + e); return false; } }, /* ====================================================================== * 7. Script- und CSS-Listen * ====================================================================== */ getScripts(type) { const scripts = []; this.collectScripts(Services.dirsvc.get('UChrm', Ci.nsIFile), '', scripts); if (this.jsSubfolder) { const sf = Services.dirsvc.get('UChrm', Ci.nsIFile); sf.append(this.jsSubfolder); this.collectScripts(sf, this.jsSubfolder, scripts); } if (type === 0) { this.fillMenu('submenu-ucjs', 'submenu-ucjs-items', 'Meine Scripte', scripts, 'uProfMenu_ucjs', 0); return; } const names = scripts.map(s => s.split(/[/]/).pop()); try { Cc['@mozilla.org/widget/clipboardhelper;1'] .getService(Ci.nsIClipboardHelper) .copyString(this.fillClipboardValue(names)); } catch (e) { alert('Zwischenablage konnte nicht gesetzt werden:\n' + e); } }, collectScripts(folder, rel, out) { if (!folder.exists() || !folder.isDirectory()) return; const en = folder.directoryEntries; while (en.hasMoreElements()) { const f = en.getNext().QueryInterface(Ci.nsIFile); if (f.isFile() && /.uc.js$/i.test(f.leafName)) { out.push(rel ? rel + '/' + f.leafName : f.leafName); } } }, getCss(type) { const info = this.cssInfo(type); if (!info) return; const folder = Services.dirsvc.get('UChrm', Ci.nsIFile); folder.append(info[0]); const files = []; if (folder.exists() && folder.isDirectory()) { const en = folder.directoryEntries; while (en.hasMoreElements()) { const f = en.getNext().QueryInterface(Ci.nsIFile); if (f.isFile() && /.css$/i.test(f.leafName)) files.push(f.leafName); } } this.fillMenu(info[1], info[2], info[3], files, 'uProfMenu_css', type); }, fillMenu(subId, popId, label, files, cls, type) { const sub = document.getElementById(subId); const pop = document.getElementById(popId); if (!sub || !pop) return; sub.classList.add('count-menu'); sub.setAttribute('label', label); sub.setAttribute('tooltiptext', label + ': ' + files.length + ' Einträge'); const old = sub.querySelector('.uProfMenu-count'); if (old) old.remove(); const counter = document.createXULElement('label'); counter.setAttribute('value', '(' + files.length + ')'); counter.classList.add('uProfMenu-count', this.countClassFor(type)); sub.appendChild(counter); while (pop.firstChild) pop.firstChild.remove(); for (let i = files.length - 1; i >= 0; i--) { const fn = files[i]; const item = this.createME('menuitem', fn.split(/[/]/).pop(), null, cls, null); if (cls === 'uProfMenu_about') { // about-Seiten öffnen, nicht im Editor bearbeiten item.setAttribute('tooltiptext', fn); item.addEventListener('command', () => uProfMenu.openURL(fn), true); } else if (type === 0) { item.setAttribute('tooltiptext', 'Linksklick: Bearbeiten'); item.addEventListener('command', () => uProfMenu.edit(0, fn), true); } else { item.addEventListener('command', () => uProfMenu.edit(type, fn), true); } pop.insertBefore(item, pop.firstChild); } }, fillClipboardValue(scripts) { const head = 'Meine Skripte (' + scripts.length + '):\n------------------------'; if (this.enableScriptsToClip === 1) return head + '\n' + scripts.join('\n'); return head + scripts.map((s, i) => '\n' + (i + 1) + '. ' + s).join(''); }, /* ====================================================================== * 8. Stil und Protokoll * ====================================================================== */ installStyle() { const css = ` #ExtraConfigMenu, #ExtraConfigMenu-button { list-style-image: url("file:///C:/FoxIcons/1206.png") !important; margin-right: 10px !important; margin-bottom: 2px !important; margin-top: 2px !important; } #ExtraConfigMenu-button > dropmarker, #ExtraConfigMenu-button > hbox > .toolbarbutton-menu-dropmarker, #ExtraConfigMenu-button > .toolbarbutton-menu-dropmarker { display: none !important; } #ExtraConfigMenu-popup > menu.count-menu { min-width: 260px !important; } #ExtraConfigMenu-popup .uProfMenu-count { color: #ff9800 !important; font-weight: 600 !important; font-size: 13px !important; margin-inline-start: auto !important; margin-inline-end: 10px !important; min-width: 32px !important; text-align: right !important; } #ExtraConfigMenu-popup .uProfMenu-count-scripts { color: #b4292a !important; } #ExtraConfigMenu-popup .uProfMenu-count-css { color: #336634 !important; } #ExtraConfigMenu-popup .uProfMenu-count-cssweb { color: #85467b !important; } #ExtraConfigMenu-popup .uProfMenu-count-cssshadow { color: #004d33 !important; } #ExtraConfigMenu-popup .uProfMenu-count-about { color: #1547a1 !important; } #ExtraConfigMenu-popup .uProfMenu-count-hamburgermenu { color: #d97706 !important; } #ExtraConfigMenu-popup .uProfMenu-count-leisten { color: #7c3aed !important; } #ExtraConfigMenu-popup .uProfMenu-count-menuleiste { color: #0f766e !important; } #ExtraConfigMenu-popup menu.count-menu .menu-text { flex: 1 1 auto !important; } #ExtraConfigMenu-popup menu.count-menu > label.uProfMenu-count { margin-left: auto !important; margin-right: 8px !important; } `; try { 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.AGENT_SHEET)) sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET); } catch (e) { Cu.reportError('config_menu_pro.uc.js: CSS konnte nicht installiert werden:\n' + e); } }, log(msg) { if (typeof userChrome !== 'undefined' && typeof userChrome.log === 'function') { userChrome.log('config_menu_pro.uc.js: ' + msg); } else { try { console.log('config_menu_pro.uc.js: ' + msg); } catch (e) {} } } }; uProfMenu.init(); -
FuchsFan das ist Perfekt!

-
das ist Perfekt!
Ende gut, alles gut!
Ich habe KI gesagt was du für Wünsche hast, und prompt wurde es erledigt. Also mach eine Verbeugung aus Dank an KI.

-
Ich habe KI gesagt was du für Wünsche hast, und prompt wurde es erledigt
//
Einspruch

Ich habe KI gesagt, ich möchte einen Bentley haben...und was ist...nix...
-
Also mach eine Verbeugung aus Dank an KI.

Der grössere Danke geht an dich, du hast KI gesagt was machen soll.

Ich habe KI gesagt, ich möchte einen Bentley haben...und was ist...nix...
Genau, KI erfüllt nicht all unsere Wünsche.

-
Einspruch

Ich habe KI gesagt, ich möchte einen Bentley haben...und was ist...nix...
Dann warst du wohl nicht artig.

-
Dann warst du wohl nicht artig.

-
Nun sehe ich, dass du die drei Ordner unter Ordner öffnen behalten wolltest.
JavaScript['Ordner HamburgerMenu', this.getChromePath('HamburgerMenu')], ['Ordner Leisten', this.getChromePath('Leisten')], ['Ordner Menuleiste', this.getChromePath('Menuleiste')],Füge diesen Block nach Zeile 232 wieder ein. So muss es dann aussehen.
-
Füge diesen Block nach Zeile 232 wieder ein. So muss es dann aussehen.
Dankeschön
JavaScript
Alles anzeigenconst folders = [ ['Installationsordner', this.getPrefPath('CurProcD')], ['Profilordner', this.getPrefPath('ProfD')], ['Startup-Cache-Ordner', this.getPrefPath('ProfLD') + this.getSep() + 'startupCache'], ['Add-ons-Ordner', this.getPrefPath('ProfD') + this.getSep() + 'extensions'], ['Icons-Ordner', this.getChromePath('icons')], ['Ordner HamburgerMenu', this.getChromePath('HamburgerMenu')], ['Ordner Leisten', this.getChromePath('Leisten')], ['Ordner Menuleiste', this.getChromePath('Menuleiste')], ['Chrome-Ordner öffnen', this.getChromePath(null)], ['Scripte-Ordner öffnen', this.getChromePath(this.jsSubfolder)] ]; -
ehm.. ich will in diesem script Separatoren sehen lassen, aber da mal eine css gemacht habe, um separatoren zu deaktivieren, weiss ich jetzt nicht mehr, welches es ist.
CSS/* Trennlinien im menubar-popups entfernen */ menuseparator:not(#bookmarksMenuPopup menuseparator):not(#historyMenuPopup menuseparator):not(#PersonalToolbar menuseparator) { display: none !important; }ist es das. oder das?
CSS#appMenu-protonMainView > vbox:nth-child(1) > toolbarseparator:nth-child(n+8) { display: none !important; }oder das?
Welches von denen ist es? oder habe ich irgendwo ein anderes?

ich würde ehner sagen: die erste.
-
welches es ist.
mit dem ersten entfernst du die Separatoren in den Menüs.
Die beiden anderen sind für das Hamburgermenu.
-
mit dem ersten entfernst du die Separatoren in den Menüs.
kann ich nicht eine ausnahme dort einfügen für das script?

-
eine ausnahme dort einfügen
Teste bitte:
-
Teste bitte:
Dankeschön, funkt.
Was noch stört, sind diese Popups, die noch schwarzen Hintergrund dazwischen haben.
Ich habe mal alle popups-hintergründe blau gemacht.
wo da css-schnipsel ist, weiss ich leider grad nicht.

-
Ich habe mal alle popups-hintergründe blau gemacht.
Wie lautet der Code dazu?
wo da css-schnipsel ist, weiss ich leider grad nicht.
Das solltest du aber schon rausfinden, sonst wird er kompliziert.
Der schwarze Hintergrund könnte von deinem genutzten Theme kommen.
Beispiel:
Oder auch mal testen wieder: Der Code ist für die ShadowCSS:
-