Ich habe da gestern schon an diesem Skript geschraubt...
Hab aber die Version jetzt nicht greifbar - kommt morgen - bin außer Haus... ![]()
Ich habe da gestern schon an diesem Skript geschraubt...
Hab aber die Version jetzt nicht greifbar - kommt morgen - bin außer Haus... ![]()
Jetzt sollte es auch in der Nightly wieder so funktionieren, wie in den anderen Versionen (hoffe ich...).
Ich nutze zu Testzwecken immer noch das Skript von Endor aus #8. Ich habe die Zeilen/Stellen markiert, die sich verändert haben:
// ==UserScript==
// @include chrome://mozapps/content/downloads/unknownContentType.xhtml
// @charset UTF-8
// @version Fx139+
// ==/UserScript==
(function() {
const {FileUtils} = ChromeUtils.importESModule("resource://gre/modules/FileUtils.sys.mjs");
var css = `
hbox.dialog-button-box button.dialog-button menupopup {
background: #F0F0F0 !important;
border: 1px solid #CCCCCC !important;
padding: 2px !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem.menuitem-iconic:hover {
background: #91C9F7 !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem.menuitem-iconic hbox.menu-iconic-left {
padding: 3px !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem.menuitem-iconic label.menu-iconic-text{
padding: 3px !important;
padding-left: 5px !important;
padding-right: 12px !important;
}
/* [FF139+] -> */
hbox.dialog-button-box button.dialog-button menupopup menuitem:not([highlightable]) > .menu-highlightable-text, menuitem[highlightable] > .menu-text {
display: none;
}
/* <- [FF139+] */
`;
var sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
var uri = Services.io.newURI('data:text/css,' + encodeURIComponent(css))
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
setTimeout(function() {
saveTo()
}, 200);
function saveTo() {
// config
var dirArray = [
['C:\\Users\\xxxx\\Documents', 'Dokumente'],
['C:\\Users\\xxxx\\Pictures', 'Bilder'],
['C:\\Users\\xxxx\\Music', 'Musik'],
['C:\\Users\\xxxx\\Videos', 'Videos'],
['F:\\Video', 'Videos'],
['F:\\Adaten\\Downloads\\Firefox\\Muell', 'Verschiedenes'],
["" + FileUtils.getDir('UChrm', []).path + "", "chrome"],
//["" + FileUtils.getDir('UChrm', ['SubScript']).path + "", "SubScript"],
['E:\\', 'E:'],
['F:\\', 'F:'],
['G:\\', 'G:'],
['H:\\', 'H:'],
['I:\\', 'I:'],
['S:\\', 'S:'],
];
//[FF139+] ->
if(!document.getElementById("unknownContentType"))
return;
//<- [FF139+]
let button = document.getElementById("unknownContentType").getButton("cancel");
let saveTo = button.parentNode.insertBefore(document.createXULElement("button"), button);
var saveToMenu = saveTo.appendChild(document.createXULElement("menupopup"));
saveTo.classList.toggle("dialog-button");
saveTo.label = "Save To";
saveTo.type = "menu";
dirArray.forEach(function(dir) {
var [name, dir] = [dir[1], dir[0]];
var mi = document.createXULElement("menuitem");
var item = saveToMenu.appendChild(mi);
item.setAttribute("label", (name || (dir.match(/[^\\/]+$/) || [dir])[0]));
item.setAttribute("image", "moz-icon:file:///" + dir + "\\");
item.setAttribute("class", "menuitem-iconic");
item.addEventListener("click", function() { ////[FF139+]: "command" -> "click"
var locationtext = document.getElementById('locationtext');
var file = new FileUtils.File(dir + '\\' + (locationtext ? locationtext.value : document.getElementById('location').value));
dialog.mLauncher.saveDestinationAvailable(file);
dialog.onCancel = function() {};
close();
});
});
}
}());
Alles anzeigen
Hilf mir mal bitte, ich bekomme den Text nicht nach rechts verlagert.![]()
Zeile 25 im Skript:
Habe es im Original übernommen, aber lässt sich nicht ändern.
Ich stelle mal das geänderte Script hier ein, schaust du mal bitte, ob es bei dir funktioniert.
// ==UserScript==
// @include chrome://mozapps/content/downloads/unknownContentType.xhtml
// @charset UTF-8
// @version Fx114+
// ==/UserScript==
(function () {
if (location.href !== 'chrome://mozapps/content/downloads/unknownContentType.xhtml') return;
const Cu = Components.utils;
const { FileUtils } = ChromeUtils.importESModule( 'resource://gre/modules/FileUtils.sys.mjs');
setTimeout(function () {
saveTo();
}, 200);
function saveTo() {
// Config
const dirArray = [
['D:\\Download Firefox', 'Download Firefox'],
['D:\\Download Firefox\\Dokumente'],
['D:\\Download Firefox\\Bilder'],
['D:\\Download Firefox\\Software'],
['D:\\Download Firefox\\Ablage'],
['D:\\Download Firefox\\Sonstiges'],
["C:\\", "C:"],
["E:\\", "E:"],
];
const button = document.getElementById('unknownContentType').getButton('cancel');
const saveTo = button.parentNode.insertBefore(document.createXULElement('button'), button);
const saveToMenu = saveTo.appendChild(document.createXULElement('menupopup'));
saveTo.classList.toggle('dialog-button');
saveTo.label = 'Speichern in…';
saveTo.type = 'menu';
const css =`
hbox.dialog-button-box button.dialog-button menupopup {
background: gold !important;
min-width: 220px !important;
padding: 5px !important;
margin: 15px 0 0 -62px !important;
border: 3px solid dodgerblue !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem{
appearance: none !important;
color: blue !important;
background: #fefefc !important;
border: 1px solid silver !important;
margin-top: 1px !important;
padding-left: 12px !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem:hover {
background: greenyellow !important;
border: 1px solid red !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem.menuitem-iconic label.menu-iconic-text{
color: blue !important;
font-size: 15px !important;
font-weight: 600 !important;
padding: 3px !important;
padding-left: 85px !important;
padding-right: 12px !important;
}
/* [FF139+] -> */
hbox.dialog-button-box button.dialog-button menupopup menuitem:not([highlightable]) > .menu-highlightable-text, menuitem[highlightable] > .menu-text {
display: none;
}
/* <- [FF139+] */
`;
const sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
const uri = Services.io.newURI('data:text/css,' + encodeURIComponent(css));
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
dirArray.forEach(function (directory) {
const [name, dir] = [directory[1], directory[0]];
const mi = document.createXULElement('menuitem');
const item = saveToMenu.appendChild(mi);
item.setAttribute('label', (name || (dir.match(/[^\\/]+$/) || [dir])[0]));
item.setAttribute('image', 'moz-icon:file:///' + dir + '\\');
item.setAttribute('class', 'menuitem-iconic');
item.addEventListener('click', function () {
const locationtext = document.getElementById('locationtext');
const pathFile = dir + '\\' + (locationtext ? locationtext.value : document.getElementById('location').value);
const file = new FileUtils.File(pathFile);
dialog.mLauncher.saveDestinationAvailable(file);
dialog.onCancel = function () {};
close();
});
});
}
}());
Alles anzeigen
lässt sich nicht ändern.
Teste bitte, Zeile 68 - 70 sind neu:
hbox.dialog-button-box button.dialog-button menupopup menuitem.menuitem-iconic > label {
padding-left: 10px !important;
}
Kompl. Skript dann:
// ==UserScript==
// @include chrome://mozapps/content/downloads/unknownContentType.xhtml
// @charset UTF-8
// @version Fx114+
// ==/UserScript==
(function () {
if (location.href !== 'chrome://mozapps/content/downloads/unknownContentType.xhtml') return;
const Cu = Components.utils;
const { FileUtils } = ChromeUtils.importESModule( 'resource://gre/modules/FileUtils.sys.mjs');
setTimeout(function () {
saveTo();
}, 200);
function saveTo() {
// Config
const dirArray = [
['D:\\Download Firefox', 'Download Firefox'],
['D:\\Download Firefox\\Dokumente'],
['D:\\Download Firefox\\Bilder'],
['D:\\Download Firefox\\Software'],
['D:\\Download Firefox\\Ablage'],
['D:\\Download Firefox\\Sonstiges'],
["C:\\", "C:"],
["E:\\", "E:"],
];
const button = document.getElementById('unknownContentType').getButton('cancel');
const saveTo = button.parentNode.insertBefore(document.createXULElement('button'), button);
const saveToMenu = saveTo.appendChild(document.createXULElement('menupopup'));
saveTo.classList.toggle('dialog-button');
saveTo.label = 'Speichern in…';
saveTo.type = 'menu';
const css =`
hbox.dialog-button-box button.dialog-button menupopup {
background: gold !important;
min-width: 220px !important;
padding: 5px !important;
margin: 15px 0 0 -62px !important;
border: 3px solid dodgerblue !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem{
appearance: none !important;
color: blue !important;
background: #fefefc !important;
border: 1px solid silver !important;
margin-top: 1px !important;
padding-left: 12px !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem:hover {
background: greenyellow !important;
border: 1px solid red !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem.menuitem-iconic label.menu-iconic-text{
color: blue !important;
font-size: 15px !important;
font-weight: 600 !important;
padding: 3px !important;
/* padding-left: 15px !important; */
padding-right: 12px !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem.menuitem-iconic > label {
padding-left: 10px !important;
}
/* [FF139+] -> */
hbox.dialog-button-box button.dialog-button menupopup menuitem:not([highlightable]) > .menu-highlightable-text, menuitem[highlightable] > .menu-text {
display: none;
}
/* <- [FF139+] */
`;
const sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
const uri = Services.io.newURI('data:text/css,' + encodeURIComponent(css));
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
dirArray.forEach(function (directory) {
const [name, dir] = [directory[1], directory[0]];
const mi = document.createXULElement('menuitem');
const item = saveToMenu.appendChild(mi);
item.setAttribute('label', (name || (dir.match(/[^\\/]+$/) || [dir])[0]));
item.setAttribute('image', 'moz-icon:file:///' + dir + '\\');
item.setAttribute('class', 'menuitem-iconic');
item.addEventListener('click', function () {
const locationtext = document.getElementById('locationtext');
const pathFile = dir + '\\' + (locationtext ? locationtext.value : document.getElementById('location').value);
const file = new FileUtils.File(pathFile);
dialog.mLauncher.saveDestinationAvailable(file);
dialog.onCancel = function () {};
close();
});
});
}
}());
Alles anzeigen
So sieht das z.B. mit 40px dann aus:
Ist aber nur für Fx 139 dann!
Kompl. Skript dann:
Sorry, Andreas, konnte nicht mehr online sein.
Mein Dank geht an dich, das funktioniert perfekt, wie immer bei dir. ![]()
![]()
![]()
![]()
Ich wünsche dir, und auch allen Mitlesern, schöne Osterfeiertage.![]()
konnte nicht mehr online sein.
Alles ist gut![]()
das funktioniert perfekt
Freut mich, war gern geschehen.
schöne Osterfeiertage
Danke, das wünsche ich dir auch![]()
BrokenHeart Vielen Dank
2002Andreas Danke für das CSS für das Skript ![]()
Nur zur Info.
Die alte Version aus Beitrag Nr. 1, angepasst für v136.0a1, hat ein starkes positives Feature – sie legt die Breite des Dropdown-Menüs automatisch abhängig vom längsten Elementnamen fest. Diese Option wäre im Skript für v139.0a1 nützlich.
die Breite des Dropdown-Menüs automatisch abhängig vom längsten Elementnamen fest.
Teste bitte:
// ==UserScript==
// @include chrome://mozapps/content/downloads/unknownContentType.xhtml
// @charset UTF-8
// @version Fx114+
// ==/UserScript==
(function () {
if (location.href !== 'chrome://mozapps/content/downloads/unknownContentType.xhtml') return;
const Cu = Components.utils;
const { FileUtils } = ChromeUtils.importESModule( 'resource://gre/modules/FileUtils.sys.mjs');
setTimeout(function () {
saveTo();
}, 200);
function saveTo() {
// Config
const dirArray = [
['D:\\Download Firefox', 'Download Firefox'],
['D:\\Download Firefox\\Dokumente'],
['D:\\Download Firefox\\Bilder'],
['D:\\Download Firefox\\Software'],
['D:\\Download Firefox\\Ablage'],
['D:\\Download Firefox\\Sonstiges'],
["C:\\", "C:"],
["E:\\", "E:"],
];
const button = document.getElementById('unknownContentType').getButton('cancel');
const saveTo = button.parentNode.insertBefore(document.createXULElement('button'), button);
const saveToMenu = saveTo.appendChild(document.createXULElement('menupopup'));
saveTo.classList.toggle('dialog-button');
saveTo.label = 'Speichern in…';
saveTo.type = 'menu';
const css =`
hbox.dialog-button-box button.dialog-button menupopup {
background: gold !important;
min-width: 220px !important;
padding: 5px !important;
margin: 15px 0 0 -62px !important;
border: 3px solid dodgerblue !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem{
appearance: none !important;
color: blue !important;
background: #fefefc !important;
border: 1px solid silver !important;
margin-top: 1px !important;
padding-left: 12px !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem:hover {
background: greenyellow !important;
border: 1px solid red !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem.menuitem-iconic label.menu-iconic-text{
color: blue !important;
font-size: 15px !important;
font-weight: 600 !important;
padding: 3px !important;
/* padding-left: 15px !important; */
padding-right: 12px !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem.menuitem-iconic > label {
padding-left: 10px !important;
min-width: auto !important;
}
hbox.dialog-button-box button.dialog-button menupopup menuitem.menuitem-iconic > label {
/* min-width: auto !important; */
}
/* [FF139+] -> */
hbox.dialog-button-box button.dialog-button menupopup menuitem:not([highlightable]) > .menu-highlightable-text, menuitem[highlightable] > .menu-text {
display: none;
}
/* <- [FF139+] */
`;
const sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
const uri = Services.io.newURI('data:text/css,' + encodeURIComponent(css));
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
dirArray.forEach(function (directory) {
const [name, dir] = [directory[1], directory[0]];
const mi = document.createXULElement('menuitem');
const item = saveToMenu.appendChild(mi);
item.setAttribute('label', (name || (dir.match(/[^\\/]+$/) || [dir])[0]));
item.setAttribute('image', 'moz-icon:file:///' + dir + '\\');
item.setAttribute('class', 'menuitem-iconic');
item.addEventListener('click', function () {
const locationtext = document.getElementById('locationtext');
const pathFile = dir + '\\' + (locationtext ? locationtext.value : document.getElementById('location').value);
const file = new FileUtils.File(pathFile);
dialog.mLauncher.saveDestinationAvailable(file);
dialog.onCancel = function () {};
close();
});
});
}
}());
Alles anzeigen
Zeile 70 ist neu.
Teste bitte:
Danke, funktioniert.
Danke, funktioniert.
gerne![]()