I'm going to have a hard time explaining the problem, please take that into consideration.
Fx 91- 102, Win 7, sp1, fullup,, x64, MD version without installation
Using a script that works correctly in other cases, it stumbles on your program.
The script loader can be taken here, the author is from ukraine, so offended at us and deleted his account.
The script itself (post deleted, so - code):
(this.contextmenuopenwith = {
_eventlisteners: [],
menupage: {},
menulink: {},
init(that) {
var attrimage = true; // true or false Add icons ("image" attribute) or not
var submenu = true; // true or false Add a submenu for items or not
var prelabpage = true; // Add "Open Page in" at the beginning;
var prelablink = true; //Add "Open link in" at the beginning;
// 1-й true или false - Whether to show the item on the page or not,
// 2-й true или false - Show item on links or not
//next - 'item ID', 'application name', 'application path', 'arguments separated by a space (what is in double quotes counts as one argument)', 'icon (optional for Windows OS).
var arrayWindows = [ // for Windows
// [true, true, 'edge', 'Microsoft Edge', 'C:\\Windows\\explorer.exe', '"microsoft-edge:%OpenURI "', 'moz-icon://file://C:\\Windows\\SystemApps\\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\\MicrosoftEdge.exe?size=16'],
// [false, true, 'potplayer', 'PotPlayer', 'D:\\PotPlayerMini.exe', '%OpenURI /add'],
[false, true, 'potplayer64', 'PotPlayer 64', 'D:\\PotPlayer64\\PotPlayerMini64.exe', '%OpenURI /add'],
[true, true, 'usd', 'MediaDownloader', 'D:\\yt-dlp_MediaDownloader\\media-downloader.exe', '%OpenURI /a /u'],
];
var arrayLinux = [ // for Linux
[true, true, 'smplayer', 'SMPlayer', '/usr/bin/smplayer', '%OpenURI', 'moz-icon://stock/smplayer?size=menu'],
[true, true, 'vlc', 'VLC', '/usr/bin/vlc', '%OpenURI', 'moz-icon://stock/vlc?size=menu'],
[true, true, 'uget', 'uGet', '/usr/bin/uget-gtk', '%OpenURI', 'moz-icon://stock/uget-icon?size=menu'],
[false, true, 'thunderbird', 'Thunderbird', '/usr/bin/thunderbird', '-compose "to=%OpenURI"', 'moz-icon://stock/thunderbird?size=menu'],
[true, true, 'youtube-dl', 'youtube-dl', '/usr/bin/konsole', '--hold --workdir ~/Загрузки/ -e "youtube-dl %OpenURI"', 'moz-icon://stock/youtube-dl?size=menu'], // если не KDE то konsole заменить на др. терминал и параметры соответственно.
];
var arrayMacos = [ // for MacOS
[true, true, 'fde', 'Firefox Developer Edition', '/usr/bin/open', '-n -a "Firefox Developer Edition" --args %OpenURI', 'moz-icon://file:///Applications/Firefox\ Developer\ Edition.app?size=16'],
[true, true, 'mpv', 'MPV', '/usr/bin/open', '-n -a mpv --args %OpenURI', 'moz-icon://file:///Applications/mpv.app?size=16'],
[true, true, 'youtube-dl', 'youtube-dl', '/usr/bin/osascript', `-e "tell app %quotTerminal%quot to activate" -e "tell app %quotTerminal%quot to do script %quotcd ~/Downloads/ && youtube-dl '%OpenURI'%quot"`, 'moz-icon://file:///System/Applications/Utilities/Terminal.app?size=16'],
];
var arrayOS, platform = AppConstants.platform, length;
if (platform == "win")
arrayOS = arrayWindows;
else if (platform == "linux")
arrayOS = arrayLinux;
else if (platform == "macosx")
arrayOS = arrayMacos;
else
return;
if (!(length = arrayOS.length))
return;
var addEventListener = this.addEventListener.bind(this);
var popup = document.querySelector("#contentAreaContextMenu");
var create = evt => {
if (evt.target != popup || gContextMenu.webExtBrowserType === "popup") return;
popup.removeEventListener("popupshowing", create);
var seppage = popup.querySelector("#popupwindow_ettoolong-menuitem-8") || popup.querySelector("#context-sep-selectall")// || popup.firstElementChild;
var seplink = popup.querySelector("#context-sep-open") || popup.querySelector("#context-sep-copylink")// || popup.firstElementChild;
var fragpage = document.createDocumentFragment(), fraglink = document.createDocumentFragment(), _prelabpage = "", _prelablink = "";
if (length == 1)
submenu = false;
if (!submenu) {
if (prelabpage)
_prelabpage = "Открыть страницу в ";
if (prelablink)
_prelablink = "Открыть ссылку в ";
}
arrayOS.forEach(item => {
var id = item[2], name = item[3], path = item[4], arg = !item[5] ? "" : item[5];
if (!id || !name || !path) return;
var iconpath = !item[6] ? (`moz-icon://file://${path}?size=16`) : item[6];
if (item[0]) {
let menuitem_0 = document.createXULElement("menuitem");
menuitem_0.id = `open-current-page-with-${id}`;
menuitem_0.className = "menuitem-iconic open-current-page-with-application";
menuitem_0.setAttribute("label", `${_prelabpage}${name}`);
menuitem_0.applicationpath = path;
menuitem_0.applicationarg = arg;
if (attrimage)
menuitem_0.setAttribute("image", iconpath);
fragpage.append(menuitem_0);
addEventListener(menuitem_0, "command", function page(event) {
try {
var target = event.currentTarget, arg = target.applicationarg, file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
file.initWithPath(target.applicationpath);
if (!file.exists() || !file.isExecutable()) return;
arg = (arg !== "") ? arg.split(/\s+(?=(?:[^"]*"[^"]*")*[^"]*$)/g).map(sp => {
if (/%OpenURI/g.test(sp)) {
let uri = gBrowser.selectedBrowser.currentURI.displaySpec;
try {
let _uri = ReaderMode.getOriginalUrl(uri);
if (_uri)
uri = Services.io.newURI(_uri).displaySpec;
} catch(e) {}
try {
uri = decodeURIComponent(uri);
} catch(e) {}
return sp.replace(/^"|"$/g, "").replace(/%quot/g, '"').replace(/%OpenURI/g, uri);
}
return sp.replace(/^"|"$/g, "").replace(/%quot/g, '"');
}) : [];
var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
process.init(file);
process.runwAsync(arg, arg.length);
} catch(e) {}
});
}
if (item[1]) {
let menuitem_1 = document.createXULElement("menuitem");
menuitem_1.id = `open-link-with-${id}`;
menuitem_1.className = "menuitem-iconic open-link-with-application";
menuitem_1.setAttribute("label", `${_prelablink}${name}`);
menuitem_1.applicationpath = path;
menuitem_1.applicationarg = arg;
if (attrimage)
menuitem_1.setAttribute("image", iconpath);
fraglink.append(menuitem_1);
addEventListener(menuitem_1, "command", function link(event) {
try {
var target = event.currentTarget, arg = target.applicationarg, file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
file.initWithPath(target.applicationpath);
if (!file.exists() || !file.isExecutable() || !window.gContextMenu?.linkURI?.displaySpec) return;
arg = (arg !== "") ? arg.split(/\s+(?=(?:[^"]*"[^"]*")*[^"]*$)/g).map(sp => {
if (/%OpenURI/g.test(sp)) {
let uri = gContextMenu.linkURI.displaySpec;
try {
let _uri = ReaderMode.getOriginalUrl(uri);
if (_uri)
uri = Services.io.newURI(_uri).displaySpec;
} catch(e) {}
try {
uri = decodeURIComponent(uri);
} catch(e) {}
return sp.replace(/^"|"$/g, "").replace(/%quot/g, '"').replace(/%OpenURI/g, uri);
}
return sp.replace(/^"|"$/g, "").replace(/%quot/g, '"');
}) : [];
var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
process.init(file);
process.runwAsync(arg, arg.length);
} catch(e) {}
});
}
});
that.unloadlisteners.push("contextmenuopenwith");
var funcpopupshowing, funcpopuphiding;
if (!submenu) {
seppage.after(fragpage);
seplink.before(fraglink);
funcpopupshowing = () => {
var link = gContextMenu.onLink || gContextMenu.onMailtoLink;
for(let arr of this._eventlisteners) {
if (arr[2].name === "page")
// Исходно
//arr[0].hidden = link;
// др. селекторы - gContextMenu(.onImage, .onCanvas, .onVideo, .onAudio)
arr[0].hidden = link || gContextMenu.onTextInput || gContextMenu.isContentSelected;
else if (arr[2].name === "link")
arr[0].hidden = !link || gContextMenu.onTextInput;
}
};
funcpopuphiding = () => {
for(let arr of this._eventlisteners) {
if (arr[1] === "command")
arr[0].hidden = true;
}
};
} else {
if (fragpage.children.length) {
let menu = this.menupage = document.createXULElement("menu");
menu.id = "open-current-page-with-submenu";
menu.className = "menu-iconic open-current-page-with-application";
menu.setAttribute("label", "Открыть страницу в ...");
let menupopup = document.createXULElement("menupopup");
menupopup.append(fragpage);
menu.append(menupopup);
seppage.after(menu);
}
if (fraglink.children.length) {
let menu = this.menulink = document.createXULElement("menu");
menu.id = "open-link-with-submenu";
menu.className = "menu-iconic open-link-with-application";
menu.setAttribute("label", "Открыть ссылку в ...");
let menupopup = document.createXULElement("menupopup");
menupopup.append(fraglink);
menu.append(menupopup);
seplink.before(menu);
}
funcpopupshowing = () => {
var link = gContextMenu.onLink || gContextMenu.onMailtoLink;
// Здесь дублировать скрытие для контекстов
this.menupage.hidden = link || gContextMenu.onTextInput || gContextMenu.isContentSelected;
this.menulink.hidden = !link || gContextMenu.onTextInput;
};
funcpopuphiding = () => {
this.menupage.hidden = true;
this.menulink.hidden = true;
};
}
funcpopupshowing();
addEventListener(popup, "popupshowing", e => {
if (e.target != popup || gContextMenu.webExtBrowserType === "popup") return;
funcpopupshowing();
});
addEventListener(popup, "popuphiding", e => {
if (e.target != popup) return;
funcpopuphiding();
});
};
popup.addEventListener("popupshowing", create);
},
addEventListener(...arr) {
var elm = arr[0];
if (!elm)
return;
elm.addEventListener(...arr.slice(1));
this._eventlisteners.push(arr);
},
destructor() {
for(let arr of this._eventlisteners)
arr.shift().removeEventListener(...arr);
delete this._eventlisteners;
}
The problem is the following, any time I open your program, with parameters passed through the command line, the program opens without picking up my settings (dark theme, opens in light theme, language - opens in English) and does not accept parameters like -a -u [HREF]. I'm not a programmer, can you understand the problem and advise something?
Not only are the command line parameters of interest here, but also why does it open without picking up the settings?