hydrogen-web/src
Eric Eastwood 0935f2d23a Only try to use window.crypto.subtle in secure contexts to avoid it throwing and stopping all JavaScript
Relevant error if you crypto is used in a non-secure context like a local LAN IP `http://192.168.1.151:3050/`
```
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'deriveBits')
	at new Crypto
	at new Platform
	at mountHydrogen
```

For my use-case with https://github.com/matrix-org/matrix-public-archive, I don't need crypto/encryption at all.

Docs:

 - https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
 - https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle
    - "Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers."

---

Related to https://github.com/vector-im/hydrogen-web/issues/579
2022-02-25 01:59:48 -06:00
..
domain use private topic field as public one got removed as not needed in view 2022-02-11 09:37:56 +01:00
fixtures/matrix/invites add Invite class 2021-04-20 16:21:27 +02:00
logging fix ts errors 2022-02-10 16:44:40 +01:00
matrix dont log summary valued, as they can contain PII 2022-02-11 18:39:37 +01:00
mocks use withReply 2022-01-14 18:15:26 +05:30
observable WIP3 2022-02-04 17:49:10 +01:00
platform Only try to use window.crypto.subtle in secure contexts to avoid it throwing and stopping all JavaScript 2022-02-25 01:59:48 -06:00
utils add support for progress notifications in abortable operation 2022-01-26 15:18:23 +01:00
index.html include path/vite in sdk bundle 2021-12-22 16:31:19 +01:00
lib.ts Add required exports 2022-02-04 18:28:17 +05:30