Browse Source

WhatsApp: Disable initial service workers.

This works around #72 in combination with 3cc306e.

Inspired by ramboxapp/community-edition@9c0f13d, but written from
scratch using Promises to avoid blocking pointlessly while Promises
resolve.

Fixes #72.
pull/3202/head
TheGoddessInari 6 years ago
parent
commit
0172bec5c4
No known key found for this signature in database
GPG Key ID: 1209B1B7632D69A
  1. 2
      app/store/ServicesList.js

2
app/store/ServicesList.js

@ -28,7 +28,7 @@ Ext.define('Rambox.store.ServicesList', {
,description: locale['services[0]']
,url: 'https://web.whatsapp.com/'
,type: 'messaging'
,js_unread: `let checkUnread=()=>{const elements=document.querySelectorAll(".CxUIE, .unread");let count=0;for(let i of elements)0===i.querySelectorAll('*[data-icon="muted"]').length&&count++;rambox.updateBadge(count)};setInterval(checkUnread,1e3);`
,js_unread: `let checkUnread=()=>{const elements=document.querySelectorAll(".CxUIE, .unread");let count=0;for(let i of elements)0===i.querySelectorAll('*[data-icon="muted"]').length&&count++;rambox.updateBadge(count)};setInterval(checkUnread,1e3);let unregister_queue=[];navigator.serviceWorker.getRegistrations().then(registrations=>{for(const registration of registrations)unregister_queue.push(registration.unregister());return unregister_queue}).then(queue=>{}).catch(err=>{});`
,userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36'
,slowed_timers: false
},

Loading…
Cancel
Save