-
-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility - globalThis preventing use in older browsers #188
Comments
Could you fork the project and make a pull request? |
it seems that this issue concerns the included third party zxing-js |
apparently there is a pollyfill but for sure it's easier to fix the code directly and just avoid old browsers interpreting it since it needs mediaDevices object anyhow which is not working on chrome 49 and firefox under 68 |
ok the best way to avoid globalThis undefined on browser older than chrome 72 and firefox 60 is to change |
The best solution I found is to put on top of the code |
it's coming from https://github.com/mebjas/html5-qrcode/blob/master/third_party/zxing-js.umd.js (fork of Zxing library in this project). I'll try to fix it as you mentioned. |
@mebjas Any update on this? It should be fixed in the zxing-js library: https://github.com/zxing-js/browser/releases/tag/v0.0.6 (issue zxing-js/browser#18! |
Hello @ROBERT-MCDOWELL. Any planned release to fix this issue? |
today it's better to avoid to use zxing-js and use the native browser library. Sinc I switched to it I have no problem anymore. now if you use special barcode supported only by zxing-js so maybe it's worth to update the zxing-js library here too. @mebjas can do it as he's the author. |
Please see my comment in #700 - The changes in this PR break html5-qrcode in modern browsers. (Leaving a note in here since the PR has been closed, meaning my comment may not be seen, while this issue is still open.) |
@JL102 could you try to recreate a PR? |
@ROBERT-MCDOWELL Sorry, didn't see this ping till now. I'm not using html5-qrcode so I'll leave it up to mebjas or someone else to implement my suggestion at #700 (comment) |
Can anyone with this library setup do these changes please - #700 (comment) v2.3.8 is still throwing |
Describe the bug
There is a
globalThis
call in html5-qrcode.min.js. UsingglobalThis
dramatically raises the minimum required browser versions. DoingglobalThis || global || self || window
is not a workaround, because accessing theglobalThis
raises an exception. The proper workaround should be:or even only editing the code to
self || window || global
.More info here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
Describe the browser (tested on):
The text was updated successfully, but these errors were encountered: