Companion error on Chrome: Please use a browser with webcrypto support

I’ve been experimenting with the IPFS Companion plugin as an in-browser alternative to an IPFS-connected REST server.

It’s working great on Firefox, but I’m getting an error on Chrome:

Error: Please use a browser with webcrypto support
    at webCryptoHash (<anonymous>:2632:248)
    at sha2256 (<anonymous>:2632:623)
    at Function.Multihashing.digest (<anonymous>:2642:600)
    at Multihashing (<anonymous>:2642:203)
    at serialize (<anonymous>:2544:709)
    at serialize (<anonymous>:2573:495)
    at Function.create (<anonymous>:2544:657)
    at <anonymous>:2409:557
    at new Promise (<anonymous>)
    at exports.dagNodeFromJson (<anonymous>:2409:477)

Is there a supported shim or polyfill to get around this issue?

Edit: It looks like Chrome blocks access on non-http pages: “Access to the WebCrypto API is restricted to secure origins.” https://www.chromium.org/blink/webcrypto

1 Like

Embedded js-ipfs is experimental, but AFAIK adding / fetching data works fine in Chromium 65.0.*

Are you executing a specific API call to trigger the error?
Which version are you running (Companion and Chrome)?

Steps for how to reproduce would really help :slight_smile:

This occurred while using this extension:

Then running ipfs.object.put()

It looks like I have to be on https:// to make the call. The error Please use a browser with webcrypto support was throwing me.

hi,

maybe you can read that :

and check your actual version of chrome

regards

Thanks! Let’s continue in:

We are leaning towards removing winow.ipfs from insecure contexts.

If you have any pros/cons, feedback or examples of specific use cases that will be impacted by this change, raise them in: