Last active
December 3, 2021 07:20
-
-
Save sinsinpub/d97171c9c8e2eceffa1e7d6e36e59a24 to your computer and use it in GitHub Desktop.
Try to dismiss twitter shitty notification of 'Push Notification' for 10 years. Run in devtools console for once, or load into devtools -> source -> snippets tab for future use.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var conn = indexedDB.open('localforage').onsuccess = (ev) => { | |
const db = ev.target.result; | |
const ts = db.transaction(['keyvaluepairs'], 'readwrite'); | |
const os = ts.objectStore('keyvaluepairs'); | |
const key = 'device:rweb.devicesbrowserPushpromptDismissed'; | |
const req = os.get(key); | |
const printData = (e) => { console.info(e.target.result); }; | |
req.onsuccess = (reqe) => { | |
printData(reqe); | |
const data = reqe.target.result; | |
data._lastPersisted = Date.now() + 10*365*24*60*60*1000; | |
data.dismissed = true; | |
os.put(data, key).onsuccess = printData; | |
console.info(data); | |
} | |
req.onerror = console.error; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment