We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48ccb39 commit d9bddcbCopy full SHA for d9bddcb
src/BootstrapBlazor/wwwroot/modules/serial.js
@@ -8,11 +8,13 @@ export async function init(id) {
8
export async function getPort(id) {
9
let ret = false;
10
try {
11
- const serialPort = await navigator.serial.requestPort();
12
- close(id);
13
- const data = Data.get(id);
14
- data.serialPort = serialPort;
15
- ret = true;
+ if (navigator.serial) {
+ close(id);
+ const serialPort = await navigator.serial.requestPort();
+ const data = Data.get(id);
+ data.serialPort = serialPort;
16
+ ret = true;
17
+ }
18
}
19
catch (err) {
20
console.error(err);
0 commit comments