Skip to content
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

Fix compatibility with older browsers in zxing-js #700

Conversation

bilal-elchami
Copy link
Contributor

@bilal-elchami bilal-elchami commented Feb 14, 2023

This PR fixes the described bug in this issue: #188

@all-contributors please add @bilal-elchami for this feature.

Copy link
Owner

@mebjas mebjas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change.

Please resync once more - I had a commit which should remove the minified file generation from npm build.

Alternatively please revert the minified/html5-qrcode.min.js change in this PR.

I'll generate the new one and publish to npm and Github as part of release process.

@mebjas
Copy link
Owner

mebjas commented Mar 3, 2023

Thanks for the change -- merging.

@mebjas mebjas merged commit 0b03d2a into mebjas:master Mar 3, 2023
@JL102
Copy link

JL102 commented Mar 15, 2023

@mebjas This change breaks html5-qrcode in modern browsers. Tested on Vivaldi 5.7.2921.63 (using V8 11.0.226.19) and Firefox 111.0. Built from source on Ubuntu and imported into a Svelte project to test.

image
image

@bilal-elchami
Copy link
Contributor Author

@mebjas This change breaks html5-qrcode in modern browsers. Tested on Vivaldi 5.7.2921.63 (using V8 11.0.226.19) and Firefox 111.0. Built from source on Ubuntu and imported into a Svelte project to test.

image image

@JL102 Sorry to hear this. I will try to find a fix by the end of the day.

mebjas added a commit that referenced this pull request Apr 5, 2023
@mebjas
Copy link
Owner

mebjas commented Apr 5, 2023

I am reverting this by another PR for now (#738)

@bilal-elchami if you have a non breaking change later - please send another PR.

mebjas added a commit that referenced this pull request Apr 5, 2023
@mebjas
Copy link
Owner

mebjas commented Apr 5, 2023

@JL102 thanks for sharing the issue.

@JL102
Copy link

JL102 commented Apr 13, 2023

@mebjas np. Try this instead:

const g = (typeof globalThis !== 'undefined') ? globalThis :
    (typeof global !== 'undefined') ? global :
    (typeof self !== 'undefined') ? self :
    (typeof window !== 'undefined') ? window : {};
var __awaiter = g.__awaiter || function ( .....

The typeof operator allows non declared variables.

@khata-anshul
Copy link

khata-anshul commented Jun 21, 2023

Can we get these changes merged please - #700 (comment)

v2.3.8 is still throwing globalThis is not defined error

@axylophon
Copy link

axylophon commented Jun 29, 2023

This would be really nice as we are currently blocked with anything below Android 10...

I have added the changes suggested from @JL102 and created the PR #794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants