Hallo zusammen.
So habe eben das ganze Script aktualisiert.
Nun sollte alles wieder funktionieren in Firefox 69.
https://github.com/Endor8/userChr…oxbuttons.uc.js
Mfg.
Endor
Hallo zusammen.
So habe eben das ganze Script aktualisiert.
Nun sollte alles wieder funktionieren in Firefox 69.
https://github.com/Endor8/userChr…oxbuttons.uc.js
Mfg.
Endor
Nur zur Info.
Habe jetzt alle auf browser.xhtml aktualisiert.
Es sind bei ein paar Dateien auch noch ein paar Zeilen CSS dazu gekommen.
:wink:
Nochmals Danke an Boersenfeger für den Hinweis.
:klasse:
Mfg.
Endor
Hallo @teko und Kerian .
Prima freut mich wenn es passt.
War wie immer gern geschehen.
Danke für den Link. Für mich war es aber wichtig das selber zu schaffen.
Ich greife diesbezüglich nur wenn ich es wirklich nicht selber hinbekomme auf Hilfe von
anderen zu. Trotzdem nochmals danke für den Link.
Mfg.
Endor
Teste mal:
@-moz-document url-prefix("chrome://browser/content/browser.xhtml") {
treechildren::-moz-tree-image(container) {
list-style-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAd5JREFUeNqMU79rFUEQ/vbuodFEEkzAImBpkUabFP4ldpaJhZXYm/RiZWsv/hkWFglBUyTIgyAIIfgIRjHv3r39MePM7N3LcbxAFvZ2b2bn22/mm3XMjF+HL3YW7q28YSIw8mBKoBihhhgCsoORot9d3/ywg3YowMXwNde/PzGnk2vn6PitrT+/PGeNaecg4+qNY3D43vy16A5wDDd4Aqg/ngmrjl/GoN0U5V1QquHQG3q+TPDVhVwyBffcmQGJmSVfyZk7R3SngI4JKfwDJ2+05zIg8gbiereTZRHhJ5KCMOwDFLjhoBTn2g0ghagfKeIYJDPFyibJVBtTREwq60SpYvh5++PpwatHsxSm9QRLSQpEVSd7/TYJUb49TX7gztpjjEffnoVw66+Ytovs14Yp7HaKmUXeX9rKUoMoLNW3srqI5fWn8JejrVkK0QcrkFLOgS39yoKUQe292WJ1guUHG8K2o8K00oO1BTvXoW4yasclUTgZYJY9aFNfAThX5CZRmczAV52oAPoupHhWRIUUAOoyUIlYVaAa/VbLbyiZUiyFbjQFNwiZQSGl4IDy9sO5Wrty0QLKhdZPxmgGcDo8ejn+c/6eiK9poz15Kw7Dr/vN/z6W7q++091/AQYA5mZ8GYJ9K0AAAAAASUVORK5CYII=')
!important;}
}
Damit sind die Ordner da jetzt auch gelb.
Mfg.
Endor
Einen Teil habe ich glaube ich erwischt, wenn es mich aber nicht täuscht sind die Ordner bei Dir schon gelb.
@-moz-document url-prefix("chrome://browser/content/browser.xhtml") {
.folder-icon {
list-style-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAd5JREFUeNqMU79rFUEQ/vbuodFEEkzAImBpkUabFP4ldpaJhZXYm/RiZWsv/hkWFglBUyTIgyAIIfgIRjHv3r39MePM7N3LcbxAFvZ2b2bn22/mm3XMjF+HL3YW7q28YSIw8mBKoBihhhgCsoORot9d3/ywg3YowMXwNde/PzGnk2vn6PitrT+/PGeNaecg4+qNY3D43vy16A5wDDd4Aqg/ngmrjl/GoN0U5V1QquHQG3q+TPDVhVwyBffcmQGJmSVfyZk7R3SngI4JKfwDJ2+05zIg8gbiereTZRHhJ5KCMOwDFLjhoBTn2g0ghagfKeIYJDPFyibJVBtTREwq60SpYvh5++PpwatHsxSm9QRLSQpEVSd7/TYJUb49TX7gztpjjEffnoVw66+Ytovs14Yp7HaKmUXeX9rKUoMoLNW3srqI5fWn8JejrVkK0QcrkFLOgS39yoKUQe292WJ1guUHG8K2o8K00oO1BTvXoW4yasclUTgZYJY9aFNfAThX5CZRmczAV52oAPoupHhWRIUUAOoyUIlYVaAa/VbLbyiZUiyFbjQFNwiZQSGl4IDy9sO5Wrty0QLKhdZPxmgGcDo8ejn+c/6eiK9poz15Kw7Dr/vN/z6W7q++091/AQYA5mZ8GYJ9K0AAAAAASUVORK5CYII=')
!important;
-moz-image-region: rect(0px 16px 16px 0px) !important; }
}
Aber die unteren kriege ich nicht hin. Die kriegt man in den
Browser Werkzeugen einfach nicht zu fassen, jedenfalls ich. ![]()
![]()
Vielleicht hat 2002Andreas ja eine Idee.
Siehe nächsten Beitrag.
Mfg.
Endor
Hallo teko
Ändere Zeile 3 wieder zurück nach xul und teste,
Also: chrome://browser/content/places/places.xhtml
nach: chrome://browser/content/places/places.xul
und teste.
Mfg.
Endor
Achso, na dann ist alles klar....
Mfg.
Endor
Hallo GermanFreme82
Teste mal dieses Script, es schiebt nur die Tableiste wieder
unter die Lesezeichenleiste.
(function() {
var tabbar = document.getElementById('TabsToolbar');
if (tabbar && !tabbar.collapsed) {
tabbar.parentNode.parentNode.appendChild(tabbar);
};
})();
Speichere es als Script: TableisteUnten.uc.js im chrome Ordner.
Mfg.
Endor
Nur um nochmals klar zustellen, die Liste mit den geschlossenen Fenstern
wird hier nur im Rechtsklick Kontextmenü angezeigt. Im Tabkontextmenü
wird nur der Eintrag angezeigt aber nicht die Liste, das funktioniert aber
schon länger nicht mehr bei diesem Script. Kann aber leider nicht sagen wieso.
Mfg.
Endor
Also hier unter Firefox 69 werden auch geschlossene Fenster
einwandfrei angezeigt. Vermute mal dir haut da irgendwas dazwischen,
anderes Script, CSS Code usw.
Mfg.
Endor
Wie immer gern geschehen.
Freut mich wenn es funktioniert.
Mfg.
Endor
Bitte mal diese Version testen die ist ganz aktuell:
// ==UserScript==
// @name UndoListInTabmenuToo
// @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
// @description UndoListInTabmenuToo.uc.js
// @include main
// @compatibility Firefox 69.0
// @author Alice0775
// @version 2019/06/30 10:00 Bug 1555060 Convert <tabs> to a custom element
// @version 2019/06/24 23:00 wait for gBrowser initialized
// @version 2019/05/21 08:30 fix 69.0a1 Bug 1551320 - Replace all createElement calls in XUL documents with createXULElement
// @version 2018/05/10 60
// @version 2017/11/18 nsIPrefBranch to nsIPrefBranch
// @version 2010/09/18 00:00 4.0b7pre
// @version 2009/02/03 13:00 ツールチップにタブ内履歴を表示するようにした
// @Note タブやコンテキストメニューにもUndoClose Tab Listを追加するもの
// @OriginalCode browser.jsからpopulateUndoSubmenuを拝借し, ごにょごにょした
// @version 2018/05/09 15:00 61
// ==/UserScript==
// @version 2010/03/26 13:00 Minefield/3.7a4pre Bug 554991 - allow tab context menu to be modified by normal XUL overlays
// @version 2010/03/15 00:00 Minefield/3.7a4pre Bug 347930 - Tab strip should be a toolbar instead
// @version 2009/09/09 15:00 中クリック処理
// @version 2009/09/03 22:00 Firegox3.7a1preで動かなくなっていたのを修正(Bug 489925. getElementById should not return anonymous nodes)
// @version 2009/08/22 00:00 Firegox3.6 stringbandleの変更による
// @version 2009/04/24 00:00 #394759 [Firefox:Session Restore]-Add undo close window feature
// @version 2008/10/12 18:00 Fx3.0.4pre中クリックしたときメニューポップアップが閉じないおよびその他fix
// @version 2007/10/05 10:00
var UndoListInTabmenu = {
// -- config --
TABCONTEXTMENU : true , //Im Tabkontextmenü: anzeigen: true, nicht anzeigen: false
CONTEXTMENU : true, //Im Hauptkontextmenü: anzeigen: true , nicht anzeigen: false
// -- config end--
ss: null,
get tabContext() {
return document.getElementById("tabContextMenu");
},
init: function(){
if (this.TABCONTEXTMENU){
//タブコンテキスト
var tabContext = this.tabContext;
this.makePopup(tabContext, null, "tabContextUndoList");
}
if (this.CONTEXTMENU){
//コンテンツエリアコンテキスト
var contextMenu = document.getElementById("contentAreaContextMenu");
var refItem = document.getElementById("context-sep-stop");
this.makePopup(contextMenu, refItem, "ContextUndoList");
}
// get closed-tabs from nsSessionStore
try {
this._ss = Cc["@mozilla.org/browser/sessionstore;1"].
getService(Ci.nsISessionStore);
} catch(x) {
this._ss = SessionStore;
}
},
makePopup: function(popup, refItem, id){
var menu;
//label
const locale = "de";
if (this.getVer() > 3.0) {
// "Recently Closed Windows"
menu = document.createXULElement("menu");
menu.setAttribute("id", "historyUndoWindowMenu3");
menu.setAttribute("label", "K\u00FCrzlich geschlossene Fenster");
menu.setAttribute("accesskey", "F");
menu.setAttribute("disabled", "true");
popup.insertBefore(menu, refItem);
this.historyUndoWindowPopup3 = menu = menu.appendChild(document.createXULElement("menupopup"));
menu.setAttribute("id", "historyUndoWindowPopup3");
menu.setAttribute("onpopupshowing", "UndoListInTabmenu.populateUndoWindowSubmenu();");
}
//UndoClose Tab List - Liste kürzlich geschosener Tabs
const LABELTEXT = locale.indexOf("ja") == -1?"K\u00FCrzlich geschlossene Tabs":"\u6700\u8fd1\u9589\u3058\u305f\u30bf\u30d6"; //create menu
menu = document.createXULElement("menu");
menu.setAttribute("label", LABELTEXT);
menu.setAttribute("accesskey", "T");
if (id)
menu.setAttribute("id", id);
//menu.setAttribute("disabled", true);
var menupopup = document.createXULElement("menupopup");
if (this.getVer()<3) {
menupopup.setAttribute("onpopupshowing", "UndoListInTabmenu.populateUndoSubmenu(this);");
} else if (this.getVer()<3.6) {
menupopup.setAttribute("onpopupshowing", "UndoListInTabmenu.populateUndoSubmenu3(this);");
} else {
menupopup.setAttribute("onpopupshowing", "UndoListInTabmenu.populateUndoSubmenu36(this);");
}
menu.appendChild(menupopup);
popup.insertBefore(menu, refItem);
//add event listener
popup.addEventListener('popupshowing',function(event) {
if (UndoListInTabmenu.getVer() > 3.0)
UndoListInTabmenu.toggleRecentlyClosedWindows();
// no restorable tabs, so make sure menu is disabled, and return
if (UndoListInTabmenu._ss.getClosedTabCount(window) == 0) {
menu.setAttribute("disabled", true);
//menu.setAttribute("hidden", true);
return;
}
menu.removeAttribute("disabled");
//menu.setAttribute("hidden", false);
},false);
},
/**
* Populate when the history menu is opened (Fx2)
*/
populateUndoSubmenu: function(undoPopup) {
// remove existing menu items
while (undoPopup.hasChildNodes())
undoPopup.removeChild(undoPopup.firstChild);
// populate menu
var undoItems = eval("(" + UndoListInTabmenu._ss.getClosedTabData(window) + ")");
for (var i = 0; i < undoItems.length; i++) {
var m = undoPopup.appendChild(document.createXULElement("menuitem"));
m.setAttribute("label", undoItems[i].title);
m.setAttribute("value", i);
m.setAttribute("oncommand", "undoCloseTab(" + i + ");");
m.setAttribute("onclick", "UndoListInTabmenu._undoCloseMiddleClick(event);");
}
// "open in tabs"
var bundleService = Cc["@mozilla.org/intl/stringbundle;1"].
getService(Ci.nsIStringBundleService);
var stringBundle = bundleService.createBundle("chrome://browser/locale/bookmarks/bookmarks.properties");
undoPopup.appendChild(document.createXULElement("menuseparator"));
m = undoPopup.appendChild(document.createXULElement("menuitem"));
m.setAttribute("label", stringBundle.GetStringFromName("cmd_bm_openfolder"));
m.setAttribute("accesskey", stringBundle.GetStringFromName("cmd_bm_openfolder_accesskey"));
m.addEventListener("command", function() {
for (var i = 0; i < undoItems.length; i++)
undoCloseTab();
}, false);
},
/**
* Re-open a closed tab and put it to the end of the tab strip.
* Used for a middle click.
* @param aEvent
* The event when the user clicks the menu item
*/
_undoCloseMiddleClick: function PHM__undoCloseMiddleClick(aEvent) {
if (aEvent.button != 1)
return;
undoCloseTab(aEvent.originalTarget.value);
gBrowser.moveTabToEnd();
if (!aEvent.ctrlKey)
aEvent.originalTarget.parentNode.parentNode.parentNode.hidePopup();
},
/**
* Populate when the history menu is opened (Fx3)
*/
populateUndoSubmenu3: function(undoPopup) {
// remove existing menu items
while (undoPopup.hasChildNodes())
undoPopup.removeChild(undoPopup.firstChild);
// "Open All in Tabs"
var strings = gNavigatorBundle;
m = undoPopup.appendChild(document.createXULElement("menuitem"));
m.setAttribute("label", strings.getString("menuOpenAllInTabs.label"));
m.setAttribute("accesskey", strings.getString("menuOpenAllInTabs.accesskey"));
m.addEventListener("command", function() {
for (var i = 0; i < undoItems.length; i++)
undoCloseTab();
}, false);
undoPopup.appendChild(document.createXULElement("menuseparator"));
// populate menu
var undoItems = eval("(" + UndoListInTabmenu._ss.getClosedTabData(window) + ")");
for (var i = 0; i < undoItems.length; i++) {
var entries = undoItems[i].state.entries;
var tooltiptext = "";
for (var j = entries.length - 1; j > -1; j--){
if (j != entries.length - 1)
tooltiptext += "\n";
tooltiptext += parseInt(j + 1, 10) + ". " + entries[j].title;
}
var m = document.createXULElement("menuitem");
m.setAttribute("tooltiptext", tooltiptext);
m.setAttribute("label", undoItems[i].title);
if (undoItems[i].image)
m.setAttribute("image", undoItems[i].image);
m.setAttribute("class", "menuitem-iconic bookmark-item");
m.setAttribute("value", i);
m.setAttribute("oncommand", "undoCloseTab(" + i + ");");
m.setAttribute("onclick", "UndoListInTabmenu._undoCloseMiddleClick(event);");
if (i == 0)
m.setAttribute("key", "key_undoCloseTab");
undoPopup.appendChild(m);
}
// "Clear undo close tb list"
undoPopup.appendChild(document.createXULElement("menuseparator"));
m = undoPopup.appendChild(document.createXULElement("menuitem"));
m.setAttribute("label", "Liste der letzten Tabs l\u00F6schen");
m.setAttribute("accesskey", "l");
m.addEventListener("command", function() {
var max_undo = UndoListInTabmenu.getPref("browser.sessionstore.max_tabs_undo", "int", 10);
UndoListInTabmenu.setPref("browser.sessionstore.max_tabs_undo", "int", 0);
UndoListInTabmenu.setPref("browser.sessionstore.max_tabs_undo", "int", max_undo);
if (max_undo != UndoListInTabmenu.getPref("browser.sessionstore.max_tabs_undo", "int", 10))
UndoListInTabmenu.setPref("browser.sessionstore.max_tabs_undo", "int", max_undo);
}, false);
},
/**
* Populate when the history menu is opened (Fx3.6)
*/
populateUndoSubmenu36: function(undoPopup) {
// remove existing menu items
while (undoPopup.hasChildNodes())
undoPopup.removeChild(undoPopup.firstChild);
// "Open All in Tabs"
var strings = gNavigatorBundle;
m = undoPopup.appendChild(document.createXULElement("menuitem"));
m.setAttribute("label", strings.getString("menuRestoreAllTabs.label"));
//m.setAttribute("class", "menuitem-iconic bookmark-item");
m.setAttribute("accesskey", "R" /*strings.getString("menuRestoreAllTabs.accesskey")*/);
m.addEventListener("command", function() {
for (var i = 0; i < undoItems.length; i++)
undoCloseTab();
}, false);
undoPopup.appendChild(document.createXULElement("menuseparator"));
// populate menu
var undoItems = eval("(" + UndoListInTabmenu._ss.getClosedTabData(window) + ")");
for (var i = 0; i < undoItems.length; i++) {
var entries = undoItems[i].state.entries;
var tooltiptext = "";
for (var j = entries.length - 1; j > -1; j--){
if (j != entries.length - 1)
tooltiptext += "\n";
tooltiptext += parseInt(j + 1, 10) + ". " + entries[j].title;
}
var m = document.createXULElement("menuitem");
m.setAttribute("tooltiptext", tooltiptext);
m.setAttribute("label", undoItems[i].title);
if (undoItems[i].image)
m.setAttribute("image", undoItems[i].image);
m.setAttribute("class", "menuitem-iconic bookmark-item");
m.setAttribute("value", i);
m.setAttribute("oncommand", "undoCloseTab(" + i + ");");
m.setAttribute("onclick", "UndoListInTabmenu._undoCloseMiddleClick(event);");
if (i == 0)
m.setAttribute("key", "key_undoCloseTab");
undoPopup.appendChild(m);
}
// "Clear undo close tb list"
undoPopup.appendChild(document.createXULElement("menuseparator"));
m = undoPopup.appendChild(document.createXULElement("menuitem"));
m.setAttribute("label", "Liste der letzten Tabs l\u00F6schen");
m.setAttribute("accesskey", "l");
m.addEventListener("command", function() {
var max_undo = UndoListInTabmenu.getPref("browser.sessionstore.max_tabs_undo", "int", 10);
UndoListInTabmenu.setPref("browser.sessionstore.max_tabs_undo", "int", 0);
UndoListInTabmenu.setPref("browser.sessionstore.max_tabs_undo", "int", max_undo);
if (max_undo != UndoListInTabmenu.getPref("browser.sessionstore.max_tabs_undo", "int", 10))
UndoListInTabmenu.setPref("browser.sessionstore.max_tabs_undo", "int", max_undo);
}, false);
},
toggleRecentlyClosedWindows: function PHM_toggleRecentlyClosedWindows() {
// enable/disable the Recently Closed Windows sub menu
let undoPopup = this.historyUndoWindowPopup3;
// no restorable windows, so disable menu
if (this._ss.getClosedWindowCount() == 0)
this.historyUndoWindowPopup3.parentNode.setAttribute("disabled", true);
else
this.historyUndoWindowPopup3.parentNode.removeAttribute("disabled");
},
/**
* Populate when the history menu is opened
*/
populateUndoWindowSubmenu: function PHM_populateUndoWindowSubmenu() {
let undoPopup = this.historyUndoWindowPopup3;
let menuLabelString = gNavigatorBundle.getString("menuUndoCloseWindowLabel");
let menuLabelStringSingleTab =
gNavigatorBundle.getString("menuUndoCloseWindowSingleTabLabel");
// remove existing menu items
while (undoPopup.hasChildNodes())
undoPopup.removeChild(undoPopup.firstChild);
// no restorable windows, so make sure menu is disabled, and return
if (this._ss.getClosedWindowCount() == 0) {
undoPopup.parentNode.setAttribute("disabled", true);
return;
}
// enable menu
undoPopup.parentNode.removeAttribute("disabled");
let undoItems = JSON.parse(this._ss.getClosedWindowData());
// "Open All in Windows"
let m = undoPopup.appendChild(document.createXULElement("menuitem"));
m.setAttribute("label", gNavigatorBundle.getString("menuRestoreAllWindows.label"));
//m.setAttribute("class", "menuitem-iconic bookmark-item");
m.setAttribute("accesskey", "W"/*gNavigatorBundle.getString("menuRestoreAllWindows.accesskey")*/);
m.setAttribute("oncommand",
"for (var i = 0; i < " + undoItems.length + "; i++) UndoListInTabmenu.undoCloseWindow();");
undoPopup.appendChild(document.createXULElement("menuseparator"));
// populate menu
for (let i = 0; i < undoItems.length; i++) {
let undoItem = undoItems[i];
let otherTabsCount = undoItem.tabs.length - 1;
let label = (otherTabsCount == 0) ? menuLabelStringSingleTab
: PluralForm.get(otherTabsCount, menuLabelString);
let menuLabel = label.replace("#1", undoItem.title)
.replace("#2", otherTabsCount);
let m = document.createXULElement("menuitem");
m.setAttribute("label", menuLabel);
let selectedTab = undoItem.tabs[undoItem.selected - 1];
if (selectedTab.attributes.image) {
let iconURL = selectedTab.attributes.image;
// don't initiate a connection just to fetch a favicon (see bug 467828)
if (/^https?:/.test(iconURL))
iconURL = "moz-anno:favicon:" + iconURL;
m.setAttribute("image", iconURL);
}
m.setAttribute("class", "menuitem-iconic bookmark-item");
m.setAttribute("oncommand", "UndoListInTabmenu.undoCloseWindow(" + i + ");");
if (i == 0)
m.setAttribute("key", "key_undoCloseWindow");
undoPopup.appendChild(m);
}
},
/**
* Re-open a closed window.
* @param aIndex
* The index of the window (via nsSessionStore.getClosedWindowData)
* @returns a reference to the reopened window.
*/
undoCloseWindow: function (aIndex) {
// get closed-tabs from nsSessionStore
try {
ss = Cc["@mozilla.org/browser/sessionstore;1"].
getService(Ci.nsISessionStore);
} catch(x) {
ss = SessionStore;
}
let window = null;
if (ss.getClosedWindowCount() > (aIndex || 0))
window = ss.undoCloseWindow(aIndex || 0);
return window;
},
getPref: function(aPrefString, aPrefType, aDefault){
var xpPref = Components.classes['@mozilla.org/preferences-service;1']
.getService(Components.interfaces.nsIPrefBranch);
try{
switch (aPrefType){
case 'complex':
return xpPref.getComplexValue(aPrefString, Components.interfaces.nsIFile); break;
case 'str':
return xpPref.getCharPref(aPrefString).toString(); break;
case 'int':
return xpPref.getIntPref(aPrefString); break;
case 'bool':
default:
return xpPref.getBoolPref(aPrefString); break;
}
}catch(e){
}
return aDefault;
},
setPref: function(aPrefString, aPrefType, aValue){
var xpPref = Components.classes['@mozilla.org/preferences-service;1']
.getService(Components.interfaces.nsIPrefBranch);
try{
switch (aPrefType){
case 'complex':
return xpPref.setComplexValue(aPrefString, Components.interfaces.nsIFile, aValue); break;
case 'str':
return xpPref.setCharPref(aPrefString, aValue); break;
case 'int':
aValue = parseInt(aValue);
return xpPref.setIntPref(aPrefString, aValue); break;
case 'bool':
default:
return xpPref.setBoolPref(aPrefString, aValue); break;
}
}catch(e){
}
return null;
},
//Fx Version ermitteln
//FxVersion
getVer: function(){
const Cc = Components.classes;
const Ci = Components.interfaces;
var info = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo);
var ver = parseInt(info.version.substr(0,3) * 10,10) / 10;
return ver;
}
};
// We should only start the redirection if the browser window has finished
// starting up. Otherwise, we should wait until the startup is done.
if (gBrowserInit.delayedStartupFinished) {
UndoListInTabmenu.init();
} else {
let delayedStartupFinished = (subject, topic) => {
if (topic == "browser-delayed-startup-finished" &&
subject == window) {
Services.obs.removeObserver(delayedStartupFinished, topic);
UndoListInTabmenu.init();
}
};
Services.obs.addObserver(delayedStartupFinished,
"browser-delayed-startup-finished");
}
Alles anzeigen
Mfg.
Endor
Also hier funktioniert es einwandfrei.
Wegen Script Cache löschen:
Bei geschlossenem Firefox im Profilordner den Inhalt des Ordners
startupCache löschen.
Mfg.
Endor
RestartFirefoxButtonM.uc.js bitte testen:
// RestartFirefoxButtonM.uc.js
// v. 0.3
(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',
label: 'Neustart',
tooltiptext: 'Neustart (mit Rechts- und Mittelklick wird userChrome.js-Cache geleert)',
style: 'list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89%2BbN%2FrXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz%2FSMBAPh%2BPDwrIsAHvgABeNMLCADATZvAMByH%2Fw%2FqQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf%2BbTAICd%2BJl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuw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aBcc2a%2BtjdVXR1J3iBDx8QUpQUJAuJJclseogxz441H5vrPO72cm0VSyVPJq27ZaHm8ST3Y0M9d9Kkr19A1A1x4VIObTGBfNrsJ5XmE9b6KqgvrOGhr1Vns2sgeNIkXiigvHf1liZuHWZYjINSEXRVLewZjN6bYmYbvN4rcDvVzFKLnOpErMLBpvbklClznyyyPDA6DjTX3wJWICr%2Bnb3ffjXSGpl5Nxnn88uh2ORUCBaHfVQU%2BsjVuGhKqJT5lFYShr8fGH4j42bH53EnJ4EtgEEPQOTzHx9mqXLl9AT9TS82RvreOmVcMTXVh4JhIr5kp3LFu6u3Lk%2ByMylQazU3ENYAvw3AFUTimFqj5i7AAAAAElFTkSuQmCC)',
onclick: 'if (event.button == 1 || event.button == 2) { \
event.preventDefault(); \
Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime). \
invalidateCachesOnRestart(); \
}; \
BrowserUtils.restartApplication();'
};
for (var p in props)
toolbaritem.setAttribute(p, props[p]);
return toolbaritem;
}
});
} catch(e) { };
})();
Alles anzeigen
Mfg.
Endor
Bitte testen:
// ==UserScript==
// @name External-Aplication.uc.js
// @namespace ithinc#mozine.cn
// @description External Applications
// @include main
// @compatibility Firefox 3.5.x
// @author ithinc
// @version 20091212.0.0.1 Initial release
// @version 20170911.0.0.2 Fix by aborix
// ==/UserScript==
//
// Herkunft:
// https://www.camp-firefox.de/forum/thema/126871-speicherort-von-dateien-und-ordnern-f%C3%BCr-den-schnellen-zugriff-%C3%BCber-die-zus%C3%A4tzlic/?pageNo=1
/* :::: External Applications :::: */
var gExternalApplications = {
type: 'menu', //'menu' or 'button'
insertafter: 'menubar-items',
apps: [
{name: 'EmEditor', path: 'C:\\Program Files (x86)\\EmEditor\\EmEditor.exe'},
{name: 'Notepad++', path: 'D:\\___Stickware\\office\\NPP\\Notepad++Portable.exe'},
{name: 'Calculator', path: 'C:\\WINDOWS\\system32\\calc.exe'},
{name: 'Command Prompt', path: 'C:\\WINDOWS\\system32\\cmd.exe'},
{name: 'separator'},
{name: 'EDF-Reviews', path: 'D:\\05_E-Smoke\\0B_Foren\\EDF\\Reviews'},
{name: 'EDF-Tabellen', path: 'D:\\05_E-Smoke\\0B_Foren\\EDF\\Tabellen'},
{name: 'separator'},
{name: 'Shops', path: 'D:\\05_E-Smoke\\08_Shops'},
{name: 'separator'},
{name: 'FF-Chrome', path: 'D:\\___Stickware\\comm\\FirefoxPortable\\Data\\profile\\chrome'},
],
init: function() {
for (var i=0; i<this.apps.length; i++) {
if (!this.apps[i].path) continue;
if (!this.apps[i].args) this.apps[i].args = [];
this.apps[i].path = this.apps[i].path.replace(/\//g, '\\');
var ffdir = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('CurProcD', Ci.nsIFile).path;
if (/^(\\)/.test(this.apps[i].path)) {
this.apps[i].path = ffdir.substr(0,2) + this.apps[i].path;
}
else if (/^(\.)/.test(this.apps[i].path)) {
this.apps[i].path = ffdir + '\\' + this.apps[i].path;
}
}
if (this.type == 'menu') {
var mainmenu = document.getElementById('main-menubar'); // das war das Original
var menu = mainmenu.appendChild(document.createXULElement('menu'));
menu.setAttribute('label', 'Start'); // Menu = "Start"
menu.setAttribute('accesskey', 'a');
var menupopup = menu.appendChild(document.createXULElement('menupopup'));
for (var i=0; i<this.apps.length; i++) {
menupopup.appendChild(this.createMenuitem(this.apps[i]));
}
}
else {
var menubarItems = document.getElementById(this.insertafter);
var toolbaritem = menubarItems.parentNode.insertBefore(document.createXULElement('toolbaritem'), menubarItems.nextSibling);
toolbaritem.id = 'ExtAppButtons';
toolbaritem.setAttribute("class", "chromeclass-toolbar-additional");
toolbaritem.setAttribute("orient", "horizontal");
for (var i=0; i<this.apps.length; i++) {
toolbaritem.appendChild(this.createButton(this.apps[i]));
}
}
},
exec: function(path, args) {
for (var i=0; i<args.length; i++) {
args[i] = args[i].replace(/%u/g, gBrowser.currentURI.spec);
}
var file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
file.initWithPath(path);
if (!file.exists()) {
throw 'File Not Found: ' + path;
}
if (!file.isExecutable() || args.length==0) {
file.launch();
}
else {
var process = Cc['@mozilla.org/process/util;1'].getService(Ci.nsIProcess);
process.init(file);
process.run(false, args, args.length);
}
},
createButton: function(app) {
if (app.name == 'separator')
return document.createXULElement('toolbarseparator');
var item = document.createXULElement('toolbarbutton');
item.setAttribute('class', 'toolbarbutton-1 chromeclass-toolbar-additional');
item.setAttribute('label', app.name);
item.setAttribute('image', 'moz-icon:file:///' + app.path + '?size=16');
item.setAttribute('oncommand', 'gExternalApplications.exec(this.path, this.args);');
// item.setAttribute('tooltiptext', app.name);
item.path = app.path;
item.args = app.args;
return item;
},
createMenuitem: function(app) {
if (app.name == 'separator')
return document.createXULElement('menuseparator');
var item = document.createXULElement('menuitem');
item.setAttribute('class', 'menuitem-iconic');
item.setAttribute('label', app.name);
item.setAttribute('image', 'moz-icon:file:///' + app.path + '?size=16');
item.setAttribute('oncommand', 'gExternalApplications.exec(this.path, this.args);');
item.path = app.path;
item.args = app.args;
return item;
}
};
gExternalApplications.init();
Alles anzeigen
Mfg.
Endor
Nur zur Info: es gibt eine neue Version vom Script
und da werden wieder alle Downloads angezeigt:
// ==UserScript==
// @name ucjsDownloadsStatusModoki.uc.js
// @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
// @description Downloads Status Modoki
// @include main
// @compatibility Firefox 69+
// @author Alice0775
// @version 2019/09/08 19:30 fix scrollbox
// @version 2019/05/21 08:30 fix 69.0a1 Bug 1551320 - Replace all createElement calls in XUL documents with createXULElement
// @version 2018/10/27 12:00 fix for 64+
// @version 2018/06/12 21:00 fix for private window mode
// @version 2018/06/07 12:00 fix file name for history
// @version 2018/02/10 12:00 try catch error when DO_NOT_DELETE_HISTORY = true
// @version 2017/12/10 12:00 fix error when DO_NOT_DELETE_HISTORY = true
// @version 2017/12/10 12:00 remove workaround Bug 1279329. Disable btn while clear list is doing, close button styling for 57.
// @version 2016/06/10 12:00 modify style independent of font-family
// @version 2016/06/10 07:00 modify style of close button, fix typo
// @version 2016/06/10 00:00 Workaround Bug 1279329. adjust some padding
// @version 2015/05/08 00:00 remove padding due to Bug 1160734
// @version 2014/03/31 00:00 fix for browser.download.manager.showWhenStarting
// @version 2013/12/22 13:00 chromehidden
// @version 2013/12/19 17:10 rename REMEMBERHISTOTY to DO_NOT_DELETE_HISTORY
// @version 2013/12/16 23:28 fixed initialize numDls
// @version 2013/12/16 23:24 open only download added
// @version 2013/12/16 23:10 open only download started
// @version 2013/12/16 21:20 modify css Windows7 Aero
// @version 2013/12/16 21:00 modify css
// @version 2013/12/16 19:30 add autocheck false
// @version 2013/12/16 18:31 fix pref name
// @version 2013/12/16 18:30
// @note
// ==/UserScript==
var ucjsDownloadsStatusModoki = {
_summary: null,
_list: null,
get downloadsStatusModokiBar() {
delete downloadsStatusModokiBar;
return this.downloadsStatusModokiBar = document.getElementById("downloadsStatusModokiBar");
},
get toggleMenuitem() {
delete toggleMenuitem;
return this.toggleMenuitem = document.getElementById("toggle_downloadsStatusModokiBar");
},
init: function() {
if (document.documentElement.getAttribute("chromehidden") !="" )
return;
XPCOMUtils.defineLazyModuleGetter(window, "Downloads",
"resource://gre/modules/Downloads.jsm");
var style = `
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
#ucjsDownloadsStatusModoki {
width: 100%;
max-height: 100px;
height: 39px;
}
`.replace(/\s+/g, " ");
var sspi = document.createProcessingInstruction(
'xml-stylesheet',
'type="text/css" href="data:text/css,' + encodeURIComponent(style) + '"'
);
document.insertBefore(sspi, document.documentElement);
sspi.getAttribute = function(name) {
return document.documentElement.getAttribute(name);
};
var toolbar = document.createXULElement("vbox");
toolbar.setAttribute("id", "downloadsStatusModokiBar");
toolbar.setAttribute("collapsed", true);
var bottombox = document.getElementById("browser-bottombox");
bottombox.appendChild(toolbar);
var browser = toolbar.appendChild(document.createXULElement("browser"));
browser.setAttribute("disablehistory", true);
browser.setAttribute("remote", false);
browser.setAttribute("id", "ucjsDownloadsStatusModoki");
browser.addEventListener("load", function(event){ucjsDownloadsStatusModoki.onload(event)}, true);
browser.setAttribute("src", "chrome://browser/content/downloads/contentAreaDownloadsView.xul");
var menuitem = document.createXULElement("menuitem");
menuitem.setAttribute("id", "toggle_downloadsStatusModokiBar");
menuitem.setAttribute("type", "checkbox");
menuitem.setAttribute("autocheck", false);
menuitem.setAttribute("label", "Download Leiste");
menuitem.setAttribute("checked", false);
menuitem.setAttribute("accesskey", "D");
menuitem.setAttribute("oncommand", "ucjsDownloadsStatusModoki.toggleDownloadsStatusModokiBar()");
var ref = document.getElementById("menu_customizeToolbars");
ref.parentNode.insertBefore(menuitem, ref.previousSibling);
// Ensure that the DownloadSummary object will be created asynchronously.
if (!this._summary) {
Downloads.getSummary(Downloads.ALL).then(summary => {
this._summary = summary;
return this._summary.addView(this);
}).then(null, Cu.reportError);
}
if (!this._list) {
Downloads.getList(Downloads.ALL).then(list => {
this._list = list;
return this._list.addView(this);
}).then(null, Cu.reportError);
}
window.addEventListener("unload", this, false);
},
uninit: function() {
window.removeEventListener("unload", this, false);
if (this._summary) {
this._summary.removeView(this);
}
if (this._list) {
this._list.removeView(this);
}
},
handleEvent: function(event) {
switch (event.type) {
case "unload":
this.uninit();
break;
}
},
toggleDownloadsStatusModokiBar: function() {
var collapsed = this.downloadsStatusModokiBar.collapsed;
this.downloadsStatusModokiBar.collapsed = !collapsed;
this.toggleMenuitem.setAttribute("checked", collapsed);
},
openDownloadsStatusModoki: function() {
this.downloadsStatusModokiBar.collapsed = false;
this.toggleMenuitem.setAttribute("checked", true);
},
hideDownloadsStatusModoki: function() {
this.downloadsStatusModokiBar.collapsed = true;
this.toggleMenuitem.setAttribute("checked", false);
},
onDownloadAdded: function (aDownload) {
Cu.import("resource://gre/modules/Services.jsm");
var showWhenStarting = true;
try {
showWhenStarting = Services.prefs.getBoolPref("userChrome.downloadsStatusModoki.showWhenStarting");
} catch(e) {}
this.numDls = 0;
if (showWhenStarting) {
if (this._list) {
this._list.getAll().then(downloads => {
for (let download of downloads) {
if (!download.stopped)
this.numDls++;
}
if (this.numDls > 0)
this.openDownloadsStatusModoki(false);
}).then(null, Cu.reportError);
}
}
},
onSummaryChanged: function () {
Cu.import("resource://gre/modules/Services.jsm");
if (!this._summary)
return;
if (this._summary.allHaveStopped || this._summary.progressTotalBytes == 0) {
var closeWhenDone = false;
try {
closeWhenDone = Services.prefs.getBoolPref("userChrome.downloadsStatusModoki.closeWhenDone");
} catch(e) {}
if (closeWhenDone) {
this.hideDownloadsStatusModoki();
}
}
},
// chrome://browser/content/downloads/contentAreaDownloadsView.xul
onload: function(event) {
var doc = event.originalTarget;
var win = doc.defaultView;
var style = `
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
#contentAreaDownloadsView {
-moz-box-orient: horizontal;
background-color: -moz-dialog;
padding: 0;
}
#contentAreaDownloadsView > stack:first-child {
}
#downloadsRichListBox {
background-color: -moz-dialog;
display:inline-block !important;
overflow-y: auto;
scrollbar-width: thin;
border: none;
}
:root
{
--downloads-item-height: 38px;
}
richlistitem {
min-width:200px;
max-width:200px;
font-size: 13px;
border-width: 0 1px 0 0;
border-style: solid;
border-color: black;
}
richlistitem vbox {
}
.downloadTypeIcon {
height:16px;
width: 16px;
-moz-margin-end: 0px;
-moz-margin-start: 1px;
padding-right: 0;
padding-left: 1px;
}
.downloadTarget {
margin-top:1px;
padding-bottom:16px;
max-width: calc(100% - 50px) !important;
min-width: calc(100% - 50px) !important;
}
.download-state[state="0"] * .downloadTarget,
.download-state[state="4"] * .downloadTarget {
padding-bottom:0px;
}
.downloadTarget:-moz-system-metric(windows-default-theme) {
margin-top:2px;
/*padding-bottom:10px; windows7 ?*/
}
.downloadProgress {
margin-top:-16px;
margin-bottom: -1px;
height:12px;
margin-inline-end: 0 !important;
}
.progress-bar {
-moz-appearance:none !important;
background-color: lime !important;
}
.progress-remainder {
}
.downloadDetails {
margin-top:-12px;
}
.download-state:not(:-moz-any([state="-1"], [state="5"], [state="0"], [state="4"], [state="7"])) .downloadDetails {
margin-top:-17px;
}
richlistitem[selected] .downloadDetails {
opacity: 1;
}
.downloadButton {
padding: 0;
margin: 0;
}
button > .button-box {
-moz-padding-start: 0px;
-moz-padding-end: 1px;
padding-right: 0 !important;
padding-left: 0 !important;
}
#downloadFilter {
width: 150px;
}
`.replace(/\s+/g, " ");
var sspi = doc.createProcessingInstruction(
'xml-stylesheet',
'type="text/css" href="data:text/css,' + encodeURIComponent(style) + '"'
);
doc.insertBefore(sspi, doc.documentElement);
sspi.getAttribute = function(name) {
return doc.documentElement.getAttribute(name);
};
var button = doc.createXULElement("button");
button.setAttribute("label", "Löschen");
button.setAttribute("id", "ucjs_clearListButton");
button.setAttribute("accesskey", "L");
button.setAttribute("oncommand", "ucjsDownloadsStatusModoki_clearDownloads();");
var ref = doc.getElementById("downloadCommands");
var vbox = doc.createXULElement("vbox");
var box = vbox.appendChild(doc.createXULElement("hbox"));
box.appendChild(button);
box.appendChild(doc.createXULElement("spacer")).setAttribute("flex", 1);
var textbox = doc.createXULElement("textbox");
textbox.setAttribute("id", "downloadFilter");
textbox.setAttribute("clickSelectsAll", true);
textbox.setAttribute("type", "search");
textbox.setAttribute("placeholder", "Suchen...");
textbox.setAttribute("oncommand", "ucjsDownloadsStatusModoki_doSearch(this.value);");
box.appendChild(textbox);
var closebtn = doc.createXULElement("toolbarbutton");
closebtn.setAttribute("id", "ucjsDownloadsStatusModoki-closebutton");
closebtn.setAttribute("class", "close-icon");
closebtn.setAttribute("tooltiptext", "Download-Leiste schließen");
closebtn.setAttribute("oncommand", "ucjsDownloadsStatusModoki_doClose();");
box.appendChild(closebtn);
ref.parentNode.insertBefore(vbox, ref);
/*
// xxx Bug 1279329 "Copy Download Link" of context menu in Library is grayed out
var listBox = doc.getElementById("downloadsRichListBox");
var placesView = listBox._placesView;
if (placesView) {
var place = placesView.place;
placesView.place= null;
placesView.place = place;
}
*/
win.ucjsDownloadsStatusModoki_clearDownloads = function ucjs_clearDownloads() {
var DO_NOT_DELETE_HISTORY = true; /* custmizable true or false */
var richListBox = doc.getElementById("downloadsRichListBox");
Cu.import("resource://gre/modules/Services.jsm");
var places = [];
function addPlace(aURI, aTitle, aVisitDate) {
places.push({
uri: aURI,
title: aTitle,
visits: [{
visitDate: (aVisitDate || Date.now()) * 1000,
transitionType: Ci.nsINavHistoryService.TRANSITION_LINK
}]
});
}
function moveDownloads2History() {
if (DO_NOT_DELETE_HISTORY &&
!PrivateBrowsingUtils.isWindowPrivate(window)) {
try {
for (let element of richListBox.childNodes) {
let download = element._shell.download;
let aURI = makeURI(download.source.url);
// let aTitle = document.getAnonymousElementByAttribute(element, "class", "downloadTarget").value
let aTitle = download.target.path;
aTitle = aTitle.match( /[^\\]+$/i )[0];
aTitle = aTitle.match( /[^/]+$/i )[0];
let aVisitDate = download.endTime || download.startTime;
addPlace(aURI, aTitle, aVisitDate)
}
} catch(ex) {}
}
// Clear List
richListBox._placesView.doCommand('downloadsCmd_clearDownloads');
if (DO_NOT_DELETE_HISTORY &&
!PrivateBrowsingUtils.isWindowPrivate(window)) {
try {
if (places.length > 0) {
var asyncHistory = Components.classes["@mozilla.org/browser/history;1"]
.getService(Components.interfaces.mozIAsyncHistory);
asyncHistory.updatePlaces(places);
}
} catch(ex) {}
}
}
var btn = doc.getElementById("ucjs_clearListButton");
btn.setAttribute("disabled", true);
moveDownloads2History();
btn.removeAttribute("disabled");
// close toolbar
var closeWhenDone = false;
try {
closeWhenDone = Services.prefs.getBoolPref("userChrome.downloadsStatusModoki.closeWhenDone");
} catch(e) {}
if (closeWhenDone) {
top.ucjsDownloadsStatusModoki.hideDownloadsStatusModoki();
}
};
win.ucjsDownloadsStatusModoki_doSearch = function ucjs_doSearch(filterString) {
var richListBox = doc.getElementById("downloadsRichListBox");
richListBox._placesView.searchTerm = filterString;
};
win.ucjsDownloadsStatusModoki_doClose = function ucjs_doClose() {
top.ucjsDownloadsStatusModoki.hideDownloadsStatusModoki();
};
}
}
ucjsDownloadsStatusModoki.init();
Alles anzeigen
Mfg.
Endor
Prima, freut mich.
Wie immer gern geschehen.
Mfg.
Endor