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

Only initialize Crypto when olm is provided #691

Merged
merged 2 commits into from
Mar 3, 2022

Commits on Feb 25, 2022

  1. Only try to use window.crypto.subtle in secure contexts to avoid it t…

    …hrowing 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 #579
    MadLittleMods committed Feb 25, 2022
    Configuration menu
    Copy the full SHA
    0935f2d View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2022

  1. Configuration menu
    Copy the full SHA
    2f4c639 View commit details
    Browse the repository at this point in the history