Update xcancel-culture.js

Added redirect for `x.com/home` to the appropriate place on `xcancel.com`
This commit is contained in:
Jason Cosper 2024-10-19 09:36:40 -07:00 committed by GitHub
parent 0874c6bc60
commit 3cf65f526a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,6 +10,12 @@
// ==/UserScript== // ==/UserScript==
window.addEventListener('load', function() { window.addEventListener('load', function() {
// Redirect /home to xcancel.com directly
if (window.location.pathname === '/home') {
window.location.href = 'https://xcancel.com';
return;
}
// Redirect to xcancel.com with the current path and query params // Redirect to xcancel.com with the current path and query params
var xcancelURL = window.location.href.replace(/https:\/\/([^.]+\.)?x\.com/, 'https://xcancel.com'); var xcancelURL = window.location.href.replace(/https:\/\/([^.]+\.)?x\.com/, 'https://xcancel.com');
window.location.href = xcancelURL; window.location.href = xcancelURL;