Skip to content

Commit

Permalink
Fix #26
Browse files Browse the repository at this point in the history
  • Loading branch information
vshymanskyy committed Aug 20, 2024
1 parent ef64046 commit f4705ed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ async function prepareNewPort(type) {
toastr.error('WebBluetooth is not available on iOS')
return
}
if (window.location.protocol === 'http:') {
if (!window.isSecureContext) {
toastr.error('WebBluetooth cannot be accessed with unsecure connection')
return
}
if (typeof navigator.bluetooth === 'undefined') {
toastr.error('Chrome browser is needed (or Edge, Opera, Chromium, etc.)')
toastr.error('Try Chrome, Edge, Opera, Brave', 'WebBluetooth is not supported')
return
}
new_port = new WebBluetooth()
Expand All @@ -155,12 +155,12 @@ async function prepareNewPort(type) {
toastr.error('WebSerial is not available on iOS')
return
}
if (window.location.protocol === 'http:') {
if (!window.isSecureContext) {
toastr.error('WebSerial cannot be accessed with unsecure connection')
return
}
if (typeof navigator.serial === 'undefined' && typeof navigator.usb === 'undefined') {
toastr.error('Chrome browser is needed (or Edge, Opera, Chromium, etc.)')
toastr.error('Try Chrome, Edge, Opera, Brave', 'WebSerial and WebUSB are not supported')
return
}
if (typeof navigator.serial === 'undefined' || QID('force-serial-poly').checked) {
Expand Down
8 changes: 4 additions & 4 deletions src/benchmark.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ <h2>ViperIDE Benchmark</h2>
toastr.error('WebBluetooth is not available on iOS')
return
}
if (window.location.protocol === 'http:') {
if (!window.isSecureContext) {
toastr.error('WebBluetooth cannot be accessed with unsecure connection')
return
}
if (typeof navigator.bluetooth === 'undefined') {
toastr.error('Chrome browser is needed (or Edge, Opera, Chromium, etc.)')
toastr.error('Try Chrome, Edge, Opera, Brave', 'WebBluetooth is not supported')
return
}
new_port = new WebBluetooth()
Expand All @@ -148,12 +148,12 @@ <h2>ViperIDE Benchmark</h2>
toastr.error('WebSerial is not available on iOS')
return
}
if (window.location.protocol === 'http:') {
if (!window.isSecureContext) {
toastr.error('WebSerial cannot be accessed with unsecure connection')
return
}
if (typeof navigator.serial === 'undefined' && typeof navigator.usb === 'undefined') {
toastr.error('Chrome browser is needed (or Edge, Opera, Chromium, etc.)')
toastr.error('Try Chrome, Edge, Opera, Brave', 'WebSerial and WebUSB are not supported')
return
}
if (typeof navigator.serial === 'undefined') {
Expand Down
8 changes: 4 additions & 4 deletions src/bridge.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ <h2>ViperIDE P2P Bridge</h2>
toastr.error('WebBluetooth is not available on iOS')
return
}
if (window.location.protocol === 'http:') {
if (!window.isSecureContext) {
toastr.error('WebBluetooth cannot be accessed with unsecure connection')
return
}
if (typeof navigator.bluetooth === 'undefined') {
toastr.error('Chrome browser is needed (or Edge, Opera, Chromium, etc.)')
toastr.error('Try Chrome, Edge, Opera, Brave', 'WebBluetooth is not supported')
return
}
new_port = new WebBluetooth()
Expand All @@ -145,12 +145,12 @@ <h2>ViperIDE P2P Bridge</h2>
toastr.error('WebSerial is not available on iOS')
return
}
if (window.location.protocol === 'http:') {
if (!window.isSecureContext) {
toastr.error('WebSerial cannot be accessed with unsecure connection')
return
}
if (typeof navigator.serial === 'undefined' && typeof navigator.usb === 'undefined') {
toastr.error('Chrome browser is needed (or Edge, Opera, Chromium, etc.)')
toastr.error('Try Chrome, Edge, Opera, Brave', 'WebSerial and WebUSB are not supported')
return
}
if (typeof navigator.serial === 'undefined') {
Expand Down

0 comments on commit f4705ed

Please sign in to comment.