[Windows specific] Updating registry key from a WebExtension when this one is downloaded from Internet

Hi,

Maybe this is a silly question, but I submit it though just to be clear.

Is it possible to update the Windows registry from a WebExtension (i mean from a background script) ?

I would like my background.js to create the HKCU\software\Mozilla\NativeMessagingHosts<app_native_name> key
and set the default value to JSON app path

Then launch the native app …

The problem may occur when the webextension is downloaded from a web site …

If there is no needed key in registry, I am pretty sure the webextension won’t work at all.

Thanks for your pointers.

Regards.

Maybe this is a silly answer (I haven’t studied for native messaging), why does not modify it from the native app?

Hi,

Thanks to reply.

the pity is that the key mentioned in my post is actually used to launch
our native app.

It is a prerequisite for launching native apps.

To conclude, I think the only way is to build an installer that will do the job :

  • installing the native app
  • setting the registry key linked to that app

Regards

Yes, I think the prerequisite for native messaging is that the user manually executes the installer.