Greasy Fork is available in English.

5sing Auto-Redirect

Redirect from old domain *.5sing.com to new domain 5sing.kugou.com/*

  1. // ==UserScript==
  2. // @name 5sing Auto-Redirect
  3. // @namespace xuyiming.open@outlook.com
  4. // @description Redirect from old domain *.5sing.com to new domain 5sing.kugou.com/*
  5. // @author 依然独特
  6. // @version 0.1
  7. // @grant none
  8. // @run-at document-start
  9. // @include *://*.5sing.com/*
  10. // @match *://*.5sing.com/*
  11. // @license BSD 2-Clause License
  12. // ==/UserScript==
  13.  
  14. "use strict";
  15.  
  16. ( function( location ) {
  17. var protocol, hostname, port, pathname, search, hash,
  18. labels = location.hostname.split( "." );
  19. if ( labels.length === 3 ) {
  20. protocol = location.protocol;
  21. hostname = "5sing.kugou.com";
  22. port = location.port;
  23. pathname = "/" + labels[0] + location.pathname;
  24. search = location.search;
  25. hash = location.hash;
  26. location.href = protocol + "//" + hostname + ( port ? ":" + port : "" ) + pathname + search + hash;
  27. }
  28. } )( window.location );