Hi there, I’m trying to create a private addon for Firefox ESR and add a context menu and launch either a batch file or an executable application when selecting text.
I’ve added the relevant registry keys to, they point to the manifest.json
HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\NativeMessagingHosts
I’m not certain if I’ve picked the right location for the registry entries. The code is incomplete and I’m hoping to learn if I’ve picked the right location for the registry keys and how to launch an app or batch file via the javascript file.
background.js
browser.contextMenus.create({
id: "launchBatch",
title: "Launch Batch File",
contexts: ["all"]
});
browser.contextMenus.onClicked.addListener((info, tab) => {
if (info.menuItemId === "launchBatch") {
//browser.runtime.sendNativeMessage does not seem to work and just returns errors
}
});
My attempts to run any batch files or executable have failed. I’m not sure what format the manifest.json file should be in either since i periodically see warnings in Firefox when installing the addon. I’m using windows 10.
Here is the error I get in the debugger when I right click on the context menu leading me to believe I have not added the registry key in the correct place. The predicament is extra confusing since I have remnants of old Firefox versions in my registry.
Error communicating with native application: Error: No such native application launchBatch
My registry