- Firefox-Version
- Firefox 141.0
- Betriebssystem
- Windows 11 Pro 64-Bit
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
JavaScript
// ==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();
})();
Alles anzeigen
Gleiche Problem bei ScrollTopAndBottom.uc.js
JavaScript
//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.listStyleImage='url("chrome://browser/skin/downloads/downloads.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.listStyleImage='url("chrome://browser/skin/downloads/downloads.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 { \
list-style-image: url("chrome://browser/skin/downloads/downloads.svg");\
transform:rotate(180deg)!important;\
margin-left: 0px !important;\
margin-right: 15px !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);
})();
Alles anzeigen
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.