Skip to content

Instantly share code, notes, and snippets.

@deanhume
Last active August 19, 2016 15:01
Show Gist options
  • Save deanhume/f9d63b75e33ada5d3ca1694579354cc2 to your computer and use it in GitHub Desktop.
Save deanhume/f9d63b75e33ada5d3ca1694579354cc2 to your computer and use it in GitHub Desktop.
Register image beast
(global => {
'use strict';
importScripts('./imagebeast.min.js');
optimize({ useWebp: false, useXr: true, useSaveData: true, useCache: true });
// Ensure that our service worker takes control of the page as soon as possible.
global.addEventListener('install', event => event.waitUntil(global.skipWaiting()));
global.addEventListener('activate', event => event.waitUntil(global.clients.claim()));
})(self);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment