Hängt also nicht an den Toolbars bzw. halte ich für sehr unwahrscheinlich.
Ich wiederhole mich mal, es betrifft ja nur die about-Funktionen. Konsole, Einstellungen, Entwicklerwerkzeuge, alle sind nach dem Muster gefertigt, die funktionieren. Also sage ich mal als Stümper, da fehlt was in den betreffenden Scripten.![]()
![]()
Jetzt habe ich neuen Anlauf genommen, und ein Script von Aris umgebastelt, läuft in allen Fenstern, wenn Startfenster geschlossen ist, und funktioniert auch überall in der Addonbar. Könnte für Vergleichbares durchaus genutzt werden.
Hier mal das about:translations als Beispiel.
JavaScript
// 'about'-Button script for Firefox by Aris
// https://github.com/Aris-t2/CustomJSforFx/blob/master/scripts/about_button_generic.uc.js
// 29.01.2025 editiert für about:translations von @FuchsFan
(function() {
try {
ChromeUtils.importESModule("resource:///modules/CustomizableUI.sys.mjs");
const sss = Components.classes["@mozilla.org/content/style-sheet-service;1"].getService(Components.interfaces.nsIStyleSheetService);
const button_label = "Translations Button (generic)";
const open_in_a_window = false;
CustomizableUI.createWidget({
id: "about-button-translations",
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: button_label,
tooltiptext: button_label,
onClick: function(event) {
const win = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator)
.getMostRecentWindow("navigator:browser");
if(event.button=='0') {
try {
if(open_in_a_window)
window.open("about:translations");
else
win.gBrowser.selectedTab = win.gBrowser.addTrustedTab('about:translations');
} catch (e) {}
}
},
onCreated: function(button) {
return button;
}
});
// style button icon
const uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent('\
\
#about-button-translations .toolbarbutton-icon {\
list-style-image: url("file:///C:/FoxIcons2/1140.png"); /* icon / path to icon */ \
/* fill: dimgray; */ /* icon color name/code */\
}\
\
'), null, null);
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
} catch (e) {
Components.utils.reportError(e);
};
})();
Alles anzeigen
