Twitter to Nitter Redirector

Redirect Twitter to Nitter, a free and open source alternative

  1. // ==UserScript==
  2. // @name Twitter to Nitter Redirector
  3. // @namespace https://github.com/shmup/redirect-userscripts
  4. // @version 1.3
  5. // @description Redirect Twitter to Nitter, a free and open source alternative
  6. // @author shmup
  7. // @match https://www.twitter.com/*
  8. // @match https://twitter.com/*
  9. // @match https://mobile.twitter.com/*
  10. // @match https://x.com/*
  11. // @grant none
  12. // @run-at document-start
  13. // @license Unlicense
  14. // ==/UserScript==
  15.  
  16. /**
  17. * Nitter is a free and open source alternative Twitter front-end focused on privacy and performance.
  18. *
  19. * https://nitter.net/about
  20. * https://github.com/zedeus/nitter
  21. **/
  22.  
  23. // NOTE - you may need to udpate the instance:
  24. // https://github.com/zedeus/nitter/wiki/Instances#public
  25.  
  26. const nitterInstance = "xcancel.com";
  27.  
  28. (function() {
  29. 'use strict';
  30. const newURL = new URL(window.location.href);
  31. newURL.hostname = nitterInstance;
  32. window.location.replace(newURL.toString());
  33. })();