In dem Script Appmenu.uc.js (https://github.com/Endor8/userChr…5/Appmenu.uc.js ) lassen sich schon ab Firefox 153 einige Funktionen nicht mehr aufrufen. Mein Script konnte ich noch mit KI neu einrichten, dieses mit den vielen Base64-Codes will nicht gelingen. Wenn gewünscht, dann stelle ich auch mein Script zur Verfügung.
Das ist der Ansatz, der zum Erfolg führte: Appmenü ab Fox 153.txt
Edit:
Nun habe ich den Base64-Code entfernt, müsste dann wieder hier image: 'den Base64-Code hier einfügen ' eingefügt werden. Das Script funktioniert dann wieder, hier dann zum Test.
Code
// ==UserScript==
// @name Appmenu.uc.js
// @namespace Appmenu@gmail.com
// @description Firefox-Menübutton für Firefox 155+
// @include main
// @version 2025.01.01
// @author bege
// @charset UTF-8
// ==/UserScript==
var Appmenu = {
// ==============================
// Konfiguration
// ==============================
editor: Services.prefs.getCharPref(
'view_source.editor.path',
''
),
fileManager: '',
FMParameter: '/T',
autohideEmptySubDirs: true,
moveSubDirstoBottom: false,
// 0 = TabsToolbar
// 1 = Navigationsleiste
// 2 = Menüleiste
isUrlbar: 1,
// 0 = kleines Symbol
// 1 = großes Firefox-Symbol
isButton: 1,
hotkey: 'x',
hotkeyModifier: 'alt',
subdirPopupHash: Object.create(null),
subdirMenuHash: Object.create(null),
toolbar: {
subdirs: [
{
name: 'Firefox Verzeichnisse',
image: ' '
},
{
name: 'Firefox Profil-Dateien',
image: ' '
},
{
name: 'Firefox Funktionen',
image: ' '
},
{
name: 'about:',
image: ' '
}
],
apps: [
{
name: 'userChrome.css',
root: 'ProfD',
path: '\\chrome\\userChrome.css',
subdir: 'Firefox Profil-Dateien',
image: ' '
},
{
name: 'userContent.css',
root: 'ProfD',
path: '\\chrome\\userContent.css',
subdir: 'Firefox Profil-Dateien',
image: ' '
},
{
name: 'userChrome.js',
root: 'ProfD',
path: '\\chrome\\userChrome.js',
subdir: 'Firefox Profil-Dateien',
image: ' '
},
{
name: 'prefs.js',
root: 'ProfD',
path: '\\prefs.js',
subdir: 'Firefox Profil-Dateien',
image: ' '
},
{
name: 'user.js',
root: 'ProfD',
path: '\\user.js',
subdir: 'Firefox Profil-Dateien',
image: ' '
},
{
name: 'Profil',
root: 'ProfD',
path: '\\',
subdir: 'Firefox Verzeichnisse',
image: ' '
},
{
name: 'chrome',
root: 'ProfD',
path: '\\chrome',
subdir: 'Firefox Verzeichnisse',
image: ' '
},
{
name: 'CSS',
root: 'ProfD',
path: '\\chrome\\CSS',
subdir: 'Firefox Verzeichnisse',
image: ' '
},
{
name: 'JS',
root: 'ProfD',
path: '\\chrome\\JS',
subdir: 'Firefox Verzeichnisse',
image: ' '
},
{
name: 'Addons',
root: 'ProfD',
path: '\\extensions',
subdir: 'Firefox Verzeichnisse',
image: ' '
},
{
name: 'Programm',
root: 'CurProcD',
path: '\\',
subdir: 'Firefox Verzeichnisse',
image: ' '
},
{
name: 'Startup-Cache',
root: 'ProfLD',
path: '\\startupCache',
subdir: 'Firefox Verzeichnisse',
image: ' '
}
],
configs: [
{
name: 'Anpassen',
subdir: 'Firefox Funktionen',
image: ' '
},
{
name: 'Neustart im abgesicherten Modus',
subdir: 'Firefox Funktionen',
image: ' '
},
{
name: 'Browser-Konsole',
subdir: 'Firefox Funktionen',
image: ' '
},
{
name: 'Entwickler-Werkzeuge',
subdir: 'Firefox Funktionen',
image: ' '
},
{
name: 'Browser-Werkzeuge',
subdir: 'Firefox Funktionen',
image: ' '
},
{
name: 'Firefox synchronisieren',
subdir: 'Firefox Funktionen',
image: ' '
},
{
name: 'Zugangsdaten und Passwörter',
tooltiptext: 'about:logins',
subdir: 'Firefox Funktionen',
image: ' '
},
{
name: 'Task Manager',
tooltiptext: 'about:processes',
subdir: 'Firefox Funktionen',
image: ' '
},
{
name: 'Offline arbeiten',
subdir: 'Firefox Funktionen',
image: ' '
},
{
name: 'about:about',
subdir: 'about:',
image: ' '
},
{
name: 'about:cache',
subdir: 'about:',
image: ' '
},
{
name: 'about:certificate',
subdir: 'about:',
image: ' '
},
{
name: 'about:checkerboard',
subdir: 'about:',
image: ' '
},
{
name: 'about:compat',
subdir: 'about:',
image: ' '
},
{
name: 'about:config',
subdir: 'about:',
image: ' '
},
{
name: 'about:crashes',
subdir: 'about:',
image: ' '
},
{
name: 'about:debugging',
subdir: 'about:',
image: ' '
},
{
name: 'about:downloads',
subdir: 'about:',
image: ' '
},
{
name: 'about:logging',
subdir: 'about:',
image: ' '
},
{
name: 'about:logins',
subdir: 'about:',
image: ' '
},
{
name: 'about:memory',
subdir: 'about:',
image: ' '
},
{
name: 'about:networking',
subdir: 'about:',
image: ' '
},
{
name: 'about:processes',
tooltiptext: 'Task Manager',
subdir: 'about:',
image: ' '
},
{
name: 'about:policies',
subdir: 'about:',
image: ' '
},
{
name: 'about:profiles',
subdir: 'about:',
image: ' '
},
{
name: 'about:profiling',
subdir: 'about:',
image: ' '
},
{
name: 'about:protections',
subdir: 'about:',
image: ' '
},
{
name: 'about:rights',
subdir: 'about:',
image: ' '
},
{
name: 'about:serviceworkers',
subdir: 'about:',
image: ' '
},
{
name: 'about:studies',
subdir: 'about:',
image: ' '
},
{
name: 'about:support',
subdir: 'about:',
image: ' '
},
{
name: 'about:sync-log',
subdir: 'about:',
image: ' '
},
{
name: 'about:telemetry',
subdir: 'about:',
image: ' '
},
{
name: 'about:third-party',
subdir: 'about:',
image: ' '
},
{
name: 'about:unloads',
tooltiptext: 'Tabs entladen',
subdir: 'about:',
image: ' '
},
{
name: 'about:url-classifier',
subdir: 'about:',
image: ' '
},
{
name: 'about:webrtc',
subdir: 'about:',
image: ' '
},
{
name: 'about:windows-messages',
subdir: 'about:',
image: ' '
},
{
name: 'Neues privates Fenster',
id: 'AMprivate',
image: ' '
},
{
name: 'separator'
},
{
name: 'Einstellungen',
id: 'AMsettings',
image: ' '
},
{
name: 'Add-ons',
id: 'AMaddons',
image: ' '
},
{
name: 'separator'
},
{
name: 'Lesezeichen-Verwaltung',
id: 'AMbookmarks',
image: ' '
},
{
name: 'Chronik',
id: 'AMhistory',
image: ' '
},
{
name: 'Downloads',
id: 'AMdownloads',
image: ' '
},
{
name: 'Seite speichern unter...',
id: 'AMsave',
image: ' '
},
{
name: 'Chronik löschen',
id: 'AMsanitize',
image: ' '
},
{
name: 'separator'
},
{
name: 'Neustart',
id: 'AMreboot',
tooltiptext: 'userChrome.js-Cache wird geleert',
image: ' '
},
{
name: 'Beenden',
id: 'AMquit',
image: ' '
}
]
},
_externalAppPopup: null,
_isready: false,
// ==============================
// Initialisierung
// ==============================
init: function() {
this.handleRelativePath(this.toolbar.apps);
const XULNS =
'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul';
const ExternalAppBtn = document.createElementNS(
XULNS,
'toolbarbutton'
);
ExternalAppBtn.id = 'AppMenuButton';
ExternalAppBtn.setAttribute('label', 'AppButton');
ExternalAppBtn.setAttribute('tooltiptext', 'Firefox Menü');
ExternalAppBtn.setAttribute('type', 'menu');
ExternalAppBtn.setAttribute('removable', 'true');
// Firefox-internes Symbol statt Base64
//ExternalAppBtn.style.listStyleImage =
// 'url("chrome://browser/skin/menu.svg")';
if (Appmenu.isButton) {
ExternalAppBtn.style.listStyleImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAAAUCAYAAAAwaEt4AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAF3SURBVFhH7ZUxS8RAEIX9M1fb29vb+wP8AdaCYCVY2FmInY1YWmlrp7WtNp6ihyKKCDYrb7kPxsuMJiG5CO6DR5LZmd2Zl9ndhduNUSqssggTsAgTsAgTsAgTsLEw71enyYPGHvZW8vvHzUUlrinvd5e/reX59Mk/K8zn5DrPBTyfPtlamOeTTXe8K4LHg1V3vG92KgwdI2ADT8fr+UmcfNVZ4OVspzIH0Joau9teSq/n+1Nryl1l8yA3/LUdgWLxq8NOthKJ/CQMUCE2YQuJEwkz3lqsbC+AOCoeaB5y1U8hn7qcmzB0hArkr79dHuVvhFLhs3GaU9+Tw7WpJWV/2SQIIA4bIpJbU85tK1Gg6IkLojgKtoV664kWbc+oQYRRpwh0DHZLQJztGM6LOh3T9oYcRBjrZ2F9ADYJGIFcZg9bxPFy/Y2DCCOqxe2tpHd7cwAbp3G6TVDh9mBlPp1h+va6rC4bC/NfWIQJWIQJWIQJWIRxOUpfQ+jqXwPuQ7IAAAAASUVORK5CYII=)";
} else {
ExternalAppBtn.style.listStyleImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA6SURBVDhPYxgcIDg+6z8IQ7lwPiEMVT4YDBh4gO4kZGfiw1Dlg8GAgQfoTkJ2Jj4MVT4YDCAfMDAAAFSm42US1bMnAAAAAElFTkSuQmCC)";
}
let toolbar;
if (this.isUrlbar === 1) {
toolbar = document.getElementById(
'nav-bar-customization-target'
);
} else if (this.isUrlbar === 2) {
toolbar = document.getElementById(
'toolbar-menubar'
);
} else {
toolbar = document.getElementById(
'TabsToolbar'
);
}
if (toolbar) {
toolbar.insertBefore(
ExternalAppBtn,
toolbar.firstChild
);
}
ExternalAppBtn.addEventListener('click', event => {
event.preventDefault();
event.stopPropagation();
});
const ExternalAppPopup = document.createElementNS(
XULNS,
'menupopup'
);
ExternalAppPopup.id = 'AMpopup';
ExternalAppPopup.addEventListener('click', event => {
event.stopPropagation();
});
this._externalAppPopup = ExternalAppPopup;
ExternalAppBtn.appendChild(ExternalAppPopup);
this.onpopupshowing();
if (this.hotkey) {
const key = document.createXULElement('key');
key.id = 'key_AppMenuPopup';
key.setAttribute('key', this.hotkey);
if (this.hotkeyModifier) {
key.setAttribute(
'modifiers',
this.hotkeyModifier
);
}
key.addEventListener('command', () => {
document
.getElementById('AMpopup')
.openPopup();
});
document
.getElementById('mainKeyset')
.appendChild(key);
}
},
// ==============================
// Menü aufbauen
// ==============================
onpopupshowing: function() {
if (this._isready || !this._externalAppPopup) {
return;
}
const popup = this._externalAppPopup;
for (const subdir of this.toolbar.subdirs) {
if (subdir.name === 'separator') {
popup.appendChild(
document.createXULElement('menuseparator')
);
continue;
}
const menu = document.createXULElement('menu');
const subpopup = document.createXULElement(
'menupopup'
);
menu.setAttribute('class', 'menu-iconic');
menu.setAttribute('label', subdir.name);
menu.setAttribute('image', subdir.image);
menu.appendChild(subpopup);
popup.appendChild(menu);
this.subdirPopupHash[subdir.name] = subpopup;
this.subdirMenuHash[subdir.name] = menu;
}
for (const app of this.toolbar.apps) {
let item;
if (app.name === 'separator') {
item = document.createXULElement(
'menuseparator'
);
} else {
item = document.createXULElement('menuitem');
item.setAttribute(
'class',
'menuitem-iconic'
);
item.setAttribute('label', app.name);
item.setAttribute('image', app.image);
item.setAttribute(
'tooltiptext',
app.name
);
item.path = app.path;
item.args = app.args;
item.addEventListener('command', function() {
Appmenu.exec(
this.path,
this.args
);
});
}
if (
app.subdir &&
this.subdirPopupHash[app.subdir]
) {
this.subdirPopupHash[app.subdir]
.appendChild(item);
} else {
popup.appendChild(item);
}
}
for (const config of this.toolbar.configs) {
let item;
if (config.name === 'separator') {
item = document.createXULElement(
'menuseparator'
);
} else {
item = document.createXULElement(
'menuitem'
);
item.setAttribute(
'class',
'menuitem-iconic'
);
item.setAttribute(
'label',
config.name
);
item.setAttribute(
'image',
config.image
);
item.setAttribute(
'tooltiptext',
config.tooltiptext ||
config.name
);
if (config.id) {
item.setAttribute(
'id',
config.id
);
}
item.addEventListener(
'command',
event => {
Appmenu.executeCommand(
config.name,
event
);
}
);
}
if (
config.subdir &&
this.subdirPopupHash[config.subdir]
) {
this.subdirPopupHash[config.subdir]
.appendChild(item);
} else {
popup.appendChild(item);
}
}
if (this.autohideEmptySubDirs) {
for (const name in this.subdirPopupHash) {
const subpopup =
this.subdirPopupHash[name];
const menu =
this.subdirMenuHash[name];
if (
!subpopup.hasChildNodes() &&
menu
) {
menu.setAttribute(
'hidden',
'true'
);
}
}
}
if (this.moveSubDirstoBottom) {
let count = popup.childNodes.length;
while (
popup.firstChild &&
popup.firstChild.getAttribute(
'class'
) !== 'menuitem-iconic' &&
count-- > 0
) {
popup.appendChild(
popup.firstChild
);
}
}
this._isready = true;
},
// ==============================
// Neue Befehlsausführung
// ==============================
executeCommand: function(name, event) {
if (name.startsWith('about:')) {
openTrustedLinkIn(
name,
gBrowser.selectedTab.isEmpty
? 'current'
: 'tab'
);
return;
}
switch (name) {
case 'Anpassen':
gCustomizeMode.enter();
break;
case 'Neustart im abgesicherten Modus':
safeModeRestart();
break;
case 'Browser-Konsole': {
const { require } =
ChromeUtils.importESModule(
'resource://devtools/shared/loader/Loader.sys.mjs',
{}
);
const { BrowserConsoleManager } =
require(
'resource://devtools/client/webconsole/browser-console-manager'
);
BrowserConsoleManager
.openBrowserConsoleOrFocus();
break;
}
case 'Entwickler-Werkzeuge': {
const { require } =
ChromeUtils.importESModule(
'resource://devtools/shared/loader/Loader.sys.mjs',
{}
);
const { gDevToolsBrowser } =
require(
'devtools/client/framework/devtools-browser'
);
gDevToolsBrowser
.toggleToolboxCommand(
window.gBrowser,
Cu.now()
);
break;
}
case 'Browser-Werkzeuge': {
const { require } =
ChromeUtils.importESModule(
'resource://devtools/shared/loader/Loader.sys.mjs',
{}
);
const { BrowserToolboxLauncher } =
require(
'resource://devtools/client/framework/browser-toolbox/Launcher.sys.mjs'
);
BrowserToolboxLauncher.init();
break;
}
case 'Firefox synchronisieren':
gSync.openPrefs('menubar');
break;
case 'Zugangsdaten und Passwörter':
LoginHelper.openPasswordManager(
window,
{
entryPoint: 'mainmenu'
}
);
break;
case 'Task Manager':
switchToTabHavingURI(
'about:processes',
true
);
break;
case 'Offline arbeiten':
BrowserOffline.toggleOfflineStatus();
break;
case 'Neues privates Fenster':
OpenBrowserWindow({
private: true
});
break;
case 'Einstellungen':
openPreferences();
break;
case 'Add-ons':
BrowserAddonUI.openAddonsMgr();
break;
case 'Lesezeichen-Verwaltung':
PlacesCommandHook
.showPlacesOrganizer(
'AllBookmarks'
);
break;
case 'Chronik':
PlacesCommandHook
.showPlacesOrganizer(
'History'
);
break;
case 'Downloads':
BrowserCommands.downloadsUI();
break;
case 'Seite speichern unter...':
saveBrowser(
gBrowser.selectedBrowser
);
break;
case 'Chronik löschen':
Sanitizer.showUI(window);
break;
case 'Neustart':
Services.appinfo
.invalidateCachesOnRestart();
Services.startup.quit(
Ci.nsIAppStartup.eRestart |
Ci.nsIAppStartup.eAttemptQuit
);
break;
case 'Beenden':
goQuitApplication(event);
break;
default:
console.error(
'Appmenu: Unbekannter Befehl: ' +
name
);
}
},
// ==============================
// Pfade verarbeiten
// ==============================
handleRelativePath: function(apps) {
for (const app of apps) {
if (!app.path) {
continue;
}
app.path = app.path.replace(
/\//g,
'\\'
);
const ffdir = Cc[
'@mozilla.org/file/directory_service;1'
]
.getService(Ci.nsIProperties)
.get(app.root, Ci.nsIFile)
.path;
if (/^\\/.test(app.path)) {
app.path = ffdir + app.path;
}
}
},
// ==============================
// Dateien und Ordner öffnen
// ==============================
exec: function(path, args) {
args = args || [];
const args_t = args.slice(0);
for (let i = 0; i < args_t.length; i++) {
args_t[i] = args_t[i].replace(
/%u/g,
gBrowser.currentURI.spec
);
}
const file = Cc[
'@mozilla.org/file/local;1'
].createInstance(Ci.nsIFile);
file.initWithPath(path);
if (!file.exists()) {
alert(
'Datei nicht gefunden: ' +
path
);
return;
}
if (
file.isExecutable() &&
!path.endsWith('.js')
) {
const process = Cc[
'@mozilla.org/process/util;1'
].createInstance(Ci.nsIProcess);
process.init(file);
process.run(
false,
args_t,
args_t.length
);
return;
}
if (file.isFile()) {
if (this.editor) {
const converter = Cc[
'@mozilla.org/intl/scriptableunicodeconverter'
].createInstance(
Ci.nsIScriptableUnicodeConverter
);
converter.charset =
window.navigator.platform
.toLowerCase()
.includes('win')
? 'Shift_JIS'
: 'UTF-8';
const convertedPath =
converter.ConvertFromUnicode(
file.path
);
const editor =
Cc[
'@mozilla.org/file/local;1'
].createInstance(Ci.nsIFile);
editor.initWithPath(
this.editor
);
const process = Cc[
'@mozilla.org/process/util;1'
].createInstance(Ci.nsIProcess);
process.init(editor);
process.run(
false,
[convertedPath],
1
);
} else {
file.launch();
}
return;
}
if (file.isDirectory()) {
if (this.fileManager) {
const fmArgs = [
this.FMParameter,
path
];
const manager = Cc[
'@mozilla.org/file/local;1'
].createInstance(Ci.nsIFile);
manager.initWithPath(
this.fileManager
);
const process = Cc[
'@mozilla.org/process/util;1'
].createInstance(Ci.nsIProcess);
process.init(manager);
process.run(
false,
fmArgs,
fmArgs.length
);
} else {
file.launch();
}
}
}
};
if (window.gBrowser) {
Appmenu.init();
}
Alles anzeigen
