forked from trent_larson/crowd-funder-for-time-pwa
fix: add HTTPS requirement check for camera access
- Check for secure context before attempting camera access - Show clear user feedback when HTTPS is required - Prevent confusing permission errors on insecure connections
This commit is contained in:
@@ -41,6 +41,12 @@ export class WebDialogQRScanner implements QRScannerService {
|
||||
}
|
||||
|
||||
async isSupported(): Promise<boolean> {
|
||||
// Check for secure context first
|
||||
if (!window.isSecureContext) {
|
||||
logger.warn("Camera access requires HTTPS (secure context)");
|
||||
return false;
|
||||
}
|
||||
// Then check for camera API support
|
||||
return !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user