PageSourceSearch

https://winonadailynews.com/shared-content/art/tncms/api/messaging662.js

js winonadailynews.com collected 2026-09-24 17:10:01 UTC 2,510 bytes, 2 lines download raw bytes

1window.TNCMS||(window.TNCMS={}),window.TNCMS.Messaging=(()=>{"use strict";let r=null;return{init:t=>{if("serviceWorker"in navigator)r=firebase.initializeApp(t,"tncms-notifier"),navigator.serviceWorker.register("/tncms/messaging/service-worker/").then(o=>{firebase.messaging(r).useServiceWorker(o)}).catch(function(o){throw new Error("Failed to register service worker: "+o)});else throw new Error("Service workers are disabled or not supported")},onMessage:t=>{if(typeof t!="function")throw new Error("Callback provided to onMessage() handler is not a function");firebase.messaging(r).onMessage(function(e){let s={};if(console.log("Broadcast notification received",e),!e.notification)throw new Error("Malformed broadcast notification received - missing notification");if(!e.notification.title)throw new Error("Missing title in notification message");if(s.title=e.notification.title,e.notification.body&&(s.body=e.notification.body),e.notification.icon&&(s.icon=e.notification.icon),!e.data&&!e.data.url)throw new Error("Malformed broadcast notification - missing asset URL");s.url=e.data.url,e.data.asset_id&&(s.asset_id=e.data.asset_id),t(s)})},subscribe:(t="all")=>new Promise((o,e)=>{const s=firebase.messaging(r);Notification.requestPermission().then(()=>{s.getToken().then(i=>{if(i){let a=new Request("/tncms/messaging/subscribe/",{method:"POST",body:JSON.stringify({token:i,topic:t})});fetch(a).then(n=>{let c=n.headers.get("content-type");if(c&&c.includes("application/json"))return n.json();throw new TypeError("Non-JSON response from server received")}).then(n=>{console.log("Subscribe from topic: "+t),o(n)}).catch(n=>{console.log("Subscribe failed: "+n),e(n)})}}).catch(i=>{console.debug("Token retrieval failed: "+i),e(i)})}).catch(i=>{console.debug("Request permission failed: "+i),e(i)})}),unsubscribe:t=>new Promise((o,e)=>{const s=firebase.messaging(r);Notification.requestPermission().then(()=>{s.getToken().then(i=>{if(i){let a=new Request("/tncms/messaging/unsubscribe/",{method:"POST",body:JSON.stringify({token:i,topic:t})});fetch(a).then(n=>{let c=n.headers.get("content-type");if(c&&c.includes("application/json"))return n.json();throw new TypeError("Non-JSON response from server received")}).then(n=>{console.log("Unsubscribe from topic: "+t),o(n)}).catch(n=>{console.warn("Unsubscribe failed: "+n),e(n)})}}).catch(i=>{console.debug("Token retrieval failed: "+i),e(i)})}).catch(i=>{console.debug("Request permission failed: "+i),e(i)})})}})();
2//# sourceMappingURL=messaging662.js.map

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.