Oups, funktioniert nur leider nicht, jedenfalls der CSS Teil.
Nu aber, sorry.
JavaScript
// https://www.camp-firefox.de/forum/thema/136599-tooltips-nur-f%C3%BCr-die-bedienoberfl%C3%A4che-ausschalten/?postID=1249369#post1249369
// tooltip-toggle_5.uc.js raus#1
(function() {
if (location.href !== 'chrome://browser/content/browser.xhtml')
return;
try {
CustomizableUI.createWidget({
id: 'tooltip_button',
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onCommand: onCommand,
onBuild: function(aDocument) {
var currentProfileDirectory = Services.dirsvc.get("ProfD", Ci.nsIFile).path.replace(/\\/g, "/");
var buttonicon = "LettersT-2.png"
var toolbaritem = aDocument.createXULElement('toolbarbutton');
var props = {
id: 'tooltip_button',
class: 'toolbarbutton-1 chromeclass-toolbar-additional',
removable: true,
label: 'Tooltip Toggle',
tooltiptext: "toggle tooltips",
style: 'list-style-image: url("' + ("file:" + currentProfileDirectory + "/chrome/icons/" + buttonicon) + '");',
background: Services.prefs.getBoolPref('browser.chrome.toolbar_tips') ?
'red' : 'cyan',
oncommand: '(' + onCommand.toString() + ')()'
};
for (var p in props)
toolbaritem.setAttribute(p, props[p]);
return toolbaritem;
}
});
} catch(e) { };
function onCommand() {
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
var isEnabled = !prefs.getBoolPref('browser.chrome.toolbar_tips');
prefs.setBoolPref('browser.chrome.toolbar_tips', isEnabled);
var button = document.getElementById('tooltip_button');
if (isEnabled) {
button.style.background = 'red';
} else {
button.style.background = 'cyan';
}
let uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent(`
/* button in toolbar */
toolbar:not([customizing]) #tooltip_button[background ="cyan"]:not(:hover, :active) .toolbarbutton-icon {
opacity: 0.5 !important;
}
/* button in overflow menu */
:root:not([customizing]) #tooltip_button[background ="cyan"] label {
opacity: 0.5 !important;
}
`), null, null);
sss.loadAndRegisterSheet(uri, prefs.AUTHOR_SHEET);
};
})();
Alles anzeigen