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

Wishlist: window.ipfs.location #602

Closed
da2x opened this issue Oct 4, 2018 · 1 comment
Closed

Wishlist: window.ipfs.location #602

da2x opened this issue Oct 4, 2018 · 1 comment
Labels
area/window-ipfs Issues related to IPFS API exposed on every page kind/enhancement A net-new feature or improvement to an existing feature status/deferred Conscious decision to pause or backlog

Comments

@da2x
Copy link

da2x commented Oct 4, 2018

So I'm a web extension developer, and I want a JavaScript accessible equivalent of the X-Ipfs-LocationHTTP response header. While extensions can read this header, it requires a lot of extra work to parse this header compared to reading the location of a normal web accessible resource (window.document.location.)

No permission should be required to read data from this object as it's just there to encourage developers not to try and parse and make wild guesses from the document.location.

Object: window.ipfs.location

  • window.ipfs.location.nurl, containing the IPFS NURL of the resource in window.document
  • window.ipfs.location.public_http_gateway, a version of the nurl prefixed with a public gateway.

This is useful for extensions that work with web services that need a web accessible way to access the resource (like the public HTTP gateway). E.g. extensions that save bookmarks to a web service, or share links to a social networks, or otherwise expects a normal URL.

Edit: Example of what an extension would have to do to make a best guess at what a public gateway address would look like for a resource on IPFS:
https://github.com/da2x/instapaper-webextension/blob/87df338a7af6ae303c17a1e37ea5ec9ed721b755/scripts/inject.js#L106-L131

@lidel lidel added the area/window-ipfs Issues related to IPFS API exposed on every page label Oct 4, 2018
@lidel lidel added this to the window.ipfs 2.0 milestone Oct 4, 2018
@lidel lidel added kind/enhancement A net-new feature or improvement to an existing feature status/deferred Conscious decision to pause or backlog labels Oct 4, 2018
@lidel
Copy link
Member

lidel commented Oct 19, 2020

Closing due to #589 (comment)
Also, we are avoid injecting properties that could be used for fingerprinting users.

@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 kind/enhancement A net-new feature or improvement to an existing feature status/deferred Conscious decision to pause or backlog
Projects
None yet
Development

No branches or pull requests

2 participants