您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Resolves the "URI Too Long" error when loading large replays on SlidySim Online and bypasses Google redirect error page
// ==UserScript== // @name SlidySim Online Long Replay Links Fix // @version 1.2.0 // @description Resolves the "URI Too Long" error when loading large replays on SlidySim Online and bypasses Google redirect error page // @author dphdmn // @match https://slidysim.online/* // @match https://www.google.com/url?q=https://slidysim.online/* // @icon https://raw.githubusercontent.com/dphdmn/openslidy/refs/heads/main/images/eggIcon.ico // @license MIT // @namespace dphdmn // ==/UserScript== /* global loadCustomReplay */ (function() { 'use strict'; const ERROR_MESSAGE = 'Error: URI Too Long'; const GOOGLE_ERROR_MESSAGE = 'The page you were on is trying to send you to an invalid URL (https://slidysim'; const STORAGE_KEY = 'slidysim_replay_data'; const REPLAY_URL = 'https://slidysim.online/replay'; const saveReplayData = data => localStorage.setItem(STORAGE_KEY, data); const loadReplayData = () => localStorage.getItem(STORAGE_KEY); const clearReplayData = () => localStorage.removeItem(STORAGE_KEY); const handleSlidySimReplay = () => { if (document.body.textContent.includes(ERROR_MESSAGE)) { saveReplayData(window.location.href); window.location.href = REPLAY_URL; } else if (window.location.pathname === '/replay') { const replayData = loadReplayData(); if (!replayData) return; try { const urlParams = new URL(replayData).searchParams; const replayParam = urlParams.get('r'); if (replayParam) { loadCustomReplay(replayParam); clearReplayData(); } } catch (error) { // Silently ignore invalid URLs } } }; const handleGoogleRedirect = () => { if (document.body.textContent.includes(GOOGLE_ERROR_MESSAGE)) { const match = document.body.textContent.match(/URL \((https:\/\/slidysim[^)]+)\)/); if (match && match[1]) { window.location.href = match[1]; } } }; if (window.location.hostname === 'www.google.com') { handleGoogleRedirect(); } else if (window.location.hostname === 'slidysim.online') { handleSlidySimReplay(); } })();