脚本列表排序

脚本列表页显示排名序号, 翻页自动追加序号

  1. // ==UserScript==
  2. // @name Sort Number for Greasy Fork镜像 Scripts
  3. // @name:zh-CN 脚本列表排序
  4. // @name:ja 腳本清單排序
  5. // @description Show order number for Greasy Fork镜像 script list page, for every page
  6. // @description:zh-CN 脚本列表页显示排名序号, 翻页自动追加序号
  7. // @description:ja スクリプトリストページにはランキング番号が表示されます。ページをめくると自動的に番号が追加されます。作品をハイライトします。
  8. // @namespace https://github.com/Germxu
  9. // @homepage https://github.com/Germxu/Scripts-for-TamperMonkey
  10. // @supportURL https://github.com/Germxu/Scripts-for-TamperMonkey/issues/new
  11. // @version 1.3
  12. // @author Finn
  13. // @run-at document-end
  14. // @match https://gf.qytechs.cn/*/scripts*
  15. // @match https://sleazyfork.org/*/scripts*
  16. // @grant none
  17. // ==/UserScript==
  18.  
  19. (function() {
  20. 'use strict';
  21. const page = +new URLSearchParams(document.location.search).get('page')||1;
  22. const q= `<style>#browse-script-list{counter-reset: section ${(page-1)*50};}.ad-entry{height: 0;overflow: hidden;}#browse-script-list li{position:relative}.Finn{background:gold;} .ad-entry{display:none}#browse-script-list li:after{counter-increment: section;content:counter(section);font:bold 20px/30px Arial;color: #29b6f6;position:absolute;bottom:8px;right:15px}</style>`;
  23. document.documentElement.insertAdjacentHTML('afterbegin', q);
  24. const a = document.querySelector(".user-profile-link a").href;
  25. document.querySelectorAll("#browse-script-list li").forEach(function(i){
  26. const b = i.querySelector("dd.script-list-author a");
  27. if( b && b.href===a) { i.className = 'Finn' }
  28. })
  29. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址