serviceworker-helpers

WebJar for serviceworker-helpers

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.bowergithub.morbidick
Идентификатор

Идентификатор

serviceworker-helpers
Последняя версия

Последняя версия

2.0.6
Дата

Дата

Тип

Тип

jar
Описание

Описание

serviceworker-helpers
WebJar for serviceworker-helpers
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/morbidick/serviceworker-helpers

Скачать serviceworker-helpers

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.bowergithub.morbidick/serviceworker-helpers/ -->
<dependency>
    <groupId>org.webjars.bowergithub.morbidick</groupId>
    <artifactId>serviceworker-helpers</artifactId>
    <version>2.0.6</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bowergithub.morbidick/serviceworker-helpers/
implementation 'org.webjars.bowergithub.morbidick:serviceworker-helpers:2.0.6'
// https://jarcasting.com/artifacts/org.webjars.bowergithub.morbidick/serviceworker-helpers/
implementation ("org.webjars.bowergithub.morbidick:serviceworker-helpers:2.0.6")
'org.webjars.bowergithub.morbidick:serviceworker-helpers:jar:2.0.6'
<dependency org="org.webjars.bowergithub.morbidick" name="serviceworker-helpers" rev="2.0.6">
  <artifact name="serviceworker-helpers" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bowergithub.morbidick', module='serviceworker-helpers', version='2.0.6')
)
libraryDependencies += "org.webjars.bowergithub.morbidick" % "serviceworker-helpers" % "2.0.6"
[org.webjars.bowergithub.morbidick/serviceworker-helpers "2.0.6"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.bowergithub.polymer : polymer jar [2.0.0,3)
org.webjars.bowergithub.polymerelements : paper-toast jar [2.0.0,3)

Модули Проекта

Данный проект не имеет модулей.

Polymer 2 components to work with Service Workers

Published on webcomponents.org Build Status

HowTo

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.

<script>
  if ('serviceWorker' in navigator) {
    window.addEventListener('load', function() {
      navigator.serviceWorker.register('/service-worker.js');
    });
  }
</script>

<sw-update-toast>

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">

<sw-update-toast
  message="My message"
  duration="5"
></sw-update-toast>

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

Development

# Get dependencies
$ npm install

# Demo site
$ npm start

# Run tests
$ npm test

Версии библиотеки

Версия
2.0.6