All Projects → GoogleChromeLabs → Sw Toolbox

GoogleChromeLabs / Sw Toolbox

Licence: apache-2.0
A collection of tools for service workers

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Sw Toolbox

Offline Plugin
Offline plugin (ServiceWorker, AppCache) for webpack (https://webpack.js.org/)
Stars: ✭ 4,444 (+21.79%)
Mutual labels:  caching, offline-first, progressive-web-app, service-worker, service-workers
Sw Precache
Service Worker Precache is a module for generating a service worker that precaches resources. It integrates with your build process. Once configured, it detects all your static resources (HTML, JavaScript, CSS, images, etc.) and generates a hash of each file's contents. Information about each file's URL and versioned hash are stored in the generated service worker file, along with logic to serve those files cache-first, and automatically keep those files up to date when changes are detected in subsequent builds.
Stars: ✭ 5,276 (+44.59%)
Mutual labels:  offline-first, progressive-web-app, service-worker, service-workers
Workbox
📦 Workbox: JavaScript libraries for Progressive Web Apps
Stars: ✭ 10,434 (+185.94%)
Mutual labels:  offline-first, progressive-web-app, service-worker, service-workers
Upup
✈️ Easily create sites that work offline as well as online
Stars: ✭ 4,777 (+30.91%)
Mutual labels:  offline-first, progressive-web-app, service-worker
Beer
The source code for the Progressive Beer app!
Stars: ✭ 73 (-98%)
Mutual labels:  offline-first, progressive-web-app, service-worker
Parcel Plugin Sw Cache
📦👷 Parcel plugin for caching using a service worker
Stars: ✭ 45 (-98.77%)
Mutual labels:  offline-first, progressive-web-app, service-worker
jekyll-pwa-workbox
A Jekyll plugin using Workbox to make your PWA / Website available offline.
Stars: ✭ 22 (-99.4%)
Mutual labels:  service-worker, progressive-web-app, offline-first
Notepad
📒 An offline capable Notepad PWA powered by ServiceWorker
Stars: ✭ 100 (-97.26%)
Mutual labels:  offline-first, progressive-web-app, service-worker
Monitaure
🔔 A server uptime monitoring progressive web application - NO LONGER MAINTAINED
Stars: ✭ 135 (-96.3%)
Mutual labels:  offline-first, progressive-web-app, service-worker
Ember Service Worker
A pluggable approach to Service Workers for Ember.js
Stars: ✭ 227 (-93.78%)
Mutual labels:  offline-first, progressive-web-app, service-worker
Jfa Pwa Toolkit
⚡️ PWA Features to Any Website (very Fast & Easy)
Stars: ✭ 245 (-93.29%)
Mutual labels:  offline-first, progressive-web-app, service-worker
affilicats
🐈 Progressive Web App demo that showcases flaky network resilience measures (📶 or 🚫📶).
Stars: ✭ 65 (-98.22%)
Mutual labels:  service-worker, progressive-web-app, offline-first
Android Pwa Wrapper
Android Wrapper to create native Android Apps from offline-capable Progressive Web Apps
Stars: ✭ 265 (-92.74%)
Mutual labels:  offline-first, progressive-web-app, service-worker
Pwa Book Cn
第一本 PWA 中文书
Stars: ✭ 3,498 (-4.14%)
Mutual labels:  progressive-web-app, service-worker
java-pwa
Progressive Web Apps in Java
Stars: ✭ 48 (-98.68%)
Mutual labels:  service-worker, progressive-web-app
Super Progressive Web Apps
SuperPWA helps to convert your WordPress website into Progressive Web Apps instantly. PWA (Progressive Web Apps) demo at : https://superpwa.com and Plugin :
Stars: ✭ 304 (-91.67%)
Mutual labels:  progressive-web-app, service-worker
gatsby-pwa-demo
PWA Example: Progressive Web App E-Commerce with Gatsby.js
Stars: ✭ 68 (-98.14%)
Mutual labels:  service-worker, progressive-web-app
offline-first-sw
Service worker example with 404 handling, custom offline page and max TTL for specific file types.
Stars: ✭ 82 (-97.75%)
Mutual labels:  service-worker, offline-first
exploration-service-worker
Let's get started with ServiceWorker
Stars: ✭ 14 (-99.62%)
Mutual labels:  service-worker, progressive-web-app
purescript-workers
An API wrapper around Web Workers (Dedicated, Shared and Service)
Stars: ✭ 24 (-99.34%)
Mutual labels:  progressive-web-app, service-workers

⚠️ sw-toolbox ⚠️

sw-toolbox and sw-precache are deprecated in favor of Workbox. Please read this migration guide for information on upgrading.

About

A collection of tools for service workers

Service Worker Toolbox provides some simple helpers for use in creating your own service workers. Specifically, it provides common caching strategies for dynamic content, such as API calls, third-party resources, and large or infrequently used local resources that you don't want precached.

Service Worker Toolbox provides an expressive approach to using those strategies for runtime requests. If you're not sure what service workers are or what they are for, start with the explainer doc.

What if I need precaching as well?

Then you should go check out sw-precache before doing anything else. In addition to precaching static resources, sw-precache supports optional runtime caching through a simple, declarative configuration that incorporates Service Worker Toolbox under the hood.

Install

Service Worker Toolbox is available through Bower, npm or direct from GitHub:

bower install --save sw-toolbox

npm install --save sw-toolbox

git clone https://github.com/GoogleChrome/sw-toolbox.git

Register your service worker

From your registering page, register your service worker in the normal way. For example:

navigator.serviceWorker.register('my-service-worker.js');

As implemented in Chrome 40 or later, a service worker must exist at the root of the scope that you intend it to control, or higher. So if you want all of the pages under /myapp/ to be controlled by the worker, the worker script itself must be served from either / or /myapp/. The default scope is the containing path of the service worker script.

For even lower friction, you can instead include the Service Worker Toolbox companion script in your HTML as shown below. Be aware that this is not customizable. If you need to do anything fancier than register with a default scope, you'll need to use the standard registration.

<script src="/path/to/sw-toolbox/companion.js" data-service-worker="my-service-worker.js"></script>

Add Service Worker Toolbox to your service worker script

In your service worker you just need to use importScripts to load Service Worker Toolbox:

importScripts('bower_components/sw-toolbox/sw-toolbox.js');  // Update path to match your own setup.

Use the toolbox

To understand how to use the toolbox read the Usage and API documentation.

License

Copyright 2015-2016 Google, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].