####About This native messaging host is responsible for writing GPII user tokens generated by the First Discovery Tool to the USB drive. The First Discovery Tool sends messages to this Chrome native messaging host via a Chrome extension, and this host in turn creates two files:
.gpii-user-token.txt
- contains the user's token.first-discovery-preferences.txt
- contains the user's preference set in JSON
This repository is not useful by itself. It should be used with its companion browser extension and a first discovery server:
####Messaging background
See these links for additional information on Chrome's messaging capabilities:
- https://developer.chrome.com/extensions/messaging
- https://developer.chrome.com/extensions/nativeMessaging
####Installation
- Install the Chrome extension (https://github.com/pga03/extension-chrome-windows) and obtain the Chrome extension ID (it can occasionally change when installed in development mode). You will use this extension ID in step 3.
- Download this repository and unzip if necessary.
- Add your Chrome extension id obtained in step 1 to the
allowed_origins
array in thecom.ibm.firstdiscovery.json
file. - Run
install-host.bat
as an administrator.
- Creates a folder at
C:\Program Files (x86)\First-Discovery-Chrome-Extension
- Copies the downloaded contents of this repository to it
- Sets a registry setting so Chrome can find the native messaging host
Note: The install removes any previous versions and registry keys, and can be re-run without first uninstalling.
#####Dependencies
- Python 2.7.x is installed and available on the PATH (https://www.python.org/downloads/windows/)
- This is intended to run on Windows 7
- Chrome
####Uninstall
- Run
C:\Program Files (x86)\First-Discovery-Chrome-Extension\uninstall-host.bat
as an administrator
- Deletes
C:\Program Files (x86)\First-Discovery-Chrome-Extension
- Deletes the registry setting created by the install
####Configuration
#####Logging
Logging is disabled by default. Edit python-host and set isLogging
to True
if desired. Logs
are written to C:\Program Files (x86)\First-Discovery-Chrome-Extension
#####USB Drive Path
This assumes a USB key will be mounted at the E:\ drive
. Edit python-host
and set usbDriveLetter
as needed. You might need to edit this if you have additional disc drives, disks, or network drives
mapped on your machine.
NOTE: If the native host isn't given a valid USB drive, it will revert to using the first available
drive it can find (searching alphabetically starting at D:\
)
#####Registry setting
The registry entry used is located at HKCU\Software\Google\Chrome\NativeMessagingHosts
####Testing
Run python python-host test
to run tests. Output and results will be in the terminal window