serviceworker-helpers | Vaadin

Display a toast on available service worker update

[ This description is mirrored from at on 2019-05-22 ]

Polymer 2 components to work with Service Workers

Published on Build Status


Register service worker

Since its more or less a one-liner to register your service worker and included in most boilerplates there is no specific element.

  if ('serviceWorker' in navigator) {
    window.addEventListener('load', function() {


Displays a toast requesting the user to reload the page when a source code update is available.

The update message can be overwriten by setting message (optional). The display time can be changed by setting duration, defaults to 0 / persistend.

<link rel="import" href="serviceworker-helpers/sw-update-toast.html">

  message="My message"

Change the link color by setting the css var --primary-color.


# Get dependencies
$ npm install

# Demo site
$ npm start

# Run tests
$ npm test


Link to this version
ImportedReleased 20 October 2017MIT License
Framework Support
Polymer 2.0+
Browser Compatibility
Install with
bower install --save morbidick/serviceworker-helpers"#2.0.6"
Run the above Bower command in your project folder. If you have any issues installing, please contact the author.
Release notes - Version 2.0.6


  • polymer#Polymer/polymer#^2.0.0
  • paper-toast#PolymerElements/paper-toast#^2.0.0