catdad / canvas-confetti

🎉 performant confetti animation in the browser
https://catdad.github.io/canvas-confetti/
ISC License
10.2k stars 358 forks source link

Calling shapeFromText throws an error if OffscreenCanvas is not supported #219

Closed pavle-goloskokovic closed 9 months ago

pavle-goloskokovic commented 9 months ago

Calling shapeFromText throws an error if OffscreenCanvas is not supported. Observed on iPhone 6.

Is it possible to check if OffscreenCanvas is supported, and in case it is not use regular canvas element as fallback to generate bitmap data? Or at least fail gracefully so that this error does not break the app.

Thanks!

catdad commented 9 months ago

I understand what you are asking and why you are asking it. However, iOS 12 and Safari 12 are very old. For a single-developer free and open source project, asking to support such old browsers is extremely cumbersome. It is a lot of work, prohibits adding many new features, and will affect next to no users while placing huge burden on the developer. I simply don't have that kind of time.

And I know, you might think "what if I contribute that in a PR, it sounds simple"... do understand that that still leaves me to continue supporting a very outdated browser afterwards. (It's also worth mentioning that ImageBitmap was added in Safari 15, so the feature would never be able to be implemented anyway.)

I will not be working on this, and neither should anyone else.

pavle-goloskokovic commented 9 months ago

Makes sense, thanks for considering.

Hunternif commented 1 month ago

Hi! Just wanted to flag that I ran into this issue on iPad OS 15.4.1 as well. Implemented the check for OffscreenCanvas in my app as suggested here: https://stackoverflow.com/questions/56884685/check-support-for-offscreen-canvas