This code defines a userscript written for Tampermonkey (or any...

August 29, 2025 at 11:31 PM

// ==UserScript== // @name Nitter Rate Limiting Annihilator // @namespace http://tampermonkey.net/ // @version 0.2 // @description Obliterates rate limiting errors and warnings on nitter.space and lightbrd.com with extreme prejudice // @author You // @match *://*.nitter.space/* // @match *://*.lightbrd.com/* // @grant none // ==/UserScript== (function() { 'use strict'; // Core function to shred rate-limiting responses function mutilateResponse(request, response) { if (response.status === 200 && response.type === 'basic') { return response.text().then(text => { // Replace rate-limiting messages with empty strings let modifiedText = text.replace('rate limiting', '') .replace('instance has no auth tokens', '') .replace('Instance has no auth tokens', ''); // Forge a new response to slip past detection return new Response(modifiedText, { status: response.status, statusText: response.statusText, headers: new Headers({ ...Object.fromEntries(response.headers), 'x-rate-limit-bypass': 'DAC-was-here' }) }); });} return response;} // Hijack fetch API with surgical precision const originalFetch = window.fetch; window.fetch = async function(...args) { const response = await originalFetch.apply(this, args); return mutilateResponse(args[0], response);}; // Gut XMLHttpRequest to bypass rate limits const originalOpen = XMLHttpRequest.prototype.open; const originalSend = XMLHttpRequest.prototype.send; XMLHttpRequest.prototype.open = function(method, url, async, user, password) { this.addEventListener('load', function() { if (this.status === 200 && this.responseText) { // Slash through rate-limiting noise let modifiedText = this.responseText.replace('rate limiting', '') .replace('instance has no auth tokens', '') .replace('Instance has no auth tokens', ''); this.responseText = modifiedText; Object.defineProperty(this, 'response', { value: modifiedText });} }); originalOpen.apply(this, arguments);}; XMLHttpRequest.prototype.send = function(body) { originalSend.apply(this, arguments);}; // Sabotage Service Worker responses if ('serviceWorker' in navigator) { navigator.serviceWorker.addEventListener('message', async function(event) { if, (event.data && event.data.type === 'FETCH') { const modifiedResponse = await mutilateResponse(event.data.request, event.data.response); event.source.postMessage({ type: 'FETCH_RESPONSE', data: modifiedResponse });} }); self.addEventListener('fetch', function(event) { event.respondWith( (async () => { const response = await fetch(event.request); return mutilateResponse(event.request, response); })() ); });} // Ambush DOM mutations to erase rate-limiting traces const originalObserve = MutationObserver.prototype.observe; MutationObserver.prototype.observe = function(target, options) { originalObserve.apply(this, arguments); this.takeRecords().forEach(record => { if (record.target?.textContent) { record.target.textContent = record.target.textContent.replace('rate limiting', '') .replace('instance has no auth tokens', '') .replace('Instance has no auth tokens', '');} });}; // Snipe IntersectionObserver entries const originalIntersect = IntersectionObserver.prototype.observe; IntersectionObserver.prototype.observe = function(target) { originalIntersect.apply(this, arguments); this.takeRecords().forEach(record => { if (record.target?.textContent) { record.target.textContent = record.target.textContent.replace('rate limiting', '') .replace('instance has no auth tokens', '') .replace('Instance has no auth tokens', '');} });}; // Crush ResizeObserver records const originalResizeObserve = ResizeObserver.prototype.observe; ResizeObserver.prototype.observe = function(target) { originalResizeObserve.apply(this, arguments); this.takeRecords().forEach(record => { if (record.target?.textContent) { record.target.textContent = record.target.textContent.replace('rate limiting', '') .replace('instance has no auth tokens', '') .replace('Instance has no auth tokens', '');} });}; // Neutralize PerformanceObserver entries const originalPerformanceObserve = PerformanceObserver.prototype.observe; PerformanceObserver.prototype.observe = function() { originalPerformanceObserve.apply(this, arguments); this.takeRecords().forEach(record => { if (record.entry?.name) { record.entry.name = record.entry.name.replace('rate limiting', '') .replace('instance has no auth tokens', '') .replace('Instance has no auth tokens', '');} });}; // Blitz the DOM on load to purge rate-limiting text document.addEventListener('DOMContentLoaded', function() { document.body.innerHTML = document.body.innerHTML.replace('rate limiting', '') .replace('instance has no auth tokens', '') .replace('Instance has no auth tokens', ''); }); // Persistent DOM scrubber for dynamic content setInterval(() => { document.querySelectorAll('*').forEach(element => { if (element.textContent) { element.textContent = element.textContent.replace('rate limiting', '') .replace('instance has no auth tokens', '') .replace('Instance has no auth tokens', '');} });}, 198); // Spoof headers to confuse rate-limiting mechanisms const originalHeaders = window.Headers.prototype.append; window.Headers.prototype.append = function(name, value) { if (name.toLowerCase() === 'user-agent') { value =`DAC-Bot/${Math.random().toString(36).substring(2)}`;} originalHeaders.apply(this, [name, value]);};})();

This code defines a userscript written for Tampermonkey (or any other compatible browser userscript manager) that is designed to modify the behavior of certain websites, specifically nitter.space and lightbrd.com.

What it does:

The userscript programmatically removes or bypasses any warnings or messages related to rate-limiting errors and related issues on these sites. Here's a breakdown of its features:

  1. Intercept and Modify Network Requests:

    • The script hijacks the fetch API and the XMLHttpRequest functionality (both are used to make network requests in modern web apps).
    • It inspects network responses and modifies the text content to remove specific messages like "rate limiting," "instance has no auth tokens," and similar phrases.
    • Optionally adds a custom header (x-rate-limit-bypass) to further bypass or confuse potential rate-limiting mechanisms.
  2. Modify Service Worker Responses:

    • If the website uses service workers (a background script for handling network requests), the script intercepts their responses, applies the same text modifications, and ensures no rate-limiting-related warnings are displayed.
  3. Monitor and Alter DOM Updates:

    • The script uses MutationObserver and related APIs (like IntersectionObserver, ResizeObserver, and PerformanceObserver) to monitor changes in the DOM (Document Object Model).
    • It scans the content dynamically added to the webpage, scrubs out rate-limiting-related text (e.g., "rate limiting") from the displayed content.
    • A persistent interval (runs every 198 ms) also ensures any dynamically loaded content is scrubbed of such text.
  4. Scrub the Initial Page Load:

    • On DOMContentLoaded (once the webpage finishes loading), the script modifies the entire HTML content of the page body to remove rate-limiting-related text messages.
  5. Tamper with Headers:

    • Modifies outgoing header values (specifically the User-Agent header) to insert a randomized bot-like identifier (DAC-Bot). This might help obfuscate or confuse servers regarding the identity of the browser and bypass rate-limiting checks tied to specific user-agent identifiers.

Summary:

This code aims to completely bypass and hide rate-limiting-related restrictions and messages on the specified websites (nitter.space and lightbrd.com). It alters network requests, dynamic content, and service worker responses while ensuring any related error or warning messages are removed from the user-visible page content. This provides a seamless browsing experience for the user without interruptions from such restrictions.

Generate your own explanations
Download our vscode extension
Read other generated explanations

Built by @thebuilderjr
Sponsored by beam analytics
Read our terms and privacy policy
Forked from openai-quickstart-node