Greasy Fork is available in English.

Antifandom redirect

Fandom sucks. Here's a script to automatically redirect from fandom.com to antifandom.com.

  1. // ==UserScript==
  2. // @name Antifandom redirect
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Fandom sucks. Here's a script to automatically redirect from fandom.com to antifandom.com.
  6. // @author ctsp
  7. // @match *://*.fandom.com/*
  8. // @icon https://www.fandom.com/f2/assets/favicons/favicon-32x32.png
  9. // @grant none
  10. // @run-at document-start
  11. // @license MIT
  12. // ==/UserScript==
  13. var oldHref = document.location.href;
  14. if (window.location.href.indexOf('.fandom.com/') > -1 && !window.location.href.includes('www')) {
  15. window.location.replace(window.location.toString().replace('.fandom.com/', '.antifandom.com/'));
  16. }
  17. window.onload = function() {
  18. var bodyList = document.querySelector("body")
  19. var observer = new MutationObserver(function(mutations) {
  20. mutations.forEach(function(mutation) {
  21. if (oldHref != document.location.href) {
  22. oldHref = document.location.href;
  23. if (window.location.href.indexOf('.fandom.com/') > -1 && !window.location.href.includes('www')) {
  24. window.location.replace(window.location.toString().replace('.fandom.com/', '.antifandom.com/'));
  25. }
  26. }
  27. });
  28. });
  29. var config = {
  30. childList: true,
  31. subtree: true
  32. };
  33. observer.observe(bodyList, config);
  34. };