mirror of
https://github.com/hanzoai/workbox.git
synced 2026-09-24 17:04:35 +00:00
* The contents of v3, reconciled with master. * Remove a few stray files. * Another extra file. * Two more deletions. * Setting up for stable release * v3.0.0 * Updating CDN and versions * Doc repair for wf (#1358) * Changing doc structure to work with WF * Changing doc structure to work with WF
26 lines
823 B
Handlebars
26 lines
823 B
Handlebars
<section>
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-lg-8 mx-auto">
|
|
<ol>
|
|
<li>Open DevTools</li>
|
|
<li>Go to the Console</li>
|
|
<li>Click this button:<br /><button class="install-sw btn btn-outline-primary">Install Service Worker</button></li>
|
|
<li><strong>Refresh the page</strong></li>
|
|
<li>Notice that the image '/demo/workbox-routing/demo-img.png' was routed and is now a party popper</li>
|
|
</ol>
|
|
|
|
<img src="/demo/workbox-routing/demo-img.png" style="width: 300px; height: 300px;"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<script>
|
|
const firstBtn = document.querySelector('.install-sw');
|
|
|
|
firstBtn.addEventListener('click', () => {
|
|
navigator.serviceWorker.register('/demo/workbox-routing/sw.js');
|
|
});
|
|
</script>
|