Da kann ich auch noch ein Script beisteuern, funktioniert in allen Fenstern, und ohne Fehler in der Konsole.
JavaScript
// Button zum Aufruf des Profil-Ordners
(function() {
if (location.href !== 'chrome://browser/content/browser.xhtml') return;
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 = "Profil Button (generic)";
const open_in_a_window = false;
CustomizableUI.createWidget({
id: 'Profil-Button',
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("ProfD");
uProfMenu.prefDirOpen('ProfD');
} catch (e) {}
}
},
onCreated: function(button) {
return button;
}
});
// style button icon
const uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent('\
\
#Profil-Button .toolbarbutton-icon {\
list-style-image: url("file:///C:/FoxIcons2/prof.png"); \
}\
\
'), null, null);
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
} catch (e) {
Components.utils.reportError(e);
};
})();
Alles anzeigen

