Skip to content

Instantly share code, notes, and snippets.

@sinsinpub
Last active December 3, 2021 07:20
Show Gist options
  • Select an option

  • Save sinsinpub/d97171c9c8e2eceffa1e7d6e36e59a24 to your computer and use it in GitHub Desktop.

Select an option

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.
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