Greasyfork Highlight Unupdated Scripts

Greasyfork shows the background of outdated scripts in light red to make it easier to identify these outdated scripts.

Από την 04/06/2025. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name               Greasyfork Highlight Unupdated Scripts
// @name:zh-CN         Greasyfork 未更新脚本高亮
// @description        Greasyfork shows the background of outdated scripts in light red to make it easier to identify these outdated scripts.
// @description:zh-CN  Greasyfork 未更新的脚本背景显示为浅红色,方便识别这些未更新脚本
// @author             AN drew,人民的勤务员 <[email protected]>
// @namespace          https://github.com/ChinaGodMan/UserScripts
// @supportURL         https://github.com/ChinaGodMan/UserScripts/issues
// @homepage           https://github.com/ChinaGodMan/UserScripts
// @homepageURL        https://github.com/ChinaGodMan/UserScripts
// @license            MIT
// @match              https://greasyfork.org/*/users/*
// @match              https://greasyfork.org/*/scripts*
// @icon               https://raw.githubusercontent.com/ChinaGodMan/UserScriptsHistory/main/scriptsIcon/greasyfork-utility-toolkit.svg
// @compatible         chrome
// @compatible         firefox
// @compatible         edge
// @compatible         opera
// @compatible         safari
// @compatible         kiwi
// @compatible         qq
// @compatible         via
// @compatible         brave
// @version            2025.6.4.1
// @grant              GM_setValue
// @grant              GM_getValue
// @grant              GM_registerMenuCommand
// ==/UserScript==

const Days = GM_getValue('days', 30) // 默认30天
const threshold = Days * 24 * 60 * 60 * 1000
GM_registerMenuCommand('Settings', () => {
    const userInput = prompt('Enter the number of days:', Days)
    if (userInput !== null) {
        const parsedInput = parseInt(userInput, 10)
        if (!isNaN(parsedInput) && parsedInput > 0) {
            GM_setValue('days', parsedInput)
        } else {
            alert('Invalid input. Please enter a positive number.')
        }
    }
})
document.querySelectorAll('dd.script-list-updated-date').forEach(function (dd) {
    const relativeTime = dd.querySelector('relative-time')
    if (relativeTime) {
        const time1 = new Date(relativeTime.getAttribute('datetime'))
        const time2 = new Date()
        if (time2.getTime() - time1.getTime() > threshold) {
            relativeTime.style.color = 'red'
            dd.closest('li').style.background = '#ff000008'
        }
    }
})