Bei mir arbeitet das u.a. Script sowohl in der aktuellen Firefoxversion und auch im Nightly
Code
// Addons-UpDate-Check.uc.js
// Das Script erstellt einen Button, der einen UpDate-Check ausführt und dies in einem neuen Tab anzeigt.
// Source file https://www.camp-firefox.de/forum/thema/140072/?postID=1282691#post1282691
/* ----------------------------------------------------------------------------------- */
/* Zu beachten ist, dass die Grafiken sich im richtigen Ordner befinden müssen */
/* %appdata%\Mozilla\Firefox\Profiles\"Profilname"\chrome\icons */
/* ----------------------------------------------------------------------------------- */
(function() {
if (!window.gBrowser)
return;
const
// ■■ START UserConfiguration ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
id = 'addons-update-button', // Id des Buttons
link = 'about:addons', // Linkziel des Buttons
label = 'Add-ons Update', // Bezeichnung des Buttons
tooltiptext = 'Add-ons aktualisieren',
// Icon-------------------------------------------------------
icon = '0060.png', // [Name.Dateiendung] des Symbols
iconPath = '/chrome/icons/', // Pfad zum Ordner der das Icon beinhaltet
// ■■ END UserConfiguration ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
curProfDir = PathUtils.toFileURI(PathUtils.join(PathUtils.profileDir));
if (Services.prefs.getBoolPref('svg.context-properties.content.enabled') == false) {
Services.prefs.setBoolPref('svg.context-properties.content.enabled', true );
}
//BUTTON
try {
CustomizableUI.createWidget({
id: id,
defaultArea: CustomizableUI.AREA_NAVBAR,
label: label,
tooltiptext: tooltiptext,
onCreated: (button) => {
button.style.MozContextProperties = 'fill, stroke, fill-opacity';
button.style.listStyleImage = 'url("' + curProfDir + iconPath + icon + '")';
button.style.minWidth = 'fit-content';
button.style.color = '#ffe10f'; // Farbe für das SVG-Icon setzen
}
});
} catch(e) {};
// click
(function click_button() {
const button = document.getElementById(id);
if (button) {
button.addEventListener('click', (event) => {
if (event.button !== 0) {
return;
}
// DER WRAPPER: Prüft erst documentGlobal (Neu), dann ownerGlobal (Alt)
const win = event.target.documentGlobal || event.target.ownerGlobal;
// Aufruf über das erkannte Fenster-Objekt
win.openTrustedLinkIn(link,'tab');
window.addEventListener('pageshow', function onPageshow(e) {
const doc = e.target;
if (doc.URL !== 'about:addons') {
return;
}
window.removeEventListener('pageshow', onPageshow);
doc.querySelector('addon-page-options panel-item[action="view-recent-updates"]').click();
doc.querySelector('addon-page-options panel-item[action="check-for-updates"]').click();
content.setTimeout(function () {
const categories = doc.getElementById('categories');
categories
.querySelector('button[viewid="addons://updates/recent"]')
.click();
categories
.querySelector('button[viewid="addons://updates/available"]')
.click();
}, 1500);
});
});
} else {
setTimeout(click_button, 100);
}
})();
})();
Alles anzeigen

