Skip to content

Instantly share code, notes, and snippets.

@cafuego
Created August 17, 2018 08:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cafuego/87ef7bcb31e3648a13e0b9eef30184f9 to your computer and use it in GitHub Desktop.
Save cafuego/87ef7bcb31e3648a13e0b9eef30184f9 to your computer and use it in GitHub Desktop.
PWA module 404 fix
diff --git a/pwa.module b/pwa.module
index a87172b..fe22fe9 100644
--- a/pwa.module
+++ b/pwa.module
@@ -27,7 +27,7 @@ function pwa_permission() {
function pwa_menu() {
$items = [];
- $items['pwa/serviceworker.js'] = [
+ $items['pwa/serviceworker/js'] = [
'page callback' => 'pwa_serviceworker_file_data',
'access arguments' => ['access pwa'],
'delivery callback' => 'pwa_deliver_js_file',
@@ -98,7 +98,7 @@ function pwa_library() {
$path . '/js/serviceworker-load.js' => ['scope' => 'footer'],
0 => [
'data' => ['pwa' => [
- 'path' => url('/pwa/serviceworker.js'),
+ 'path' => url('/pwa/serviceworker/js'),
'registrationEvent' => variable_get('pwa_sw_registration_event', PWA_SW_REGISTRATION_EVENT_DEFAULT),
]],
'type' => 'setting',
@@ -293,7 +293,7 @@ function pwa_preprocess_html(&$variables) {
// Load the Service Worker
drupal_add_library('pwa', 'serviceworker');
- drupal_add_js(['pwa' => ['path' => url('pwa/serviceworker.js')]], 'setting');
+ drupal_add_js(['pwa' => ['path' => url('pwa/serviceworker/js')]], 'setting');
}
/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment