PageSourceSearch

https://carret.in/firebase-messaging-sw.js

js carret.in collected 2026-10-01 23:57:28 UTC 1,486 bytes, 40 lines download raw bytes

1// eslint-disable-next-line no-undef
2importScripts('https://www.gstatic.com/firebasejs/8.8.0/firebase-app.js');
3// eslint-disable-next-line no-undef
4importScripts('https://www.gstatic.com/firebasejs/8.8.0/firebase-messaging.js');
5
6if ('serviceWorker' in navigator) {
7  navigator.serviceWorker
8    .register('/firebase-messaging-sw.js')
9    .then((registration) => {
10      console.log('Service Worker registered with scope:', registration.scope);
11    })
12    .catch((error) => {
13      console.error('Service Worker registration failed:', error);
14    });
15}
16
17const firebaseConfig = {
18  apiKey: 'AIzaSyDH_9KBBPHB_YbZF5pjmtjCwPzTD8boWQk',
19  authDomain: 'carret-cc51f.firebaseapp.com',
20  projectId: 'carret-cc51f',
21  storageBucket: 'carret-cc51f.appspot.com',
22  messagingSenderId: '576751480225',
23  appId: '1:576751480225:web:681cb0f0c9d03cc5132fe0',
24  measurementId: 'G-JW3YL8ZYZJ',
25};
26// eslint-disable-next-line no-undef
27firebase.initializeApp(firebaseConfig);
28// eslint-disable-next-line no-undef
29const messaging = firebase.messaging();
30
31// Handle incoming messages while the app is not in focus (i.e in the background, hidden behind other tabs, or completely closed).
32messaging.onBackgroundMessage(function (payload) {
33  console.log('Received background message ', payload);
34
35  const notificationTitle = payload.notification.title;
36  const notificationOptions = {
37    body: payload.notification.body,
38  };
39  self.registration.showNotification(notificationTitle, notificationOptions);
40});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.