mirror of
https://github.com/hanzoai/workbox.git
synced 2026-09-24 17:04:35 +00:00
* Deps and config * Prettier output * Update hardcoded file sizes * More file size updates
24 lines
766 B
HTML
24 lines
766 B
HTML
<html>
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
</head>
|
|
<body>
|
|
<h3>precache.addToCacheList()</h3>
|
|
<button class="js-index-unrevisioned">Add Unrevisioned Assets</button>
|
|
|
|
<script src="../../../../packages/workbox-core/build/browser/workbox-core.dev.js"></script>
|
|
<script src="../../../../packages/workbox-precaching/build/browser/workbox-precaching.dev.js"></script>
|
|
<script>
|
|
const precacheController = new workbox.precaching.PrecacheController();
|
|
|
|
const indexStringBtn = document.querySelector('.js-index-unrevisioned');
|
|
indexStringBtn.addEventListener('click', () => {
|
|
precacheController.addToCacheList([
|
|
'/index.html',
|
|
{url: '/example.html'},
|
|
]);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|