this post was submitted on 19 Feb 2025
3 points (100.0% liked)

JavaScript

2176 readers
3 users here now

founded 2 years ago
MODERATORS
 

I don't know if anyone here uses [Tamper|Grease]monkey, but I asked my LLM to come up with a redirect from Xitter and it gave me this gem:

// ==UserScript==
// @name         Redirect x.com to xcancel.com
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://x.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var url = window.location.href;
    url = url.replace("https://x.com/", "https://xcancel.com/");
    window.location.replace(url);
})();

Works like a charm.

top 1 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 2 days ago

if you’d like an extension that works with a whole lot of services, there’s also libredirect