SaveMyExams Note Limit Bypass

Removes the daily note limit on SaveMyExams by resetting SME.revision-note-views on each update, even after multiple navigations

// ==UserScript==
// @name         SaveMyExams Note Limit Bypass
// @namespace    yanNotDev
// @version      1.0.0
// @description  Removes the daily note limit on SaveMyExams by resetting SME.revision-note-views on each update, even after multiple navigations
// @author       yanNotDev
// @match        https://www.savemyexams.com/*
// @icon         https://files.catbox.moe/0xj4a0.png
// @grant        none
// @run-at       document-start
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    const key = 'SME.revision-note-views';
    const defaultValue = [];

    localStorage.setItem(key, JSON.stringify(defaultValue));

    const originalSetItem = localStorage.setItem;
    localStorage.setItem = function(k, value) {
        if (k === key) {
            return originalSetItem.call(this, k, JSON.stringify(defaultValue));
        }
        return originalSetItem.apply(this, arguments);
    };

    setInterval(() => {
        const current = localStorage.getItem(key);
        if (current !== JSON.stringify(defaultValue)) {
            localStorage.setItem(key, JSON.stringify(defaultValue));
        }
    }, 1000);
})();