Using a combination of the manifest file and WebUSB APIs, we can search for and detect connected USB devices inside of a container application.
Follow the instructions below to get up and running.
- Install dependencies and do the initial build. Note that these examples assume you are in the sub-directory for the example.
npm run setup
- Build the project.
npm run build
- Start the test server in a new window.
npm run start
- Start the Platform application.
npm run client
- An Platform Window with a button that leads you to documentation around WebUSB API usage, along with another button that should detect a plugged in device and display it in a list below.
This is an example of how to use OpenFin APIs to configure OpenFin Container. Its purpose is to provide an example and suggestions. DO NOT assume that it contains production-ready code. Please use this as a guide and provide feedback. Thanks!
There are 3 things you should know when trying to detect and use USB devices (Printers, etc..) alongside your Container:
- Make sure to add the necessary permissions to the manifest file, specifically, the WebAPI and Devices sections.
- Use best practices with the API by reading more here.
- If you have any additional questions, please email Here.io Support.