I'm bundling a Chrome extension along with a software.
During the installation I'm creating a User ID and writing it in the registry.
I want my extension to "know" this value too, Can I do it without NPAPI plugin?
1 Answers
If you have a web-site for your product, you can do the following. During installation submit new UserID
to your site (in addition to writing it into the Registry), then open in Chrome a specific page on your site, which should contain the same UserID
in parameters. Your extansion can read outgoing requests, so it can parse out the UserID
. Next it should check response from your server, which must compare UserID
value obtained from the browser and the one obtained earlier from your installation. This will prevent UserID
spoofing.
Also, though I'm not sure you'll not consider next suggestion as an overkill (so NPAPI plugin looks like acceptable solution as well), but here is how I made a binding between a Chrome extension and external program (for some much more sophisticated purposes than just reading the Registry).
You can build a minimal local web-server (or websockets server) processing requests on a dedicated port, provide it with registration information (UserID
, etc), and then request required data from the extension just by means of ordinary http-request (for example, AJAX, or websockets client).
The methods have a drawback related to the need to setup user's firewall, so it would allow traffic either from your installer, or from local web-server.