https://github.com/ethersphere/swarm-url-rewriter
With the swarm-url-rewrite JS snippet you can rewrite bzz:// urls to http:// url using a gateway.
https://github.com/ethersphere/swarm-url-rewriter
Last synced: 19 days ago
JSON representation
With the swarm-url-rewrite JS snippet you can rewrite bzz:// urls to http:// url using a gateway.
- Host: GitHub
- URL: https://github.com/ethersphere/swarm-url-rewriter
- Owner: ethersphere
- Created: 2017-12-18T12:55:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-19T15:26:53.000Z (over 8 years ago)
- Last Synced: 2025-04-08T18:50:41.099Z (about 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# swarm-url-rewriter
Ethereum Swarm uses `bzz://` urls, which are not supported by the browsers out there.
However, it is still recommended to use `bzz://` links to Swarm pages. To make these `bzz://` links work in the current browser environment, you can use this small JS snippet to rewrite the links in the page to domain relative path links (`/bzz:/`), which will work well if the actual page is accessed through a swarm gateway.
Because the script rewrites the urls only when the user clicks on them, it works well with complex dynamic web apps and not just with static htmls.
**Limitation**: The script only rewrites html anchor hrefs, so buttons or other components which navigate away on mouse clicks are not affected.