Yes.
Wichtig wäre für mich das Hovern!
Wobei die Textfarbe auch ganz interessant wäre.
Ach, und "gedrückt"!
Yes.
Wichtig wäre für mich das Hovern!
Wobei die Textfarbe auch ganz interessant wäre.
Ach, und "gedrückt"!
Noch ein Skript:
...
Vielen lieben Dank ![]()
Da hast Du aber ganz schön hartnäckig gekämpft!
Hut ab.
damit man diese mit dem Inspektor entsprechend anschauen und anpassen kann?
Popup öffnen...Rechtsklick rein..Untersuchen..
ergibt:
Funktioniert mit und ohne focus
Wo liegt der Unterschied?
Funktioniert leider gar nicht,
und wie wäre der Code für "gedrückt"?
Danke 2002Andreas.
Jetzt geht es wieder, auf einen ähnlichen Gedanken kam ich ja auch,
nur mangels erfahrung htte ich es falsch umgesetzt!
#noUpdatesFound > data-l10n-id {
Bitte um ein Update!
Habe die Tage festgestellt, dass mein CSS nicht mehr richtig funktioniert!
Dachte nicht tragisch, hast ja gelernt und öffnete die Browser-Werkzeuge,
aktivierte chrome://browser/content/aboutDialog.xhtml.
Kann ja nur ein kleines Problem sein, dachte ich!
Doch ich staunte nicht schlecht, als ich sah, dass es keine "lables" mehr gibt!
D.H. der Text wird nicht mehr geändert
und auch die eigenen Icons nicht mehr angezeigt!
@-moz-document url-prefix("chrome://browser/content/aboutDialog.xhtml")
{
/*---------------------------------------------------*/
/**** Anpassungen an dem About:Dialog ****/
/*---------------------------------------------------*/
#aboutDialog {
margin-top: 20px !important;
margin-bottom: 20px !important;
line-height: 1.5 !important;
}
#aboutDialog vbox,
#aboutDialogContainer hbox,
#clientBox vbox,
#contributeDesc > label:nth-child(1),
#contributeDesc > label:nth-child(2),
#releasenotes,
#trademark,
#updateButton,
label.bottom-link:nth-child(3),
[href='about:credits'],
[href='about:license'],
[href='about:rights'],
[href='https://www.mozilla.org/?utm_source=firefox-browser&utm_medium=firefox-desktop&utm_campaign=about-dialog']
{
font-size: 15px !important;
}
/* Das ist Links das FF-Logo */
#leftBox {
appearance: none !important;
border-radius: 10px !important;
background-image: url("file:///C:/Users/Mira/image/index_test.png") !important;
background-repeat: no-repeat !important;
background-color: #292c2f !important;
background-position: center center !important;
background-size: 225px !important;
min-width: 225px !important;
margin-top: 80px !important;
}
/* Das ist Rechts die Box */
#rightBox::before {
content: "Firefox Browser" !important;
font-size: 40px !important;
font-weight: 700 !important;
color: #fff582 !important;
text-shadow: 4px 4px red !important;
}
#rightBox {
background-image: none !important;
padding-top: 1px !important;
margin-top: 1px !important;
}
#aboutDialog,
#bottomBox,
#clientBox {
background-color: #292c2f !important;
}
#icons .icon {
margin: 10px !important;
}
/* Update-Check ohne Erwartung ;)*/
/* Blendet Original-Animationen aus!*/
#icons > .update-throbber {
visibility: hidden !important;
}
#updateDeck #checkingForUpdates > label {
appearance: none !important;
border-radius: 10px !important;
background-image: url("./image/sample_3.gif") !important;
background-repeat: no-repeat !important;
background-color: #292c2f !important;
background-position: 0% center !important;
background-size: 36px !important;
color: #eee8aa !important;
font-size: 1.2em !important;
font-weight: 200 !important;
min-height: 28px !important;
margin-top: 0 !important;
margin-right: -10px !important;
margin-bottom: 10px !important;
margin-left: -40px !important;
padding-top: 7px !important;
padding-right: 25px !important;
padding-bottom: 0 !important;
padding-left: 45px !important;
}
/* Blendet Original-Icon aus!*/
#icons > .noUpdatesFound {
visibility: hidden !important;
}
#noUpdatesFound > label:nth-child(1) {
appearance: none !important;
border-radius: 10px !important;
background-image: url("./image/tick_2.png") !important;
background-repeat: no-repeat !important;
background-color: #292c2f !important;
background-position: 0 center !important;
background-size: 36px !important;
color: #ff9600 !important;
font-size: 1.5em !important;
font-weight: 400 !important;
min-height: 28px !important;
margin-top: 0 !important;
margin-right: -10px !important;
margin-bottom: 12px !important;
margin-left: -40px !important;
padding-top: 2px !important;
padding-right: 25px !important;
padding-bottom: 0 !important;
padding-left: 45px !important;
}
/* Das muss noch gecheckt werden */
#downloadAndInstallButton {
appearance: none !important;
border-radius: 10px !important;
/* background-image: url("./image/herz.png") !important; */
background-repeat: no-repeat !important;
background-color: #5b5b66 !important;
background-position: 0% center !important;
background-size: 16px !important;
color: #e1e1e1 !important;
margin-top: 0 !important;
margin-right: 0 !important;
margin-bottom: 0 !important;
margin-left: 10px !important;
padding-top: 0 !important;
padding-right: 10px !important;
padding-bottom: 2px !important;
padding-left: 10px !important;
}
#downloadAndInstallButton:hover {
background: #e1e1e1 !important;
background-position: 12px 4px !important;
color: #292c2f !important;
}
#updateButton {
appearance: none !important;
border-radius: 10px !important;
background-image: url("./image/herz.png") !important;
background-repeat: no-repeat !important;
background-color: #5b5b66 !important;
background-position: 0% center !important;
background-size: 16px !important;
color: #e1e1e1 !important;
margin-top: 0 !important;
margin-right: 0 !important;
margin-bottom: 0 !important;
margin-left: 10px !important;
padding-top: 0 !important;
padding-right: 10px !important;
padding-bottom: 2px !important;
padding-left: 10px !important;
border-color: #ff9600 !important;
border-style: outset !important;
border-width: 5px !important;
}
#updateButton:hover {
background: #e1e1e1 !important;
background-position: 12px 4px !important;
color: #292c2f !important;
}
/*-------------------------------------------------------------------------------*/
/* Versionsanzeige */
#version.update {
margin-left: 10px !important;
font-size: 19px !important;
color: orchid !important;
padding-top: 5px !important;
}
/* ohne Unterstrich */
#releasenotes, /* Neue Funktionen und Änderungen */
#submit-feedback, /* Feedback senden */
[href='https://www.mozilla.org/?utm_source=firefox-browser&utm_medium=firefox-desktop&utm_campaign=about-dialog'],
[href='about:credits'], /* globalen Comunity */
#contributeDesc > label:nth-child(1), /* Spenden Sie */
#contributeDesc > label:nth-child(2), /* machen Sie mit! */
[href='about:license'], /* Information zur Lizensierung */
[href='about:rights'], /* Endanwenderrechte */
label.bottom-link:nth-child(3) /* Datenschutzbestimmungen */
{
text-decoration: none !important;
}
description.text-blurb:nth-child(3) > label:nth-child(1) {
text-decoration: none !important;
}
/* Text */
.text-blurb
{
font-size: 15px !important;
color: #e1e1e1 !important;
padding-right: 1px !important;
}
/* Neue Funktionen und Änderungen */
#releasenotes {
appearance: none !important;
background: #5b5b66 !important;
color: #e1e1e1 !important;
margin-left: 10px !important;
margin-right: 20px !important;
padding-left: 10px !important;
padding-right: 10px !important;
padding-bottom: 2px !important;
margin-top: 2px !important;
border-color: #ff9600 !important;
border-style: outset !important;
border-width: 3px !important;
background-position: 12px 4px !important;
border-radius: 8px!important;
}
#releasenotes:hover {
background: #e1e1e1 !important;
background-position: 12px 4px !important;
color: #292c2f !important;
}
/* Firefox-Hilfe */
description.text-blurb:nth-child(3) > label:nth-child(1) {
appearance: none !important;
background: #5b5b66 !important;
color: #e1e1e1 !important;
margin-left: 10px !important;
margin-top: 35px !important;
padding-left: 10px !important;
padding-right: 10px !important;
padding-bottom: 2px !important;
border-color: #ff9600 !important;
border-style: outset !important;
border-width: 3px !important;
background-position: 12px 4px !important;
border-radius: 8px!important;
}
description.text-blurb:nth-child(3) > label:nth-child(1):hover {
background: #e1e1e1 !important;
background-position: 12px 4px !important;
color: #292c2f !important;
}
/* Feedback senden */
#submit-feedback {
appearance: none !important;
background: #5b5b66 !important;
color: #e1e1e1 !important;
margin-left: 10px !important;
margin-top: 35px !important;
padding-left: 10px !important;
padding-right: 10px !important;
padding-bottom: 2px !important;
border-color: #ff9600 !important;
border-style: outset !important;
border-width: 3px !important;
background-position: 12px 4px !important;
border-radius: 8px!important;
}
#submit-feedback:hover {
background: #e1e1e1 !important;
background-position: 12px 4px !important;
color: #292c2f !important;
}
/* Mozilla */
[href='https://www.mozilla.org/?utm_source=firefox-browser&utm_medium=firefox-desktop&utm_campaign=about-dialog'] {
appearance: none !important;
background: #5b5b66 !important;
color: #e1e1e1 !important;
margin-left: 1px !important;
margin-right: 1px !important;
margin-top: 10px !important;
padding-left: 10px !important;
padding-right: 10px !important;
padding-bottom: 1px !important;
border-color: #ff9600 !important;
border-style: outset !important;
border-width: 3px !important;
background-position: 12px 4px !important;
border-radius: 8px!important;
}
[href='https://www.mozilla.org/?utm_source=firefox-browser&utm_medium=firefox-desktop&utm_campaign=about-dialog']:hover {
background: #e1e1e1 !important;
background-position: 12px 4px !important;
color: #292c2f !important;
}
/* globalen Comunity */
[href='about:credits'] {
appearance: none !important;
background: #5b5b66 !important;
color: #e1e1e1 !important;
margin-left: 1px !important;
margin-right: 1px !important;
margin-top: 10px !important;
padding-left: 10px !important;
padding-right: 10px !important;
padding-bottom: 1px !important;
border-color: #ff9600 !important;
border-style: outset !important;
border-width: 3px !important;
background-position: 12px 4px !important;
border-radius: 8px!important;
}
[href='about:credits']:hover {
background: #e1e1e1 !important;
background-position: 12px 4px !important;
color: #292c2f !important;
}
/* Hinter dem Komma einen Zeilenumbruch erzwingen */
#detailsBox > description#communityDesc {
max-width: 570px !important;
}
/* Spenden Sie */
#contributeDesc > label:nth-child(1) {
appearance: none !important;
background: #5b5b66 !important;
color: #e1e1e1 !important;
margin-left: 1px !important;
margin-right: 1px !important;
margin-top: 2px !important;
padding-left: 10px !important;
padding-right: 10px !important;
padding-bottom: 2px !important;
border-color: #ff9600 !important;
border-style: outset !important;
border-width: 3px !important;
background-position: 12px 4px !important;
border-radius: 8px!important;
}
#contributeDesc > label:nth-child(1):hover {
background: #e1e1e1 !important;
background-position: 12px 4px !important;
color: #292c2f !important;
}
/* machen Sie mit! */
#contributeDesc > label:nth-child(2) {
appearance: none !important;
background: #5b5b66 !important;
color: #e1e1e1 !important;
margin-left: 1px !important;
margin-right: 1px !important;
margin-top: 2px !important;
padding-left: 10px !important;
padding-right: 10px !important;
padding-bottom: 2px !important;
border-color: #ff9600 !important;
border-style: outset !important;
border-width: 3px !important;
background-position: 12px 4px !important;
border-radius: 8px!important;
}
#contributeDesc > label:nth-child(2):hover {
background: #e1e1e1 !important;
background-position: 12px 4px !important;
color: #292c2f !important;
}
/* Information zur Lizensierung */
[href='about:license'] {
appearance: none !important;
background: #5b5b66 !important;
color: #e1e1e1 !important;
margin-left: 10px !important;
margin-right: 10px !important;
margin-top: 1px !important;
margin-bottom: 20px !important;
padding-left: 10px !important;
padding-right: 10px !important;
padding-bottom: 2px !important;
border-color: #ff9600 !important;
border-style: outset !important;
border-width: 3px !important;
background-position: 12px 4px !important;
border-radius: 8px!important;
}
[href='about:license']:hover {
background: #e1e1e1 !important;
background-position: 12px 4px !important;
color: #292c2f !important;
}
/* Endanwenderrechte */
[href='about:rights'] {
appearance: none !important;
background: #5b5b66 !important;
color: #e1e1e1 !important;
margin-left: 10px !important;
margin-right: 10px !important;
margin-top: 1px !important;
margin-bottom: 20px !important;
padding-left: 10px !important;
padding-right: 10px !important;
padding-bottom: 2px !important;
border-color: #ff9600 !important;
border-style: outset !important;
border-width: 3px !important;
background-position: 12px 4px !important;
border-radius: 8px!important;
}
[href='about:rights']:hover {
background: #e1e1e1 !important;
background-position: 12px 4px !important;
color: #292c2f !important;
}
/* Datenschutzbestimmungen */
label.bottom-link:nth-child(3) {
appearance: none !important;
background: #5b5b66 !important;
color: #e1e1e1 !important;
margin-left: 10px !important;
margin-right: 10px !important;
margin-top: 1px !important;
margin-bottom: 20px !important;
padding-left: 10px !important;
padding-right: 10px !important;
padding-bottom: 2px !important;
border-color: #ff9600 !important;
border-style: outset !important;
border-width: 3px !important;
background-position: 12px 4px !important;
border-radius: 8px!important;
}
label.bottom-link:nth-child(3):hover {
background: #e1e1e1 !important;
background-position: 12px 4px !important;
color: #292c2f !important;
}
/* Text ganz unten, Logo und Warenzeichen */
#trademark {
padding-top: 10px !important;
text-align: center !important;
color: #e1e1e1 !important;
margin-block: 15px !important;
font-size: 13px !important;
font-weight: 700 !important;
}
/* Den Text "design by me ©" will ich ganz unten rechts inne Ecke.... */
#bottomBox::after {
display: flex !important;
content: "design by me ©" !important;
font-size: 11px !important;
margin-left: 850px !important;
color: #e1e1e1 !important;
/* border: 2px solid yellow !important; */
/* border-radius: 15px !important; */
padding-left: 12px !important;
}
#aboutDialog {
margin-bottom: 0px !important;
}
}
Alles anzeigen
Es geht um #updateDeck #checkingForUpdates > label { & #noUpdatesFound > label:nth-child(1) {
Hallo
Du hast es nicht verstanden. In diesem Fall benötigst Du für den Core genau ein Update,nämlich das LCU. Ich habe jetzt keine Lust nachzusehen, welche beiden Updates in diesem Pack enthalten sind. Eines davon ist mit Sicherheit ein CU.
...
Gruß Ingo
Das artet wieder auf einen Streit aus, da habe ich keine Lust drauf.
Aber verrate mir, wieso bei einem "Neu aufsetzen des BS" ohne I-Net mit einem ersten original ISO plötzlich
nach Jahren nur zwei Updates ausstehen?
DAS verstehe ich nicht.
Und dass ein ISO was anderes wie ein Updatepack ist, ist mir sehr wohl klar!
Es ging mir bei diesem Hinweis im Zusammenhang mit einer Neuinstallation auch nur darum,
darauf hinzuweisen, dass es von MS recht aktuelle ISO's gibt, bei denen wirklich nur die letzten Updates fehlen.
Und jetzt klinke ich mich hier aus, denn es sei jedem selbst überlassen, was er/sie für sich richtig hält!
Hallo
und dafür brauchst Du ein Updatepack von einer Fremdquelle? Ich kann 2 Updates auch per WU installieren. Hier geht das sogar automatisch.
Gruß Ingo
Dafür sicherlich nicht, aber wenn das System aus welchen Grund auch immer komplett neu aufgesetzt werden soll
oder muss, kann ein solches Updatepack von Nutzen sein.
Aber, würde ich auch nicht auf diese Weise umsetzen!
Wofür gibt es MSDN bzw. MVS ISO's von Microsoft?
Test beendet!
Konnte keinen Unterschied im Verhalten beider Scriptes ( #40 & #41 ) feststellen!
Beim ersten "clicken" auf den Button wird bei Dir die Schaltfläche Ihre Add-Ons wurden aktualisiert.
Diese fehlt bei mir, egal welches Script ich nutze!
Erst wenn ich über das "Zahnrad" manuell die Suche anwerfe, wird diese angezeigt.
Das weitere Verhalten des Browsers ich dann identisch mit dem "GIF".
Morgen,
wir haben einen Aspekt bisher außen vor gelassen und zwar, dass der Fehler gar nicht durch das Skript verursacht wird, sondern Firefox an dieser Stelle einen Bug hat.
Danke für Deine Mühen.
Dein "neues" Script funktioniert hier genauso gut und unzuverlässig
,
wie die anderen auch.
Werde aber erst einmal das "alte" nach dem Update testen
und dann mal schauen, was die Unterschiede sind.
![]()
So, ...
(function() {
if (window.__SSi != 'window0') return;
CustomizableUI.createWidget({
id: 'addons-update-button',
defaultArea: CustomizableUI.AREA_NAVBAR,
label: 'Add-ons Update',
tooltiptext: 'Add-ons aktualisieren',
onCommand: onCommand,
onCreated: function(button) {
button.style.listStyleImage = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB9klEQVR42o2TP2gTURzHvwcRXqDDCzi8gww+cfACBRsoJAWXji0KzZFBxUELDoouOmnG6JQiWOogVAcpHUpvKDRLQbekoKRDJXHyLYHLIOQNhXtgBt+7u+SSpkq+w93xu9/vw++vhVj0MiUOyzicEo5LuFh/ACGV6PT6HflbKmOyzINnGdt5kPOKnBYxg5pCNu99apdEt9cLAYdPi4cr8+kVDGYJ10oB3mlQdzebqxZnlLZf5vsEwYzRkRTSyL1pZSznCuPtZ/zXlMcNV9e2FH2LBvCjDrAFoNsYueTeiashoPV4EkDWNrSzA/ltP2rwohumjZ9foI5qI7/8+yHgkT0CkGvLwK0q5KYLovzIWK6BXNf2754GVBPABz8GPEwAithQKQJ6JmJiBmqOQekGEyUTqAF8HALuJwDML4OY2gcK6us2EPQj+811Xf+J7kcrAXwOAZS37oyVcLsCFO5CHXvAQSWyLZaist6ugvRFAtg1gOw0QJrGFXTQmYyMcxRytwJyWp8YVAIoj/eAhoHh24nH2GmADHT95yad39MApm+gUbZ9OwVq1mNyWeKsppaEwB9ALu35drjKzwvs1YuFdHXa8V9bCNROgsrGce91CDCX6GbJkxJPr9sE9v+CfQXfE8H2fldtmYu0xn8a0IUZn0tgeMpGfwErbLqeHktDngAAAABJRU5ErkJggg==)';}
});
function onCommand(event) {
let frameScript = function() {
addEventListener('pageshow', function onPageshow(event) {
let document = event.target;
if (document.URL != 'about:addons') return;
removeEventListener('pageshow', onPageshow);
document.querySelector('addon-page-options panel-item[action="check-for-updates"]').click();
let categories = document.getElementById('categories');
let item = categories.querySelector('button[viewid="addons://updates/available"]');
item.click();
content.setTimeout(function() {
content.location.reload();
categories.addEventListener('mousedown', function onMousedown(event) {
if (event.target != item && event.target.parentNode != item) {
item.hidden = true;
categories.removeEventListener('mousedown', onMousedown);
};
});
}, 1000);
});
};
let frameScriptURI = 'data:,(' + frameScript.toString() + ')()';
let window = event.target.ownerGlobal;
window.openTrustedLinkIn('about:addons', 'tab');
window.gBrowser.selectedBrowser.messageManager.loadFrameScript(frameScriptURI, true);
};
})();
Alles anzeigen
... funktioniert das Script bei mir.
Bitte um feedback.
Nachtrag ![]()
![]()
Habe ca. 15 bis 20 Mal den Fuchs neu gestartet und das Script (den Button) ausprobiert.
Leider funktionierte es einmal nicht.
Eventuell doch noch der Wurm drinn.
2. Nachtrag!
Leider funktioniert das Script nicht zuverlässig. ![]()
Eben getestet und von zwei Updates wurde nur eins angezeigt.
Test wiederholt, wieder nur ein Update angezeigt.
Erst beim 3. Test funktionierte es wie gewünscht.
![]()
Ich nutzte für die Versuche:
(function() {
if (window.__SSi != 'window0') return;
CustomizableUI.createWidget({
id: 'addons-update-button',
defaultArea: CustomizableUI.AREA_NAVBAR,
label: 'Add-ons Update',
tooltiptext: 'Add-ons aktualisieren',
onCommand: onCommand,
onCreated: function(button) {
button.style.listStyleImage = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB9klEQVR42o2TP2gTURzHvwcRXqDDCzi8gww+cfACBRsoJAWXji0KzZFBxUELDoouOmnG6JQiWOogVAcpHUpvKDRLQbekoKRDJXHyLYHLIOQNhXtgBt+7u+SSpkq+w93xu9/vw++vhVj0MiUOyzicEo5LuFh/ACGV6PT6HflbKmOyzINnGdt5kPOKnBYxg5pCNu99apdEt9cLAYdPi4cr8+kVDGYJ10oB3mlQdzebqxZnlLZf5vsEwYzRkRTSyL1pZSznCuPtZ/zXlMcNV9e2FH2LBvCjDrAFoNsYueTeiashoPV4EkDWNrSzA/ltP2rwohumjZ9foI5qI7/8+yHgkT0CkGvLwK0q5KYLovzIWK6BXNf2754GVBPABz8GPEwAithQKQJ6JmJiBmqOQekGEyUTqAF8HALuJwDML4OY2gcK6us2EPQj+811Xf+J7kcrAXwOAZS37oyVcLsCFO5CHXvAQSWyLZaist6ugvRFAtg1gOw0QJrGFXTQmYyMcxRytwJyWp8YVAIoj/eAhoHh24nH2GmADHT95yad39MApm+gUbZ9OwVq1mNyWeKsppaEwB9ALu35drjKzwvs1YuFdHXa8V9bCNROgsrGce91CDCX6GbJkxJPr9sE9v+CfQXfE8H2fldtmYu0xn8a0IUZn0tgeMpGfwErbLqeHktDngAAAABJRU5ErkJggg==)';}
});
function onCommand(event) {
let frameScript = function() {
addEventListener('pageshow', function onPageshow(event) {
let document = event.target;
if (document.URL != 'about:addons')
return;
removeEventListener('pageshow', onPageshow);
document.querySelector('addon-page-options panel-item[action="check-for-updates"]').click();
let categories = document.getElementById('categories');
let item = categories.querySelector('button[viewid="addons://updates/available"]');
item.click();
categories.addEventListener('mousedown', function onMousedown(event) {
if (event.target != item && event.target.parentNode != item) {
item.hidden = true;
categories.removeEventListener('mousedown', onMousedown);
};
});
;
});
};
let frameScriptURI = 'data:,(' + frameScript.toString() + ')()';
let window = event.target.ownerGlobal;
window.openTrustedLinkIn('about:addons', 'tab');
window.gBrowser.selectedBrowser.messageManager.loadFrameScript(frameScriptURI, true);
};
})();
Alles anzeigen
Drücke den "Button", und die Seite "about:addons" wird geladen,
nach einem kurzen Augenblick erscheint dann die Schaltfläche Verfügbare Updates anzeigen
und auch Rechts die Schaltfläche Verfügbare Updates.
Beide Schaltflächen scheinen ohne Funktion ![]()
Drücke ich jetzt in der "Navbar" den Reloadbutton, wird nach der Funktion nun
unter Verfügbare Updates auch das Add-on gezeigt für welches ein Update vorhanden ist.
Ganz ohne Script funktionieren beide Schaltflächen.
Nachtrag!
Das Script funktioniert ohne jegliches content.setTimeout(function() {
richtig, wenn man oben z.B. den Reloadbutton tätigt!
Also, wenn die "Seite" ein zweites Mal geladen wird!
Eventuell gibt es ja eine Funktion für Reload?
Wäre dann zwar unelegant, aber Hauptsache es funktioniert und das Ergebnis stimmt.
![]()
Wieder so eine Zeitschleife.
Leider funktioniert das Script so nicht bei mir.
Habe beide Werte auf 5000 hochgestellt und auch da funktioniert es nicht.
Und auch bei dem neuen Script ist es so, dass beim zweiten Mal ausführen es richtig funktioniert.
Und wenn der Fehler durch
let frameScriptURI = 'data:,(' + frameScript.toString() + ')()';
und/oder
window.gBrowser.selectedBrowser.messageManager.loadFrameScript(frameScriptURI, true);
verursacht wird, müsste man dann nicht da ansetzen? ![]()
Leider verstehe ich von JavaScript so gar nichts.
Ach so!
Und verstehe ich diese Aussage richtig, wenn ich sage, es ist zu viel für die Laufzeitumgebung?
ZitatInternalError
Der Typ InternalError wird verwendet, wenn eine Ausnahme in der JavaScript-Laufzeit-Engine auftritt. Das kann auf ein Problem in deinem Code hindeuten, muss es aber nicht.
In den meisten Fällen tritt InternalError nur in zwei Szenarien auf:
- Wenn ein Patch oder ein Update für die JavaScript-Laufzeitumgebung einen Fehler enthält, der Ausnahmen auslöst (dies kommt sehr selten vor)
- Wenn dein Code Elemente enthält, die für die JavaScript-Engine zu groß sind (z. B. zu viele Switch-Cases, zu große Array-Initialisierungen, zu viele Rekursionen)
Der beste Ansatz zur Lösung dieses Fehlers besteht darin, die Ursache anhand der Fehlermeldung zu identifizieren und deine App-Logik nach Möglichkeit umzustrukturieren, um die plötzliche Belastungsspitze der JavaScript-Engine zu beseitigen.
Quelle: https://kinsta.com/de/blog/fehler…/#internalerror
Update.
Wenn ich zweimal hintereinander das Script ausführe, also zweimal den Button betätige,
wird das Script beim zweiten Aufruf richtig ausgeführt!
Ich erinnere dann beim nächsten Mal, wenn es wieder um die Forenregeln und Updates geht.
Ich möchte jetzt hier keine Diskussion lostreten, es sind nur Anregungen und Gedanken!
Leider hast Du aber einen Satz meiner Meinung so aus dem Kontext gerissen,
dass er, so finde ich, so einzeln eine ganz andere Aussage darstellt.
Aber gut, wenn, wie Du schreibst, keinen Sinn ergibt, falsche angaben zu machen,
dann frage ich mich, warum dann hier diese Diskussion mit Heinrich stattfindet.
Wenn Du denkst, man könnte diese Sache besprechen und Gedanken darüber austauschen,
dann ist es glaube ich besser, Du trennst meinen und Deinen Betrag aus diesem Thread ab.
Nur mal so ein Gedanke am Rande!
Ist es nicht möglich, bestimmten Browsern den Zugang zu verweigern,
oder ein Popup mit bestimmten Informationen anzeigen zulassen,
wenn das Sperren zu drastisch sein sollte?
Und, wäre es nicht möglich im Forum automatisch den Browser, bzw. die Version anzeigen zulassen?
Eventuell auch das BS?
Wenn alle anderen dann wissen, dass a. ein nicht mehr aktuelles BS genutzt wird,
b. ein nicht mehr aktueller Browser genutzt wird,
bekommt betreffende Person ganz einfach keinen Support mehr!
All das müsste doch per Automatismus mach bar sein.
Without apikey, the script would translate text through backdoor, there will be some restrictions.
Yes, without apikey.
I wouldn't care if there were restrictions.
It would only have to work, which it does not.
Dieses JavaScript ist ja sehr nett, aber um eine kostenlosen "API key" zu bekommen
müssen die Bankdaten angegeben werden!
Das ist nicht wirklich prickelnd und ich bekomme da "Bauchweh"!
Geht es auch irgendwie ohne?
Und wer diese Japanische Schriftzeichen ändern möchte,
Zeile 83
menuItem.label = "Auswahl mit DeepL übersetzen";
und
Zeile 192
logo.textContent = "DeepL Übersetzer";
Wie ein Icon vor den Text des Menüs "gezaubert" wird, muss ich erst noch testen.
Macht nur im Moment keinen Sinn, da ohne API-Key das Script nicht funktioniert.
Und hier noch ein Mal der Code des JavaScripts im Original,
da bei mir die Seite schon einige Male nicht geladen wurde
// ==UserScript==
// @name DeepL Translator
// @include main
// @compatibility Firefox 78+
// @description コンテクストメニューに選択テキストをDeepLで翻訳する機能を追加する
// @note DeepLのAPIキー (無料版で可) が必要
// @charset UTF-8
// ==/UserScript==
"use strict";
if (typeof window === "undefined" || globalThis !== window) {
/* --- 設定ここから --- */
const apiKey = "Enter your API key here!";
const apiEndpoint = "https://api-free.deepl.com/v2";
const hotkey = {
enabled: false,
code: "ControlLeft",
repeat: 2,
timeout: 500,
};
const defaultLang = "JA";
const supportedLangs = {
//"BG": "Bulgarian",
//"CS": "Czech",
//"DA": "Danish",
"DE": "German",
//"EL": "Greek",
//"EN-GB": "English (British)",
"EN-US": "English (American)",
"ES": "Spanish",
//"ET": "Estonian",
//"FI": "Finnish",
"FR": "French",
//"HU": "Hungarian",
"IT": "Italian",
"JA": "Japanese",
//"LT": "Lithuanian",
//"LV": "Latvian",
//"NL": "Dutch",
//"PL": "Polish",
//"PT-PT": "Portuguese",
//"PT-BR": "Portuguese (Brazilian)",
//"RO": "Romanian",
//"RU": "Russian",
//"SK": "Slovak",
//"SL": "Slovenian",
//"SV": "Swedish",
//"ZH": "Chinese",
};
/* --- 設定ここまで --- */
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(this, "ContentDOMReference", "resource://gre/modules/ContentDOMReference.jsm");
ChromeUtils.defineModuleGetter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm");
if (!Services.appinfo.remoteType) {
this.EXPORTED_SYMBOLS = ["DLTranslator", "DLTranslatorParent"];
try {
const actorParams = {
parent: {
moduleURI: __URI__,
},
child: {
moduleURI: __URI__,
events: {},
},
allFrames: true,
messageManagerGroups: ["browsers"],
matches: [`*://*/*`],
};
if (hotkey.enabled) {
if (hotkey.repeat <= 0) hotkey.repeat = 2;
if (hotkey.timeout <= 0) hotkey.timeout = 500;
actorParams.child.events.keyup = {};
}
ChromeUtils.registerWindowActor("DLTranslator", actorParams);
} catch(e) {Cu.reportError(e);}
this.DLTranslator = new class {
attachToWindow(win) {
let menuPopup = win.document.getElementById("contentAreaContextMenu");
let menuItem = win.document.createXULElement("menuitem");
menuItem.label = "選択テキストを DeepL で翻訳";
menuItem.id = "menu-deepl-translate";
menuItem.addEventListener("command", this);
menuPopup.appendChild(menuItem);
menuPopup.addEventListener("popupshowing", this);
win.addEventListener("unload", this, {once:true});
}
detachFromWindow(win) {
win.removeEventListener("unload", this, {once:true}); // this might be unnecessary, but do anyway
const menu = win.document.getElementById("menu-deepl-translate");
menu.parentNode.removeEventListener("popupshowing", this);
menu.parentNode.removeChild(menu);
}
handleEvent({type, target}) {
switch(type) {
case "popupshowing":
this.handlePopup(target.ownerGlobal);
break;
case "command":
this.beginTranslate(target.ownerGlobal.gContextMenu?.contentData);
break;
case "unload":
this.detachFromWindow(target.ownerGlobal);
break;
}
}
handlePopup(win) {
let selectionText = win.gContextMenu?.contentData?.selectionInfo?.text;
win.document.getElementById("menu-deepl-translate").hidden = !selectionText;
}
beginTranslate(contextMenuContentData) {
if (!contextMenuContentData) return;
const win = contextMenuContentData.browser.ownerGlobal;
const selectionText = contextMenuContentData.selectionInfo?.fullText;
const targetIdentifier = contextMenuContentData.context?.targetIdentifier;
const screenX = contextMenuContentData.context?.screenX ?? contextMenuContentData.context?.screenXDevPx / win.devicePixelRatio;
const screenY = contextMenuContentData.context?.screenY ?? contextMenuContentData.context?.screenYDevPx / win.devicePixelRatio;
const browser = contextMenuContentData.browser;
const browserBoundingRect = browser.getBoundingClientRect();
const fixupX = browser.ownerGlobal.outerWidth - browserBoundingRect.left - browserBoundingRect.width;
const fixupY = 20 + browser.ownerGlobal.outerHeight - browserBoundingRect.top - browserBoundingRect.height;
const actor = contextMenuContentData.frameBrowsingContext.currentWindowGlobal.getActor("DLTranslator");
actor.sendAsyncMessage("DLT:CreatePopup", {
targetIdentifier,
screenX, screenY,
fixupX, fixupY,
fromLang: null,
toLang: null,
sourceText: selectionText,
});
}
}();
this.DLTranslatorParent = class extends JSWindowActorParent {
receiveMessage({name, data}) {
switch(name) {
case "DLT:OpenTranlatorInTab":
const win = this.browsingContext.top.embedderElement.ownerGlobal;
win.openLinkIn(`https://www.deepl.com/translator#${data.sourceLang}/${data.targetLang}/${encodeURIComponent(data.sourceText)}`,
"tab", {
relatedToCurrent: true,
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
}
);
break;
}
}
}
}
else {
Cu.importGlobalProperties(["fetch"]);
this.EXPORTED_SYMBOLS = ["DLTranslatorChild"];
this.DLPopupTranslator = class {
constructor(win, x, y, sourceText) {
this.sourceLang = "EN";
this.targetLang = win.windowGlobalChild.getActor("DLTranslator").defaultLang;
this.sourceText = sourceText.trim();
const popup = this.popup = win.document.createElement("div");
Object.assign(popup.style, {
position: "absolute",
top: `${win.scrollY + y}px`,
left: `${win.scrollX + x}px`,
width: "400px",
maxHeight: "200px",
fontFamily: "sans-serif",
fontSize: "16px",
color: "black",
background: "floralwhite",
border: "1px solid darkgray",
borderRadius: "3px",
boxShadow: "3px 3px 5px lightgray",
transition: "opacity 0.2s ease",
zIndex: "1000",
});
const flex = win.document.createElement("div");
Object.assign(flex.style, {
display: "flex",
maxHeight: "200px",
flexDirection: "column",
});
const header = win.document.createElement("div");
Object.assign(header.style, {
display: "flex",
height: "auto",
margin: "2px 5px 1px",
fontSize: "smaller",
alignItems: "center",
});
const logo = win.document.createElement("div");
logo.textContent = "DeepL ほんやくくん";
Object.assign(logo.style, {
width: "auto",
fontWeight: "bold",
flexGrow: "1",
});
header.appendChild(logo);
const langSelector = win.document.createElement("select");
for (let [lang, desc] of Object.entries(supportedLangs)) {
const option = win.document.createElement("option");
option.value = lang;
option.textContent = desc;
langSelector.appendChild(option);
}
langSelector.value = this.targetLang;
Object.assign(langSelector.style, {
width: "auto",
marginRight: "5px",
});
langSelector.addEventListener("change", this);
header.appendChild(langSelector);
const more = win.document.createElement("div");
more.className = "deepl-translator-more";
more.textContent = "more";
Object.assign(more.style, {
width: "auto",
cursor: "pointer",
});
more.addEventListener("click", this);
header.appendChild(more);
flex.appendChild(header);
const box = win.document.createElement("div");
box.className = "deepl-translator-box";
Object.assign(box.style, {
height: "auto",
overflow: "auto",
background: "white",
padding: "2px",
margin: "1px 5px 5px",
border: "1px solid darkgray",
flexGrow: "1",
whiteSpace: "pre-wrap",
});
flex.appendChild(box);
this.popup.appendChild(flex);
win.document.body.appendChild(popup);
win.setTimeout(() => win.addEventListener("click", this), 0);
}
handleEvent(event) {
const {type, target} = event;
switch(type) {
case "click":
if (!this.popup.contains(target)) {
target.ownerGlobal.removeEventListener("click", this);
this.popup.addEventListener("transitionend", ({target}) => {
target.parentNode.removeChild(target);
}, {once:true});
this.popup.style.opacity = 0;
}
else if (target.className === "deepl-translator-more") {
const actor = target.ownerGlobal.windowGlobalChild.getActor("DLTranslator");
actor.sendAsyncMessage("DLT:OpenTranlatorInTab", {
sourceText: this.sourceText,
sourceLang: this.sourceLang,
targetLang: this.targetLang,
});
event.stopPropagation();
}
break;
case "change":
this.targetLang = target.value;
this.translate(null, this.targetLang);
break;
}
}
setText(text, color) {
let box = this.popup.querySelector(".deepl-translator-box");
if (color) box.style.color = color;
else box.style.color = null;
box.textContent = text;
}
fetchWithPrivilege(url, request) {
return new Promise((resolve, reject) => {
const {method, headers, body, referrer} = request;
let origin = referrer ? referrer : url;
const channel = NetUtil.newChannel({
uri: NetUtil.newURI(url),
loadingPrincipal: Services.scriptSecurityManager.createContentPrincipal(NetUtil.newURI(origin), {}),
contentPolicyType: Ci.nsIContentPolicy.TYPE_OTHER,
securityFlags: Ci.nsILoadInfo.SEC_REQUIRE_CORS_INHERITS_SEC_CONTEXT || Ci.nsILoadInfo.SEC_REQUIRE_CORS_DATA_INHERITS,
});
channel.QueryInterface(Ci.nsIHttpChannel);
channel.loadFlags |= Ci.nsIRequest.LOAD_ANONYMOUS;
channel.requestMethod = method || "GET";
if (headers) {
for (const [name, value] of Object.entries(headers)) {
if (channel.setNewReferrerInfo && name.toLowerCase() === "referer") {
channel.setNewReferrerInfo(
value,
Ci.nsIReferrerInfo.UNSAFE_URL,
true
);
}
else {
channel.setRequestHeader(name, value, false);
}
}
}
if (body) {
channel.QueryInterface(Ci.nsIUploadChannel2);
const converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter);
converter.charset = "UTF-8";
channel.explicitSetUploadStream(converter.convertToInputStream(body), null, -1, method, false);
}
NetUtil.asyncFetch(channel, (stream, status) => {
if (!Components.isSuccessCode(status)) {
let e = Components.Exception("", status);
reject(new Error(`Error while loading ${url}: ${e.name}`));
}
let text = NetUtil.readInputStreamToString(stream, stream.available());
stream.close();
resolve({
ok: channel.requestSucceeded,
status: channel.responseStatus,
statusText: channel.responseStatusText,
contentType: channel.getResponseHeader("content-type"),
text
});
});
});
}
translateUsingBackdoor(from, to) {
const getTimestamp = text => {
let now = new Date().getTime();
let count = 1;
let match = text.match(/i/g);
if (match) {
count += match.length;
}
return now + count - now % count;
};
this.fetchWithPrivilege("https://www2.deepl.com/jsonrpc", {
method: "POST",
referrer: "https://www.deepl.com/translator",
headers: {
"Content-Type": "application/json",
Referer: "https://www.deepl.com/translator",
},
body: JSON.stringify({
jsonrpc: "2.0",
method: "LMT_handle_texts",
params: {
texts: [{text: this.sourceText}],
splitting: "newlines",
lang: {
target_lang: to.slice(0, 2),
source_lang_user_selected: from ? from : "auto",
},
timestamp: getTimestamp(this.sourceText),
},
id: 1000000+Math.floor(Math.random()*99000000),
}, null, 4),
}).then(resp => {
if (!resp.ok && !resp.contentType.startsWith("application/json")) {
throw new Error(`Server returned ${resp.status} ${resp.statusText}`);
}
return JSON.parse(resp.text);
}).then(json => {
if (json.error) throw new Error(`Error code ${json.error.code}: ${json.error.message}`);
if (!json.result?.texts) throw new Error("Unknown error occurred");
this.setText(json.result.texts[0].text);
this.sourceLang = json.result.lang;
}).catch(e => {
this.setText(e.message, "red");
Cu.reportError(e);
});
}
translate(from, to) {
this.setText("翻訳中...", "lightgray");
if (to) {
this.popup.querySelector("select").value = this.targetLang = to;
this.popup.ownerGlobal.windowGlobalChild.getActor("DLTranslator").defaultLang = to;
}
if (!apiKey) return this.translateUsingBackdoor(from, this.targetLang);
const body = new FormData();
body.append("text", this.sourceText);
body.append("target_lang", this.targetLang);
body.append("auth_key", apiKey);
if (from) body.append("source_lang", from);
return fetch(`${apiEndpoint}/translate`, {
method: "POST",
referrerPolicy: "no-referrer",
credentials: "omit",
body,
}).then(resp => {
if (!resp.ok && resp.status != 400) {
throw new Error(`Server returned ${resp.status} ${resp.statusText}`);
}
return resp.json();
}).then(json => {
if (!json.translations) throw new Error(`${json.message}: ${json.detail}`);
this.setText(json.translations[0].text);
this.sourceLang = json.translations[0].detected_source_language;
fetch(`${apiEndpoint}/usage`, {
referrerPolicy: "no-referrer",
credentials: "omit",
headers: {
Authorization: `DeepL-Auth-Key ${apiKey}`,
},
}).then(resp => {
if (!resp.ok) throw new Error();
return resp.json();
}).then(json => {
this.popup.title = `Quota: ${(100*json.character_count/json.character_limit).toPrecision(2)}% (${json.character_count} / ${json.character_limit})`;
}).catch(()=>{});
}).catch(e => {
this.setText(e.message, "red");
Cu.reportError(e);
});
}
}
this.DLTranslatorChild = class extends JSWindowActorChild {
actorCreated() {
this.defaultLang = defaultLang;
this.keyRepeat = 0;
}
createPopupWithScreenCoordinate(screenX, screenY, sourceText) {
let x = screenX - this.contentWindow.screenX - this.contentWindow.outerWidth + this.contentWindow.innerWidth;
let y = screenY - this.contentWindow.screenY - this.contentWindow.outerHeight + this.contentWindow.innerHeight;
return this.createPopupWithClientCoordinate(x, y, sourceText);
}
createPopupWithClientCoordinate(clientX, clientY, sourceText) {
let x = clientX;
let y = clientY;
let clientWidth = this.contentWindow.document.documentElement.clientWidth;
let clientHeight = this.contentWindow.document.documentElement.clientHeight;
if (x + 400 > clientWidth) x = clientWidth - 400;
if (y + 200 > clientHeight) y = clientHeight - 200;
x = Math.max(x, 0);
y = Math.max(y, 0);
return new DLPopupTranslator(this.contentWindow, x, y, sourceText);
}
createPopupWithSelection() {
const selection = this.contentWindow.getSelection();
const text = selection.toString().trim();
if (text) {
let rect = selection.getRangeAt(0).getBoundingClientRect();
return this.createPopupWithClientCoordinate(rect.left, rect.top+rect.height, text);
}
return null;
}
receiveMessage({name, data}) {
switch(name) {
case "DLT:CreatePopup":
let fixupX = 0;
let fixupY = 0;
if (data.fixupX) fixupX = data.fixupX;
if (data.fixupY) fixupY = data.fixupY;
this.createPopupWithScreenCoordinate(data.screenX+fixupX, data.screenY+fixupY, data.sourceText).translate(data.fromLang, data.toLang);
break;
case "DLT:CreatePopupWithClientCoordinate":
this.createPopupWithClientCoordinate(data.clientX, data.clientY, data.sourceText).translate(data.fromLang, data.toLang);
break;
}
}
handleEvent(event) {
switch (event.type) {
case "keyup":
if (event.code === hotkey.code && this.contentWindow.getSelection()?.toString()) {
if (!this.keyRepeat) {
new Promise((resolve, reject) => {
this.hotkeyResolver = resolve;
this.hotkeyRejector = reject;
this.contentWindow.setTimeout(() => reject(), hotkey.timeout);
}).then(() => {
this.keyRepeat = 0;
this.hotkeyResolver = null;
this.hotkeyRejector = null;
this.createPopupWithSelection()?.translate(null, this.defaultLang);
}).catch(() => {
this.keyRepeat = 0;
this.hotkeyResolver = null;
this.hotkeyRejector = null;
});
}
if (++this.keyRepeat === hotkey.repeat) {
this.hotkeyResolver();
}
}
else if (this.keyRepeat) {
this.hotkeyRejector();
}
break;
}
}
}
}
}
else {
try {
if (parseInt(Services.appinfo.version) < 101) {
ChromeUtils.import(Components.stack.filename).DLTranslator.attachToWindow(window);
} else {
const fileHandler = Services.io.getProtocolHandler("file").QueryInterface(Ci.nsIFileProtocolHandler);
const scriptFile = fileHandler.getFileFromURLSpec(Components.stack.filename);
const resourceHandler = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler);
if (!resourceHandler.hasSubstitution("deepl-ucjs")) {
resourceHandler.setSubstitution("deepl-ucjs", Services.io.newFileURI(scriptFile.parent));
}
ChromeUtils.import(`resource://deepl-ucjs/${encodeURIComponent(scriptFile.leafName)}?${scriptFile.lastModifiedTime}`).DLTranslator.attachToWindow(window);
}
} catch(e) {}
}
Alles anzeigen