Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Write JS snippet which rewrites bzz:// urls to gateway urls #174

Closed
gbalint opened this issue Dec 15, 2017 · 10 comments
Closed

Write JS snippet which rewrites bzz:// urls to gateway urls #174

gbalint opened this issue Dec 15, 2017 · 10 comments
Assignees

Comments

@gbalint
Copy link

gbalint commented Dec 15, 2017

We would like to provide a small JS script which can be added to webpages to rewrite bzz:// links to http://current.gateway/bzz:/ links, so the page can work for users who don't run swarm nodes or any other special swarm software.

See the details here: https://gist.github.com/gbalint/9e43a97a781b482731f1542ff683cf35

@gbalint gbalint self-assigned this Dec 15, 2017
@gbalint
Copy link
Author

gbalint commented Dec 18, 2017

@cobordism
Copy link

Why do we need to include "swarm-gateways.net" in the javascript file?

Can we not automatically use whichever host we are on? i.e. if a user is browsing at localhost:8500 then the script will replace bzz:// with http://localhost:8500/bzz:/ and if a user is browsing on swarm-gateways.net then the script will use that?.. and so on.

@lmars
Copy link

lmars commented Dec 18, 2017

Or, just replace bzz://... with /bzz:/...?

@cobordism
Copy link

yeah, that might work too. Indeed I think it's simpler, yet functionally equivalent.

@gbalint
Copy link
Author

gbalint commented Dec 19, 2017

Ok, please check this: ethersphere/swarm-url-rewriter@d369f66

@cobordism
Copy link

So we should add this JS sippet to all our swarm pages, yes?

@gbalint
Copy link
Author

gbalint commented Jan 9, 2018

See #192 for the error templates. As I see there are no other gateway urls in the swarm codebase. As next step I'm checking the swam homepage

@gbalint gbalint reopened this Jan 9, 2018
@gbalint
Copy link
Author

gbalint commented Jan 9, 2018

I realized that there are only relative urls in the swarm homepage, so no need to update that.
@homotopycolimit Do you think there is anything else I should update?

@cobordism
Copy link

let me see... there is the swarm homepage, there is fabio's dapp overview (swarmapps.eth), and then there are the dapps - but they don't contain bzz:// URLs ...

@gbalint gbalint closed this as completed Apr 27, 2018
@gbalint
Copy link
Author

gbalint commented Apr 27, 2018

Too hacky solution, conflicts with the js of the dapps

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants