Greasy Fork镜像 Total Installs

Show total installs

目前为 2017-09-09 提交的版本。查看 最新版本

// ==UserScript==
// @name        Greasy Fork镜像 Total Installs
// @version     0.1.1
// @description Show total installs
// @license     MIT
// @author      Rob Garrison
// @namespace   https://github.com/Mottie
// @include     https://gf.qytechs.cn/*
// @run-at      document-idle
// @grant       none
// @icon        https://gf.qytechs.cn/assets/blacklogo16-bc64b9f7afdc9be4cbfa58bdd5fc2e5c098ad4bca3ad513a27b15602083fd5bc.png
// ==/UserScript==
(function() {
  "use strict";

  const wrapper = document.querySelector("#browse-script-list, #user-script-list");
  if (wrapper) {
    const els = [...wrapper.querySelectorAll("dd.script-list-total-installs")];
    const total = els.reduce((acc, el) => acc + parseFloat(el.textContent.replace(/[^\d]/g, "")), 0);
    if (total) {
      const span = document.createElement("span");
      let target = document.querySelector('#script-list-sort .list-option:nth-child(2)');
      span.textContent = ` (${(total).toLocaleString()})`;
      if (target.querySelector("a")) {
        target = target.querySelector("a");
      }
      target.appendChild(span);
	}
  }
})();

QingJ © 2025

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