Beiträge von 2002Andreas
-
-
-
und es funktioniert.
Da muss im ganzen Code noch Sand im Getriebe sein
In solchen Fällen kopiere ich den Inhalt eines Code, und deaktiviere ihn dann.
Dann den Inhalt in die Browser-Werkzeuge einfügen, und dann teilweise Einträge löschen..testen..Rückgängig machen.. usw. bis ich den Fehler gefunden habe.
-
-
-
-
-
-
-
noch ein wenig Verschönerung betreiben.
Gleich mit deinem Icon.
JavaScript
Alles anzeigen//ScrollTopAndBottom.uc.js (function() { if (location.href !== 'chrome://browser/content/browser.xhtml') return; let menuitem = document.createXULElement('menuitem'); menuitem.id = 'context-to-top'; menuitem.classList.add('menuitem-iconic'); menuitem.setAttribute('tooltiptext' , ''); menuitem.style.setProperty('--menuitem-icon', 'url("chrome://global/skin/icons/arrow-down.svg")'); let refItem = document.getElementById('context-reload'); refItem.parentNode.insertBefore(menuitem, refItem); //click menuitem.addEventListener('click', () => { if (event.button == 0) { ownerGlobal.gBrowser.selectedBrowser.messageManager.loadFrameScript(' data: , content.scrollTo(0,0) ' , false); } }); })(); (function() { if (location.href !== 'chrome://browser/content/browser.xhtml') return; let menuitem = document.createXULElement('menuitem'); menuitem.id = 'context-to-bottom'; menuitem.classList.add('menuitem-iconic'); menuitem.setAttribute('tooltiptext' , ''); menuitem.style.setProperty('--menuitem-icon', 'url("chrome://global/skin/icons/arrow-down.svg")'); let refItem = document.getElementById('context-reload'); refItem.parentNode.insertBefore(menuitem, refItem); //click menuitem.addEventListener('click', () => { if (event.button == 0) { ownerGlobal.gBrowser.selectedBrowser.messageManager.loadFrameScript(' data: , content.scrollTo(0,100000) ' , false); } }); var css = '\ #context-to-top { \ --menuitem-icon: url("chrome://global/skin/icons/arrow-down.svg");\ transform:rotate(180deg)!important;\ }'; var cssUri = Services.io.newURI('data:text/css,' + encodeURIComponent(css), null, null); var SSS = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService); SSS.loadAndRegisterSheet(cssUri, SSS.AGENT_SHEET); })();
-
Workaround für mich bis das Skript Openwidth.uc.js wieder angepasst wurde:
Per CSS-Code oder gleich ins Skript:
CSS
Alles anzeigen#context-open-with-page > menupopup:nth-child(4) > menuitem:nth-child(1)::before, #context-open-with-link > menupopup:nth-child(4) > menuitem:nth-child(1)::before { background: url("file:D:/Nightly Neu/Firefox/profile/chrome/Icons/Nightly.png")!important; margin-right: 8px !important; margin-left: 0px !important; content: '' !important; display: block !important; width: 16px !important; height: 16px !important; background-repeat: no-repeat !important; background-position: 0px 0px !important; } #context-open-with-page > menupopup:nth-child(4) > menuitem:nth-child(n+3):nth-child(-n+4)::before, #context-open-with-link > menupopup:nth-child(4) > menuitem:nth-child(n+3):nth-child(-n+4)::before { background: url("file:D:/Nightly Neu/Firefox/profile/chrome/Icons/firefox_final.ico")!important; margin-right: 8px !important; margin-left: 0px !important; content: '' !important; display: block !important; width: 16px !important; height: 16px !important; background-repeat: no-repeat !important; background-position: 0px 0px !important; } #context-open-with-page > menupopup:nth-child(4) > menuitem:nth-child(n+5):nth-child(-n+12)::before, #context-open-with-link > menupopup:nth-child(4) > menuitem:nth-child(n+5):nth-child(-n+12)::before { background: url("file:D:/Nightly Neu/Firefox/profile/chrome/Icons/firefox_esr.ico")!important; margin-right: 8px !important; margin-left: 0px !important; content: '' !important; display: block !important; width: 16px !important; height: 16px !important; background-repeat: no-repeat !important; background-position: 0px 0px !important; } #context-open-with-page > menupopup:nth-child(4) > menuitem:nth-child(13)::before, #context-open-with-link > menupopup:nth-child(4) > menuitem:nth-child(13)::before { background: url("file:D:/Nightly Neu/Firefox/profile/chrome/Icons/chrome.png")!important; margin-right: 8px !important; margin-left: 0px !important; content: '' !important; display: block !important; width: 16px !important; height: 16px !important; background-repeat: no-repeat !important; background-position: 0px 0px !important; } #context-open-with-page > menupopup:nth-child(4) > menuitem:nth-child(14)::before, #context-open-with-link > menupopup:nth-child(4) > menuitem:nth-child(14)::before { background: url("file:D:/Nightly Neu/Firefox/profile/chrome/Icons/edge.png")!important; margin-right: 8px !important; margin-left: 0px !important; content: '' !important; display: block !important; width: 16px !important; height: 16px !important; background-repeat: no-repeat !important; background-position: 0px 0px !important; } #context-open-with-page > menupopup:nth-child(4) > menuitem:nth-child(1) > img, #context-open-with-page > menupopup:nth-child(4) > menuitem:nth-child(n+3) > img, #context-open-with-link > menupopup:nth-child(4) > menuitem:nth-child(1) > img, #context-open-with-link > menupopup:nth-child(4) > menuitem:nth-child(n+3) > img { display: none !important; }
-
-
-
Gibt es evtl. auch noch eine Lösung für das erste Skript?
JavaScript
Alles anzeigen// ==UserScript== // @name OpenWith // @description Fügt dem Kontextmenü ein Menü hinzu, zum Öffnen der aktuelle Seite und eines ausgewählten Links in einem anderen Browser. // @description und eines ausgewählten Links in einem anderen Browser. // @version 1.2.1a 63+ // @author y2k // @include main // @charset UTF-8 // @namespace http://tabunfirefox.web.fc2.com/ // @note Anwendungssymbol anzeigen // @note als .uc.js Script umgeschrieben // ==/UserScript== (function() { "use strict"; if (location != 'chrome://browser/content/browser.xhtml') return; /* Vor Verwendung, Pfad auf eigene Umgebung ändern(\ wird durch \\ ersetzt) Zum Übergeben von Argumenten, wie folgt vorgehen: C:\\Program Files\\Internet Explorer\\iexplore.exe<>$1 Argument Argument ※ $1 wird in URL umgewandelt */ const BrowserPath = { "Nightly": "D:\\Nightly\\NightlyMultiLoader.exe", "Nightly Neu ": "D:\\Nightly Neu\\Firefox Launcher.exe", "Beta": "D:\\Beta\\BetaLoader.exe", "Neu": "C:\\Program Files\\Mozilla Firefox\\firefox.exe", "Test Firefox": "D:\\Test-Firefox\\Firefox Launcher.exe", "ESR 140": "D:\\ESR 140\\ESRLoader.exe", "ESR 128": "D:\\ESR 128\\ESRLoader.exe", "ESR 115": "D:\\ESR 115\\ESRLoader.exe", "ESR 102": "G:\\ESR 102\\ESRLoader.exe", "ESR 91": "G:\\ESR 91\\FirefoxLoader.exe", "ESR 78": "G:\\ESR 78\\FirefoxLoader.exe", "ESR 68": "G:\\ESR 68\\FirefoxLoader.exe", "ESR 52": "G:\\ESR 52\\FirefoxLoader.exe", "Chrome": "D:\\Portable Chrome neu\\Chrome Launcher.exe", "Edge": "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", }; const FlatMenu = false; const OpenWith = { start: function() { const cm = document.getElementById("contentAreaContextMenu"); cm.addEventListener("popupshowing", function(e) { if (e.target == this) { OpenWith.onpopup(e); } }, false); }, createMenu: function() { if (this.pageItem || this.linkItem) { return; } const contextMenu = document.getElementById("contentAreaContextMenu"); const pageMenu = this.$C("menu", { id: "context-open-with-page", label: "Seite öffnen mit:" }); contextMenu.insertBefore(pageMenu, contextMenu.querySelector(":scope > #context-bookmarkpage, :scope > #context-savepage")); const linkMenu = this.$C("menu", { id: "context-open-with-link", label: "Link öffnen mit:" }); contextMenu.insertBefore(linkMenu, contextMenu.querySelector(":scope > #context-sep-open")); this.pageItem = this.createMenuItem(pageMenu, "openPage", FlatMenu? "Seite öffnen mit $1 ":" $1"); this.linkItem = this.createMenuItem(linkMenu, "openLink", FlatMenu? "Link öffnen mit $1 ":" $1"); }, createMenuItem: function(menu, method, format) { const frag = document.createDocumentFragment(); let menuitem = []; for (let i of Object.keys(BrowserPath)) { const item = this.$C("menuitem", { label: format.replace("$1", i), class: "menuitem-iconic", image: "moz-icon:file:///" + BrowserPath[i].split("<>")[0] + "?size=16", value: JSON.stringify([ method, i ]), }); item.addEventListener("command", this, false); frag.appendChild(item); menuitem[menuitem.length] = item; } if (!FlatMenu) { const menupopup = this.$C("menupopup"); menupopup.appendChild(frag); menu.appendChild(menupopup); menuitem = [ menu ]; } else { const parent = menu.parentNode; parent.insertBefore(frag, menu); parent.removeChild(menu); } return menuitem; }, $C: function(tag, attrs) { const elem = document.createXULElement(tag); if (attrs) { for (let key of Object.keys(attrs)) elem.setAttribute(key, attrs[key]); } return elem; }, onpopup: function(e) { this.createMenu(); const isHtml = /^(https?|file):/.test(gBrowser.currentURI.spec); const pageItemHidden = !isHtml || gContextMenu.onLink || gContextMenu.onTextInput; const linkItemHidden = !isHtml || !gContextMenu.onLink || gContextMenu.onTextInput; const pageItem = this.pageItem; for (let i = 0, l = pageItem.length; i < l; i++) { pageItem[i].hidden = pageItemHidden; } const linkItem = this.linkItem; for (let i = 0, l = linkItem.length; i < l; i++) { linkItem[i].hidden = linkItemHidden; } }, handleEvent: function(event) { if (event.type === "command") { const [ method, key ] = JSON.parse(event.originalTarget.getAttribute("value")); const url = method === "openPage"? gBrowser.currentURI.spec: gContextMenu.linkURL; this.launch(BrowserPath[key], url); } }, launch: function(browserPath, openURL) { let [ path, args ] = browserPath.split("<>"); if (args) { args = args.split("^^").map(a => a.replace("$1", openURL)); } else { args = [ openURL ]; } const file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile); file.initWithPath(path); const process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess); process.init(file); process.run(false, args, args.length, {}); }, }; OpenWith.start(); })();
Komischerweise wird ein Icon ja angezeigt
Funktionierte aber trotzdem
trotz Anpassung...hier nicht
Danke für deine Mühe
Ich habe mich für die Änderung von Sören entschieden.
-
-
mein Skript nutzen, wenn Du magst, musst halt nur alle Symbole austauschen
Da wird zur Zeit reichlich dran gearbeitet:
BeitragScrollTopAndBottom.uc.js und Open with.uc.js zeigen keine Icons mehr an im Nightly
Hallo @ all.
Im aktuellem Nightly werden mir bei 2 Skripten keine Icons mehr angezeigt.
Openwidth.uc.js
Nur das Icon der Beta Version ist vorhanden
(Quelltext, 154 Zeilen)
Gleiche Problem bei ScrollTopAndBottom.uc.js
(Quelltext, 49 Zeilen)
Kann das jemand bestätigen, bzw. lassen sich die Skripte wieder anpassen?
Oder besser erst auf das nächste Update vom Nightly warten?
Wie immer vielen Dank vorweg für jegliche Hilfe.2002Andreas31. Juli 2025 um 11:53 -
-
-
-