Sha256: 68fb31efd48d32b87dd5944e452a9ae997d409596aab74a2114bc45816942f16

Contents?: true

Size: 879 Bytes

Versions: 19

Compression:

Stored size: 879 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

19 entries across 19 versions & 3 rubygems

Version Path
webamm_to_rails-7.0.1 lib/webamm_to_rails/rails_boilerplate/templates/app/views/pwa/service-worker.js.erb
webamm_to_rails-7.0.0 lib/webamm_to_rails/rails_boilerplate/templates/app/views/pwa/service-worker.js.erb
ruby2html-1.5.3 app/views/pwa/service-worker.js
ruby2html-1.5.2 app/views/pwa/service-worker.js
ruby2html-1.5.1 app/views/pwa/service-worker.js
ruby2html-1.5.0 app/views/pwa/service-worker.js
ruby2html-1.4.0 app/views/pwa/service-worker.js
ruby2html-1.3.3 app/views/pwa/service-worker.js
railties-7.2.0 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
ruby2html-1.3.2 app/views/pwa/service-worker.js
ruby2html-1.3.1 app/views/pwa/service-worker.js
ruby2html-1.3.0 app/views/pwa/service-worker.js
ruby2html-1.2.0 app/views/pwa/service-worker.js
ruby2html-1.1.0 app/views/pwa/service-worker.js
ruby2html-1.0.0 app/views/pwa/service-worker.js
railties-7.2.0.rc1 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
railties-7.2.0.beta3 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
railties-7.2.0.beta2 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
railties-7.2.0.beta1 lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js