You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this same issue recently when developing an extension with IPFS in the backend. CORS will not allow the http api to talk to the desktop daemon. I fixed this in my extension by changing the source of the request, but this involved capturing the request before it was sent. Anyone found a workaround?
The text was updated successfully, but these errors were encountered:
API is very powerful and you don't want random websites to manage your node. Regular browser context respects CORS, so you need to explicitly safelist Origins that are allowed to talk to the API via Access-Control-Allow-Origin header:
If you run JS in a browser extension, then just like you said, one can override Origin via webRequest API because browser extensions are privileged contexts. Regular browser context does not have that API, so CORS is the only way to make it work.
Future
We want to make local IPFS node useful for websites without giving full access to the API (meta issue: ipfs/in-web-browsers#158), but that requires figuring out more flexible access controls for the API (ipfs/kubo#1532), or creating something else, tailored specifically for use on the web.
I ran into this same issue recently when developing an extension with IPFS in the backend. CORS will not allow the http api to talk to the desktop daemon. I fixed this in my extension by changing the source of the request, but this involved capturing the request before it was sent. Anyone found a workaround?
The text was updated successfully, but these errors were encountered: