blob: d31b187a83c4c326a8fcafa560c6d053c7a21c22 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// ==UserScript==
// @include https://web.whatsapp.com/
// ==/UserScript==
// Quirk for WhatsApp Web, based on:
// https://github.com/jiahaog/nativefier/issues/719
"use strict";
var id = setInterval(bypass, 50);
function bypass() {
console.log("Checking for 'Update browser' message...");
if (document.querySelector("a[href='https://support.google.com/chrome/answer/95414']")) {
console.log("Bypassing 'Update browser' message...");
navigator.serviceWorker.getRegistration().then((registration) => {
registration.unregister();
document.location.reload();
console.log("'Update browser' message bypassed.");
clearInterval(id);
});
}
}
window.setTimeout(
function() {
console.log("No 'Update browser' message found after 5 seconds.");
clearInterval(id);
}, 5000
);
|