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

💡 [REQUEST] - Implement a check on function availability #73

Closed
soofstad opened this issue Mar 20, 2023 · 0 comments · Fixed by #80
Closed

💡 [REQUEST] - Implement a check on function availability #73

soofstad opened this issue Mar 20, 2023 · 0 comments · Fixed by #80
Labels
question Further information is requested

Comments

@soofstad
Copy link
Owner

Summary

It would be nice to users of the package, if there where some checks on the availability of some of the functions that could be unavailable.
This check could print some more verbose error message that would help in debugging.

Basic Example

Instead of getting;

TypeError: Cannot read properties of undefined (reading 'digest')

when calling window.crypto.subtle.digest('SHA-256', bytes).
We could print Error: The context/environment is not secure, and does not support the 'crypto.subtle' module. See: https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle for details

I believe there could be more examples like this:

  • TextEncoder?

Drawbacks

None

Unresolved questions

No response

Implementation PR

No response

Reference Issues

#72

@soofstad soofstad added the question Further information is requested label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant