Sha256: 54bba97f108ac8d65af816aab152cc1860c9d9809641ba845231131db56d59bf

Contents?: true

Size: 876 Bytes

Versions: 14

Compression:

Stored size: 876 Bytes

Contents

// Add a service worker for processing Web Push notifications:
//
// self.addEventListener("push", async (event) => {
//   const { title, options } = await event.data.json()
//   event.waitUntil(self.registration.showNotification(title, options))
// })
//
// self.addEventListener("notificationclick", function(event) {
//   event.notification.close()
//   event.waitUntil(
//     clients.matchAll({ type: "window" }).then((clientList) => {
//       for (let i = 0; i < clientList.length; i++) {
//         let client = clientList[i]
//         let clientPath = (new URL(client.url)).pathname
//
//         if (clientPath == event.notification.data.path && "focus" in client) {
//           return client.focus()
//         }
//       }
//
//       if (clients.openWindow) {
//         return clients.openWindow(event.notification.data.path)
//       }
//     })
//   )
// })

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
railties-8.0.0 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
railties-7.2.2 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
railties-8.0.0.rc2 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
railties-7.2.1.2 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
railties-8.0.0.rc1 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
railties-7.2.1.1 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
rails-uploader-0.5.9 spec/dummy/app/views/pwa/service-worker.js
railties-8.0.0.beta1 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
omg-railties-8.0.0.alpha9 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
omg-railties-8.0.0.alpha8 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
omg-railties-8.0.0.alpha7 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
omg-railties-8.0.0.alpha4 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
omg-railties-8.0.0.alpha3 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
railties-7.2.1 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js