@jon49/sw 0.12.13 → 0.12.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,10 +4,8 @@ let refreshing = false
4
4
  // Here we reload the page
5
5
  navigator.serviceWorker.addEventListener('controllerchange', function () {
6
6
  if (refreshing) return
7
- let url = new URL(window.location.href)
8
- url.searchParams.set("refresh", "hard")
9
- window.location.href = url.href
10
7
  refreshing = true
8
+ window.location.reload()
11
9
  })
12
10
 
13
11
  /// Checks if there is a new version of the app available
package/lib/routes.ts CHANGED
@@ -175,13 +175,8 @@ async function executeHandler({ url, req, event }: ExectuteHandlerOptions) : Pro
175
175
  }
176
176
 
177
177
  if (isHtml(result)) {
178
- if (req.referrer.length > 0) {
179
- let referrer = new URL(req.referrer)
180
- if (referrer.pathname.startsWith("/web")
181
- && url.searchParams.get("refresh") !== "hard"
182
- && req.headers.get("HF-Request") !== "true") {
183
- result = html`<template>${result}</template>`
184
- }
178
+ if (req.url.includes("hz")) {
179
+ result = html`<template>${result}</template>`
185
180
  }
186
181
 
187
182
  return streamResponse({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jon49/sw",
3
- "version": "0.12.13",
3
+ "version": "0.12.14",
4
4
  "description": "Packages for MVC service workers.",
5
5
  "type": "module",
6
6
  "files": [