Redirect userstyles.org to uso.kkx.one (UserStyles.org Archive)

Makes userstyles.org actually usable

当前为 2022-09-16 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Redirect userstyles.org to uso.kkx.one (UserStyles.org Archive)
  3. // @namespace https://greasyfork.org/users/124677-pabli
  4. // @version 0.1
  5. // @description Makes userstyles.org actually usable
  6. // @author Pabli
  7. // @license MIT
  8. // @match http*://userstyles.org/*
  9. // @match http*://uso.kkx.one/*
  10. // @run-at document-start
  11. // @icon https://www.google.com/s2/favicons?sz=64&domain=https://uso.kkx.one
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. if (window.location.hostname == 'userstyles.org') {
  19.  
  20. let path = window.location.pathname.split('/')
  21. let uso = 'https://uso.kkx.one/'
  22.  
  23. if (path[3] == 'newest-styles') {location.href = uso + 'browse/styles?sort=created'}
  24. else if (path[3] == 'recently-updated') {location.href = uso + 'browse/styles?sort=updated'}
  25. else if (path[3] == 'editors-choice') {location.href = uso + 'browse/styles?sort=rating'}
  26. else if (path[2] == 'browse' && path[3] == undefined) {location.href = uso + 'browse/styles'}
  27. else if (path[2] == 'browse') {location.href = uso + 'browse/styles?search=%23' + path[3]}
  28. else if (path[1] == 'users') {location.href = uso + 'browse/styles?search=%40' + path[2]}
  29. else if (path[1] == 'categories') {location.href = uso + 'browse/categories'}
  30. else if (path[1] == 'styles') {location.href = uso + 'style/' + path[2]}
  31. else {location.href = uso}
  32.  
  33. }
  34.  
  35. })();