USO a USMO

Redireccionar Userscripts.org a Userscripts-MIRROR.org

  1. // ==UserScript==
  2. // @name USO to USMO
  3. // @name:es USO a USMO
  4. // @description Redirect Userscripts.org to Userscripts-MIRROR.org
  5. // @description:es Redireccionar Userscripts.org a Userscripts-MIRROR.org
  6. // @namespace https://greatest.deepsurf.us/users/4051
  7. // @author KaZaC
  8. // @include *
  9. // @version 0.42
  10. // @grant none
  11. // @icon http://i.imgur.com/8qJTYUy.png
  12. // @license http://creativecommons.org/licenses/by-nc-sa/3.0/
  13. // ==/UserScript==
  14.  
  15. document.body.addEventListener('click', function(e){
  16. var targ = e.target || e.srcElement;
  17. if ( targ && targ.href && targ.href.match('https?:\/\/userscripts.org\/') ) {
  18. targ.href = targ.href.replace('://userscripts.org/', '://userscripts-mirror.org/');
  19. }
  20. if ( targ && targ.href && targ.href.match('https?:\/\/userscripts.org:8080') ) {
  21. targ.href = targ.href.replace('://userscripts.org:8080', '://userscripts-mirror.org');
  22. }
  23. });