-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Worker support #571
Comments
Will devices (for exmaple bluetooth printer, scale and barcode reader) stay connected if:
We would like our website manage this devices without constant reconnection or confirmation from employees. Will that be possible with Web Worker? Look at it as classical EXE aplication managing warehouse operations, but running as website. |
@PavelCibulka same questions for me, I am currently spinning up a dedicated react native app to work around these limitations! |
Using the API from a |
SharedWorker looks good. So after resolving getDevices() issues, best solution will be XMLHttpRequest for now? Where will be data about connected ble devices stored? On the device similar to local storage? If I have multiple tabs opened that use same SharedWorker. Than I use barcode scanner to read EAN. Can SharedWorker identify active tab to send EAN? How this would work? |
You mean some kind of custom data, or just storing the data that it was connected? |
Just data about connection - like device MAC. |
@reillyeon If I have multiple tabs opened that use same SharedWorker. Than I use barcode scanner to read EAN. Can SharedWorker identify active tab to send EAN? How this would work? |
The Shared Worker API doesn't include a way to determine the active tab, but tabs can communicate with the shared worker to indicate which tab the user is currently interacting with. |
Splitting this issue off from #422 because
Worker
(i.e. Dedicated Worker) support in particular is much easier than Service Worker support because there is always aDocument
associated with the worker's Javascript context. This is the model used by the worker support in the Web Serial and WebUSB APIs. Usage of those APIs is "charged" to the document which owns the worker. The only architectural blocker for supporting Web Bluetooth in this type of worker is the still-experimentalgetDevices()
method or support for transferringBluetoothDevice
instances usingpostMessage()
. The former being how Web Serial and WebUSB handle getting access to a device object from a worker.The text was updated successfully, but these errors were encountered: