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

"window.ipfs" from service worker #676

Closed
hazae41 opened this issue Feb 6, 2019 · 2 comments
Closed

"window.ipfs" from service worker #676

hazae41 opened this issue Feb 6, 2019 · 2 comments
Labels
area/window-ipfs Issues related to IPFS API exposed on every page status/deferred Conscious decision to pause or backlog

Comments

@hazae41
Copy link

hazae41 commented Feb 6, 2019

Hello,

Is there a way to access window.ipfs from a service worker?
I tried with self.ipfs and it returns undefined

Thanks!

@lidel
Copy link
Member

lidel commented Feb 6, 2019

Unfortunately no. AFAIK WebExtensions are unable to inject content scripts into Service Worker context, that is why there is no self.ipfs.

You may look into using ipfs-postmsg-proxy to for proxying window.ipfs from the main page back to service worker, but YMMV.

FYI there is ongoing research on "Universal IPFS API Provider" and ways we can expose API coming from js-ipfs, HTTP API or proxy created by IPFS Companion.

Places to follow:

Other refs:

@lidel lidel added area/window-ipfs Issues related to IPFS API exposed on every page status/deferred Conscious decision to pause or backlog labels Feb 6, 2019
@lidel
Copy link
Member

lidel commented Oct 19, 2020

Closing due to #589 (comment)

@lidel lidel closed this as completed Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/window-ipfs Issues related to IPFS API exposed on every page status/deferred Conscious decision to pause or backlog
Projects
None yet
Development

No branches or pull requests

2 participants