猫点饭 NAT 检测次数限制破解 - mao.fan/mynat

绕过 mao.fan/mynat 的 check_limit 检测,但仍需登录

// ==UserScript==
// @name         猫点饭 NAT 检测次数限制破解 - mao.fan/mynat
// @version      1.0
// @description  绕过 mao.fan/mynat 的 check_limit 检测,但仍需登录
// @author       Nameless
// @match        https://mao.fan/mynat*
// @grant        unsafeWindow
// @grant        GM_xmlhttpRequest
// @run-at       document-start
// @license MIT
// @namespace https://greasyfork.org/users/1442595
// ==/UserScript==

(function() {
    'use strict';
    const originalFetch = unsafeWindow.fetch;
    unsafeWindow.fetch = function(url, options) {
        if (typeof url === 'string' && url.includes('/check_limit')) {
            return Promise.resolve({
                ok: true,
                text: () => Promise.resolve(JSON.stringify({
                    allowed: true
                })),
                json: () => Promise.resolve({
                    allowed: true
                }),
            });
        }
        return originalFetch.apply(this, arguments);
    };
})();