How the browser can remember which port the user selected is a platform-specific issue. For example, on Windows Chromium is able to remember any port the user selects because Windows provides a stable identifier for every device on the system. An identifier like this is not available on Linux and macOS and so only permissions for USB devices with serial numbers can be remembered between sessions.
As I understand it port numbers aren't a reliable way of identifying a device. What I have connected to COM1 on my machine you might have connected to COM3. The site can't know ahead of time where the device is connected. A combination of USB vendor and product IDs (which at least identify a device by its model information) and user knowledge are required to select the right port.
Can you provide an example of how an application could effectively use the port number?
How the browser can remember which port the user selected is a platform-specific issue. For example, on Windows Chromium is able to remember any port the user selects because Windows provides a stable identifier for every device on the system. An identifier like this is not available on Linux and macOS and so only permissions for USB devices with serial numbers can be remembered between sessions.
As I understand it port numbers aren't a reliable way of identifying a device. What I have connected to COM1 on my machine you might have connected to COM3. The site can't know ahead of time where the device is connected. A combination of USB vendor and product IDs (which at least identify a device by its model information) and user knowledge are required to select the right port.
Can you provide an example of how an application could effectively use the port number?