pendo324 / EssentialNowPlaying

A now playing tool intended to be used with OBS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Companion extension support

ZatsuneNoMokou opened this issue · comments

Web Extensions are (partially but still) now supported in Firefox, including the messaging api you use, so is it possible that you publish it on Mozilla? (or at least a Firefox signed version around)

I just checked out some documentation on MDN and I think all that needs to be done is fixing the incompatibilities described on that MDN page:

Support for native messaging in WebExtensions is mostly compatible with Chrome, with two main differences:

The app manifest lists "allowed_extensions" as an array of app IDs, while Chrome lists "allowed_origins", as an array of "chrome-extension" URLs.
The app manifest is stored in a different location, compared to Chrome.

Both of these issues can be addressed in the Initializer class located in this file. First, initRegistry has to be modified to work for both Chrome and Mozilla. That's a simple as adding the registry path that Mozilla expects, for example: HKEY_CURRENT_USER\SOFTWARE\Mozilla\NativeMessagingHosts\com.flyinglawnmower.obsnp.

Also, addManifest will need to be refactored to addChromeManifest and addMozillaManifest. addMozillaManifest will have allowed_extensions instead of allowed_origins.

After those changes, the NativeMessagingInterface should be compatible with Firefox.

I might do these myself, but I'll have to resolve #41 first, as it is pretty urgent. If anyone wants to implement this, I'd be glad to help/review pull requests.