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

Support unix-like URI /ipfs/ in address bar #13

Closed
lidel opened this issue Mar 26, 2015 · 7 comments
Closed

Support unix-like URI /ipfs/ in address bar #13

lidel opened this issue Mar 26, 2015 · 7 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature status/blocked Unable to be worked further until needs are met

Comments

@lidel
Copy link
Member

lidel commented Mar 26, 2015

For lazy copy&paste ;-)
It should work the same way as currently exiting ipfs:

@lidel lidel added this to the v1.0.0 milestone Mar 26, 2015
@lidel lidel added kind/enhancement A net-new feature or improvement to an existing feature UX labels Mar 27, 2015
@lidel
Copy link
Member Author

lidel commented Apr 8, 2015

Actually, Firefox redirects /ipfs/<path> to file:///ipfs/<path> by default.
The file path will contain IPFS resources (provided via fuse after ipfs mount).
This feels much better than random hack of protocol handling in addressbar. Nevermind then :-)

@lidel lidel closed this as completed Apr 8, 2015
@lidel
Copy link
Member Author

lidel commented Apr 13, 2015

On the second thought this only works on unix-like systems with arbitrary mount points.

In the light of #16 (comment) add-on should intercept requests to file:///ipfs/* and file:///ipns/*, check if file/directory actually exists, and if it does not (eg. Windows, or fuse not being mounted), redirect to currently active HTTP gateway.

@lidel lidel reopened this Apr 13, 2015
@lidel lidel changed the title Support /ipfs/ in addressbar Support unix-like URI /ipfs/ in address bar Apr 13, 2015
@dylanPowers
Copy link
Member

@lidel I'm not sure how Firefox works but Chrome got very cranky for me when web apps load from a file directory and try to load another file. You may want to check one of the markdown readers to be sure that isn't the case.
Check if this loads for instance /ipfs/QmSrCRJmzE4zE1nAfWPbzVfanKQNBhp7ZWmMnEdbiLvYNh/mdown#/ipfs/QmfQ75DjAxYzxMP2hdm6o4wFwZS5t7uorEZ2pX9AKXEg2u

@lidel
Copy link
Member Author

lidel commented Apr 13, 2015

Yes, I noticed this under Firefox too:

2015-04-13-200414_734x432_scrot

There are multiple issues with file:// and my current plan is to always redirect
file:///ipfs/.. to HTTP gateway (at least for now), as it will solve bulk of issues and give us single 'transport' to focus on in browser add-on.

Running JS from HTTP Gateway may leave us with some CORS limitations (eg. under Firefox when using custom protocol handler), but this will eventually be solved by adding HTTP headers described in ipfs/kubo#934 (comment).

@lidel
Copy link
Member Author

lidel commented Jul 30, 2015

Quick brain dump for my future self: standard addon SDK in Firefox does not provide good hook/event that could be used to replace file:/// requests that end with 404 (file not found, when fuse is not mounted, which is the case on MS Windows when running http gateway on a different machine). I don't want to listen for * events due to potential performance impact.

Replacing protocol handler for file:// seems to be very invasive and from what I've needs to be done before some XUL elements are initialized during browser startup. Not sure if it is possible to do it via Jetpack-based addon.

tl;dr: support for /ipfs/<hash> in Firefox (without fuse-based mountpoint in operating system) will require some additional tinkering with XUL internals, I'll try to work on this in spare time

@lidel
Copy link
Member Author

lidel commented Jul 30, 2015

As for CORS, seems that a fix landed this week: ipfs/kubo#1529

@lidel lidel modified the milestones: v2.0.0, v1.0.0 Sep 9, 2015
@lidel lidel added the status/blocked Unable to be worked further until needs are met label Jan 3, 2016
@lidel lidel removed this from the v2.0.0 milestone Jan 27, 2016
@lidel
Copy link
Member Author

lidel commented Jan 27, 2016

A lot changed since last year and this issue is bit outdated.
Closing as a duplicate, discussion is continued in #48

@lidel lidel closed this as completed Jan 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature status/blocked Unable to be worked further until needs are met
Projects
None yet
Development

No branches or pull requests

2 participants