您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Github按文件更新日期排序...
// ==UserScript== // @name Github按文件更新日期排序 // @namespace https://github.com/androidcn/ // @version 1.1 // @description Github按文件更新日期排序... // @author @Androidcn // @match https://github.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=github.com // @grant none // ==/UserScript== (function() { 'use strict'; function createButton() { // Create a button element const button = document.createElement('button'); button.textContent = '排序'; button.style.position = 'fixed'; button.style.top = '60px'; button.style.right = '20px'; button.style.zIndex = '9999'; // Append the button to the body document.body.appendChild(button); // Add click event listener to the button button.addEventListener('click', performSortedAction); } function performSortedAction() { var files = document.querySelector('[aria-labelledby="folders-and-files"] tbody'); var children = [...files.children]; files.replaceChildren( children[0],...[...files.querySelectorAll('.react-directory-row')].sort((a, b) => new Date(a.querySelector('relative-time').datetime) < new Date(b.querySelector('relative-time').datetime) ? 1 : -1),children.at(-1), ); console.log('已按文件更新日期排序'); } // Wait for the page to load window.addEventListener('load', createButton); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址