Skip to content

Instantly share code, notes, and snippets.

@delapuente
Created January 25, 2016 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delapuente/043a3ec708db3bf86d80 to your computer and use it in GitHub Desktop.
Save delapuente/043a3ec708db3bf86d80 to your computer and use it in GitHub Desktop.
WordPress proposal for a collaborative method for writing service workers
// Plugin 1:
sw_add_to_service_worker('/path/to/scope', function () {
// contents for the service worker...
});
// Plugin 2:
sw_add_to_service_worker('/path/to/scope', function () {
// contents for the service worker...
});
// Each service worker is identified by the scope to be registered
// but for reusing, the API could be extended to allow alias and
// a customizable map scope => service worker.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment