- Firefox-Version
- Firefox 152.0
- Betriebssystem
- Windows 11 Pro 64 Bit
Hallo zusammen.
bei dem ↓ Javascript funktioniert der Teil des Scripts nicht mehr, der einen Mittelklick erfordert, gibt es eine Anpassung dafür?
JavaScript
// ButtonInstallationsOrdner.uc.js
// Linksklick öffnen des Ordners "Firefox" / if (event.button === 0)
// Mittelklick öffnet den Profilordner / if (event.button === 1)
// Rechtsklick öffnet den chrome-Ordner / if (event.button === 2)
(function() {
if (!window.gBrowser)
return;
// Start User Einstellungen
let btn_id = 'installation_buttonplus'; // Button #id
const btn_icon = 'folder_go.png'; // Name+Dateiendung des Symbols
const iconPath = 'file:///H:/Profile/Firefox/Fx57-H-Default/chrome/icons/'; // Pfad zum Ordner der das Icon beinhaltet
const ImagePath = iconPath + btn_icon; // Kompletter Pfad zum Icon =>
const btn_label = 'Ordner öffnen'; // Bezeichnung
const btn_tooltiptext = 'Links Installationsordner / Mitte Profilordner / Rechtsklick chrome-Ordner' ; // Tooltip
// User Einstellungen Ende
// Button
try {
CustomizableUI.createWidget({
id: btn_id,
defaultArea: CustomizableUI.AREA_NAVBAR,
label: btn_label,
tooltiptext: btn_tooltiptext,
onCreated: (this_button) => {
this_button.style.MozContextProperties = 'fill, stroke, fill-opacity, stroke-opacity';
this_button.style.listStyleImage = 'url("' + ImagePath + '")';
this_button.style.minWidth = 'fit-content';
}
});
} catch(e) {}
function click_button() {
document.getElementById(btn_id).addEventListener('click', event => {
if (event.button === 0) {
uProfMenu.prefDirOpen('CurProcD');
}
if (event.button == 1) {
event.target.ownerGlobal.Services.dirsvc.get("ProfD", Ci.nsIFile).launch();
}
if (event.button == 2) {
Services.dirsvc.get("UChrm", Ci.nsIFile).launch();
}
});
};
if (window.readyState !== "loading") {
setTimeout(click_button, 500);
}
else {
window.addEventListener( "DOMContentLoaded", click_button );
};
window.addEventListener('aftercustomization', () => {
setTimeout(() => click_button(), 100)
});
})();
Alles anzeigen