Browse Source

Rename service worker script to avoid being blocked by uBlock

tags/2.0.24
Frédéric Guillot 1 month ago
parent
commit
75b11d5744
6 changed files with 10 additions and 10 deletions
  1. +2
    -2
      generate.go
  2. +2
    -2
      template/common.go
  3. +1
    -1
      template/html/common/layout.html
  4. +4
    -4
      ui/static/js.go
  5. +0
    -0
      ui/static/js/service_worker.js
  6. +1
    -1
      ui/view/view.go

+ 2
- 2
generate.go View File

@@ -194,8 +194,8 @@ func main() {
"ui/static/js/app.js",
"ui/static/js/bootstrap.js",
},
"sw": []string{
"ui/static/js/sw.js",
"service-worker": []string{
"ui/static/js/service_worker.js",
},
}, map[string]string{
"app": "(function(){'use strict';",


+ 2
- 2
template/common.go View File

@@ -351,7 +351,7 @@ SOFTWARE.
{{ end }}{{ end }}

<script type="text/javascript" src="{{ route "javascript" "name" "app" }}?{{ .app_js_checksum }}" defer></script>
<script type="text/javascript" src="{{ route "javascript" "name" "sw" }}?{{ .sw_js_checksum }}" defer id="service-worker-script"></script>
<script type="text/javascript" src="{{ route "javascript" "name" "service-worker" }}?{{ .sw_js_checksum }}" defer id="service-worker-script"></script>
</head>
<body
data-entries-status-url="{{ route "updateEntriesStatus" }}"
@@ -523,7 +523,7 @@ var templateCommonMapChecksums = map[string]string{
"feed_menu": "318d8662dda5ca9dfc75b909c8461e79c86fb5082df1428f67aaf856f19f4b50",
"icons": "3dbe754a98f524a227111191d76b8c6944711b13613cc548ee9e9808fe0bffb4",
"item_meta": "8306adf3ef9966de3e3dc74ca1042e51d778b027ab8cf0a60a2e94a0115982dc",
"layout": "91d2ab3f683a2ced5e9ce5cd04919e74b3e3f329a5eedcc60015b8d49ecb1b77",
"layout": "e44dd40d22aec224b9f3d29391e21d4c066f8ecebbd3678a9b4832d014fffe65",
"pagination": "7b61288e86283c4cf0dc83bcbf8bf1c00c7cb29e60201c8c0b633b2450d2911f",
"settings_menu": "e2b777630c0efdbc529800303c01d6744ed3af80ec505ac5a5b3f99c9b989156",
}

+ 1
- 1
template/html/common/layout.html View File

@@ -40,7 +40,7 @@
{{ end }}{{ end }}

<script type="text/javascript" src="{{ route "javascript" "name" "app" }}?{{ .app_js_checksum }}" defer></script>
<script type="text/javascript" src="{{ route "javascript" "name" "sw" }}?{{ .sw_js_checksum }}" defer id="service-worker-script"></script>
<script type="text/javascript" src="{{ route "javascript" "name" "service-worker" }}?{{ .sw_js_checksum }}" defer id="service-worker-script"></script>
</head>
<body
data-entries-status-url="{{ route "updateEntriesStatus" }}"


+ 4
- 4
ui/static/js.go
File diff suppressed because it is too large
View File


ui/static/js/sw.js → ui/static/js/service_worker.js View File


+ 1
- 1
ui/view/view.go View File

@@ -42,6 +42,6 @@ func New(tpl *template.Engine, r *http.Request, sess *session.Session) *View {
b.params["theme"] = theme
b.params["theme_checksum"] = static.StylesheetsChecksums[theme]
b.params["app_js_checksum"] = static.JavascriptsChecksums["app"]
b.params["sw_js_checksum"] = static.JavascriptsChecksums["sw"]
b.params["sw_js_checksum"] = static.JavascriptsChecksums["service-worker"]
return b
}

Loading…
Cancel
Save