Sort Number for Greasy Fork Scripts

腳本清單頁顯示排名序號,翻頁自動追加序號

当前为 2021-04-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Sort Number for Greasy Fork Scripts
  3. // @name:zh 脚本列表排序
  4. // @name:en Sort Number for Greasy Fork Scripts
  5. // @description 腳本清單頁顯示排名序號,翻頁自動追加序號
  6. // @description;zh 脚本列表页显示排名序号, 翻页自动追加序号
  7. // @description:en Show order number for Greasy Fork script list page, for every page
  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 0.2
  12. // @author Finn
  13. // @run-at document-start
  14. // @match https://greasyfork.org/*/scripts*
  15. //@exclude https://greasyfork.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 -1};}.ad-entry{height: 0;overflow: hidden;}#browse-script-list li{position:relative}
  23. #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>`;
  24. document.documentElement.insertAdjacentHTML('afterbegin', q);
  25.  
  26. //document.querySelector("#browse-script-list").style.counterReset =`section ${(page-1)*50 -1}`
  27. })();