I'm not a professional programmer, but I was well aware that browsers do not interact with client's hardware, like serial ports, USB or local file system, so I was stunned to find out that Chrome now has APIs that brake that barrier: https://web.dev/fugu-status/ .
It needs Chrome 89 or newer. Aparently it also works with Edge, but not with Firefox, Opera or Safari .
I made a simple test to locate a connected serial port and it really works :
Code: Select all
Procedure ButtonHandler()
Debug "Button click event on gadget #" + EventGadget()
!navigator.serial.requestPort()
EndProcedure
OpenWindow(0, 100, 100, 200, 50, "Click test", #PB_Window_SystemMenu)
ButtonGadget(0, 10, 10, 180, 30, "Click me")
BindGadgetEvent(0, @ButtonHandler())
I apologize if all this is yesterday's news, but, like I said, I'm not a programmer and I was really surprised.
Edit#1: - Forgot to mention that you have to create an app and open it with Chrome, of course. Spiderbasic's browser does not have those APIs.
// Moved to "Tricks 'n' Tips" (Peter)