Checks if the browser supports the Web Serial API by verifying the presence
of navigator.serial. This is a non-throwing check that returns false if
the API is not available.
Note: This function only checks for API availability, not whether the browser
type is supported. For a throwing check that provides better error messages,
use checkBrowserSupport.
Returns boolean
true if the Web Serial API is available, false otherwise
Example
if (hasWebSerialSupport()) { // Safe to use serial port functionality constclient = createSerialClient(); } else { console.error('Web Serial API is not supported'); }
Feature detection for Web Serial API.
Checks if the browser supports the Web Serial API by verifying the presence of
navigator.serial. This is a non-throwing check that returnsfalseif the API is not available.Note: This function only checks for API availability, not whether the browser type is supported. For a throwing check that provides better error messages, use checkBrowserSupport.