Das sind all meine Scripte und der Markierte ist für FF restarten mit cache leeren..
und das ist der Inhalt des Scripts.
JavaScript
// RestartFirefox_plus.uc.js 2
(function() {
if (location != 'chrome://browser/content/browser.xhtml') return;
try {
CustomizableUI.createWidget({
id: 'restart-button',
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) {
var toolbaritem = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbarbutton');
var props = {
id: 'restart-button',
class: 'toolbarbutton-1 chromeclass-toolbar-additional',
removable: false,
label: 'Neustart',
tooltiptext: 'Neustart (mit Rechts- und Mittelklick wird userChrome.js-Cache geleert)',
style: 'list-style-image: url(file:///C:/Users/Ramo/AppData/Roaming/Mozilla/Firefox/Profiles/c612nnc8.default-release/chrome/Icons/restartButton.png)',
onclick: 'if (event.button == 0) { \
Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit); \
}; \
if (event.button == 1 || event.button == 2) { \
Services.appinfo.invalidateCachesOnRestart(); \
Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit); \
};'
};
for (var p in props)
toolbaritem.setAttribute(p, props[p]);
return toolbaritem;
}
});
CustomizableUI.registerToolbarNode(tb);
} catch(e) { };
var menuitem = document.createXULElement('menuitem');
var props = {
id: 'restartfirefox-fileMenu2',
label: 'Neustart',
tooltiptext: 'Neustart (mit Rechts- und Mittelklick wird userChrome.js-Cache geleert)',
onclick: 'if (event.button == 0) { \
Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit); \
}; \
if (event.button == 1 || event.button == 2) { \
Services.appinfo.invalidateCachesOnRestart(); \
Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit); \
};'
};
for (var p in props)
menuitem.setAttribute(p, props[p]);
document.getElementById('menu_FilePopup').insertBefore(menuitem, document.getElementById('menu_FileQuitItem'));
(function() {
var menuitem = document.createXULElement('toolbarbutton');
menuitem.id = 'uc_menu_Restart_H';
menuitem.classList.add('subviewbutton', 'subviewbutton-iconic');
menuitem.setAttribute('label' , 'Neustart');
menuitem.setAttribute('tooltiptext' , 'Neustart');
menuitem.style.listStyleImage= 'url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="context-fill" fill-opacity="context-fill-opacity" d="M15,1a1,1,0,0,0-1,1V4.418A6.995,6.995,0,1,0,8,15a6.954,6.954,0,0,0,4.95-2.05,1,1,0,0,0-1.414-1.414A5.019,5.019,0,1,1,12.549,6H10a1,1,0,0,0,0,2h5a1,1,0,0,0,1-1V2A1,1,0,0,0,15,1Z"/></svg>\')';
menuitem.setAttribute('oncommand' , "Services.appinfo.invalidateCachesOnRestart() || Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);");
var refItem = document.getElementById('appMenu-viewCache').content.getElementById('appMenu-quit-button2');
refItem.parentNode.insertBefore(menuitem, refItem);
})();
})();
Alles anzeigen