Skip to content

Instantly share code, notes, and snippets.

@maanimis
maanimis / extra.ws.conn.js
Last active February 2, 2025 22:04
Creates Extra WebSocket Connections
const originalWebSocket = window.WebSocket;
class MultiWebSocket {
constructor(...args) {
this.args = args;
this.maxConn = 2;
this.extraSockets = [];
this.mainWS = new originalWebSocket(...args);
this.isSending = false;
@maanimis
maanimis / territorial.io.cheat.js
Last active February 2, 2025 22:45
This script will create the grid of iframes on the territorial.io site every time you visit it, based on the MULTIPLIER value!
(function () {
const MULTIPLIER = +prompt("MULTIPLIER", "2");
const URL = "https://territorial.io/";
function createIframes(count) {
let container = document.getElementById("iframeContainer");
if (!container) {
container = document.createElement("div");
container.id = "iframeContainer";
document.body.innerHTML = "";
@maanimis
maanimis / web.archive.helper.userscript.js
Last active February 23, 2025 09:13
This userscript adds options to quickly search or save the current page on the Internet Archive via the browser's userscript menu.
// ==UserScript==
// @name Web Archive Helper
// @namespace http://tampermonkey.net/
// @version 1.6
// @description Add options to search or save pages on web.archive.org and archive.today
// @author maanimis
// @match *://*/*
// @grant GM_registerMenuCommand
// @grant GM_openInTab
// @license MIT
// ==UserScript==
// @name hijack-fetch
// @namespace Violentmonkey Scripts
// @match *://*/*
// @grant none
// @version 1.0
// @author maanimis
// @description 1/26/2025, 1:31:21 PM
// @run-at document-end
// @license MIT
// ==UserScript==
// @name hijack-xhr
// @namespace Violentmonkey Scripts
// @match *://*/*
// @grant none
// @version 1.0
// @author maanimis
// @description 1/26/2025, 1:35:29 PM
// @run-at document-end
// @license MIT
export default {
fetch: async (request) => {
try {
const requestData = await request.json();
const chatMember = requestData?.chat_member;
const oldStatus = chatMember?.old_chat_member?.status;
const newStatus = chatMember?.new_chat_member?.status;
if (oldStatus === "member" && newStatus === "left") {
@maanimis
maanimis / enable-copy-telegram.js
Last active February 23, 2025 09:14
Enable copying text on Telegram Web
// ==UserScript==
// @name enable-copy-telegram
// @namespace Violentmonkey Scripts
// @match https://web.telegram.org/*
// @grant none
// @version 1.0
// @run-at document-end
// @author maanimis
// @description Enable copying text on Telegram Web
// @license MIT
@maanimis
maanimis / reconnecting.ws.territorial.io
Last active February 27, 2025 13:01
Reconnecting WebSocket for territorial.io-Violentmonkey Scripts
// ==UserScript==
// @name Reconnecting WebSocket-territorial.io
// @namespace Violentmonkey Scripts
// @match https://territorial.io/*
// @grant none
// @version 3.2
// @description Reconnecting WebSocket for territorial.io with improved stability.
// @run-at document-start
// ==/UserScript==
const TOKEN = "TOKEN";
const WEBHOOK_PATH = "/channelListener";
const SECRET = "YOUR_BOT_SECRET";
const CHANNEL_NUMBER_ID = -11111111111111111;
const CHANNEL_USERNAME = "@USERNAME";
addEventListener("fetch", (event) => {
const url = new URL(event.request.url);
const routeHandlers = {
@maanimis
maanimis / chatgpt-rtl-toggle.js
Last active February 25, 2025 07:50
enabling RTL (Right-To-Left) text direction toggle
// ==UserScript==
// @name chatgpt-rtl-toggle
// @namespace Violentmonkey Scripts
// @match https://chatgpt.com/*/*
// @grant none
// @version 1.0
// @author -
// @description enabling RTL (Right-To-Left) text direction toggle
// @run-at document-end
// @license MIT