summaryrefslogtreecommitdiff
path: root/qutebrowser/javascript/whatsapp_web_quirk.user.js
blob: 78cec54f89adfba02003f2ca27a4233d92b06792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// ==UserScript==
// @include https://web.whatsapp.com/
// ==/UserScript==

// Quirk for WhatsApp Web, based on:
// https://github.com/jiahaog/nativefier/issues/719#issuecomment-443809630

if (document.body.innerText.replace(/\n/g, ' ').search(
        /whatsapp works with.*to use whatsapp.*update/i) !== -1) {
    navigator.serviceWorker.getRegistration().then(function (r) {
        r.unregister();
        document.location.reload();
    });
}