NiklasGollenstede / native-ext

A node.js endpoint for Chrome and Firefox to connect to via Native Messaging
MIT License
56 stars 3 forks source link

Is this project something I can build my own extension around, or do my users need to install Native-Ext? #8

Open Nantris opened 6 years ago

Nantris commented 6 years ago

Do my users need to install the NativeExt extension from the Chrome/Firefox stores? https://chrome.google.com/webstore/detail/nativeext/kfabpijabfmojngneeaipepnbnlpkgcf

NiklasGollenstede commented 6 years ago

Yes, I updated the README to detail that:

The NativeExt project is [...] split up in three parts:

  • the application itself, which is basically just the node.js runtime, some messaging code and the functionality to write configurations
  • a browser management extension which guides through the installation of the application, has the UI for the configuration by the user and initiates updates of the application
  • library components that can be included in other extensions to gain access through the management extension and to manage application processes afterwards

You'd include and use the library and prompt the user to install the management extension (which you linked above). Please have a look at the included example or reStyle for a complete extension.

Nantris commented 6 years ago

@NiklasGollenstede thanks very much for the clarification!

This project seems really cool, but in my case I'm already hesitant about my plan to require users to install both and app and a browser extension. Asking them to install NativeExt to and allow it access is definitely more than I think most people can be expected to do.

In most use cases, users will need to install a minimum of three items, unless they already have NativeExt, unless I'm misunderstanding.

I was hoping this was more of a standalone wrapper to make using NativeMessaging more workable. The current implementation is still very cool, but I'm afraid users wouldn't stand for the amount of installs they need to make in my case.

Is there any way to/any interest in making it possible for users to build their own extensions will h NativeExt capabilities?

NiklasGollenstede commented 6 years ago

require users to install both and app and a browser extension. Asking them to install NativeExt to and allow it access is definitely more than I think most people can be expected to do.

I do share that concern, but NaitveExt is "native messaging as a service" (maybe I should use that slogan) and as such, I see no way to avoid the extension (it needs UI and browser profile specific settings).

That said, you could use the library module to manage your own process. Only the index.js file contains code that is specific to native-ext (communication with the extension), the remaining files deal with the process directly. It also shouldn't be too much work to modify the application to install itself under different name and statically allow your extension. Booth could be made configurable by env vars. The biggest problem I see would be updating the node.js runtime and its libraries.. You would need to build new binaries yourself and download + install them somehow. The code for that is currently part of the extension component.

If you want to do that, I'd accept a PR (which would make it easier for you to receive updates in the future) and give you some hints, but I am not motivated to do it myself.