Skip to content

nftstorage/nftstorage-service-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nftstorage-service-worker

A service worker to fetch content from IPFS via nftstorage.link or a fallback gateway if it ever gets blocked.

nftstorage.link is a fast IPFS gateway. Sometimes the entire domain gets completely blocked by Google Safe Browsing, which leaves sites that link to it unable to get their content. This service worker fixes that by trying to fetch the content via nftstorage.link first, and if there is an error, fetching from alternate IPFS gateways instead. FAST & ROBUST!

Getting started

  • Copy nftstorage-sw.js into the root of your static website project.
  • Register the service worker from a script tag or your main js bundle.
if ('serviceWorker' in navigator) {
  navigator.serviceWorker.register('nftstorage-sw.js');
}

Use with Webpack

For using nftstorage-service-worker on your project bundle with webpack, look into webpack example.

References

About

***Notice: This repository is no longer maintained.***

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published