gruhn / vue-qrcode-reader

A set of Vue.js components for detecting and decoding QR codes.
https://gruhn.github.io/vue-qrcode-reader
MIT License
2.1k stars 335 forks source link

Safari iOS debugging due to window.isSecureContext #260

Closed platdesign closed 1 year ago

platdesign commented 3 years ago

Following line prevents debugging on iOS devices in a not secure context with allow media capture on insecure sites-option enabled in debugger:

https://github.com/gruhn/vue-qrcode-reader/blob/35f718f6dd3f1926e25501af80984fdd4d8b7f28/src/misc/camera.js#L74

gruhn commented 3 years ago

Random idea: can you monkey patch it in the console?

window.isSecureContext = true
platdesign commented 3 years ago

@gruhn Exactly what i did to determine if the check (window.isSecureContext !== true) is my problem - before opening the issue. ;)

if (process.env.NODE_ENV === 'development') {
  Object.defineProperty(window, 'isSecureContext', { value: true });
}

BTW: For my case it's not relevant anymore. Added SSL-certs to dev-env for having a secure context.

gruhn commented 3 years ago

Ah ok, so this would be a workaround? I'm not sure what to do about other than just leaving this issue open for other people to find 🤷‍♂️

github-actions[bot] commented 1 year ago

This issue has been marked as stale. If there is no further activity it will be closed.