crx4chrome

修改版本历史页面

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

Advertisement:

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

Advertisement:

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         crx4chrome
// @namespace    http://tampermonkey.net/
// @version      2025.5.9
// @description  修改版本历史页面
// @author       AN drew
// @match        https://www.crx4chrome.com/history/*
// @match        https://www.crx4chrome.com/crx/*
// @require      https://lib.baomitu.com/jquery/3.5.0/jquery.min.js
// @grant        GM_addStyle
// ==/UserScript==

function getUTC8(datetime) {
    let month = (datetime.getMonth() + 1) < 10 ? "0" + (datetime.getMonth() + 1) : (datetime.getMonth() + 1);
    let date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
    return (datetime.getFullYear() + "-" + month + "-" + date);
}

 GM_addStyle(`
 /*
label.size{
    background: green;
    color: white;
    padding: 2px 5px;
}
label.value{
    background: #9679a4;
    color: white;
    padding: 2px 5px;
}
*/
`);

(function() {
    'use strict';

    let hide_marker=1;

    if(hide_marker===1)
    {
        GM_addStyle(`ol.history{list-style:none}`);
    }

    $('.history li').each(function(index){
        if(hide_marker===1)
        {
            $(this).find('span').replaceWith(function() {
                if(index==0)
                    return $('<div>', {'class':'title', 'style':'background:#ff00004f'}).prepend('<strong>'+index+'.<strong>\xa0\xa0').append($(this).contents());
                else
                    return $('<div>', {'class':'title'}).prepend('<strong>'+index+'.<strong>\xa0\xa0').append($(this).contents());
            });
        }
        else
        {
            $(this).find('span').replaceWith(function() {
                if(index==0)
                    return $('<div>', {'class':'title', 'style':'background:#ff00004f'}).append($(this).contents());
                else
                    return $('<div>', {'class':'title'}).append($(this).contents());
            });
        }

        /*
        let $Date=$(this).find('.app-desc').eq(0);
        let date_text=$Date.text();
        if(date_text!=undefined)
        {
            date_text=date_text.replace('► Updated: ','');
            let DATE=new Date(date_text);
            let date=getUTC8(DATE);
            $Date.text('► 更新时间: '+date);
        }

        let $Version=$(this).find('.app-desc').eq(1);
        let version_text=$Version.text();
        if(version_text!=undefined && version_text.indexOf('up')>-1)
        {
            version_text=version_text.match(/► Require: Chrome (\S*) an up/)[1];
            $Version.text('► 版本要求: Chrome ≥ '+version_text);
        }
        */
    })

    $('.history li .app-desc').each(function(){
        if(!$(this).hasClass('done'))
        {
            if($(this).text().indexOf('Updated') > -1)
            {
                let date_text=$(this).text();
                date_text=date_text.replace('► Updated: ','');
                let DATE=new Date(date_text);
                let date=getUTC8(DATE);
                $(this).text('► 更新时间: '+date);
            }
            else if($(this).text().indexOf('Require') > -1)
            {
                let version_text=$(this).text();
                version_text=version_text.match(/► Require: Chrome (\S*) an up/)[1];
                $(this).html('► 版本要求: <svg t="1746761449506" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2759" width="14" height="14"><path d="M123.648 178.346667C361.642667-98.602667 802.986667-43.946667 967.936 279.68h-396.501333c-71.424 0-117.546667-1.621333-167.509334 24.661333-58.709333 30.933333-102.997333 88.234667-118.485333 155.52L123.648 178.389333z" fill="#EA4335" p-id="2760"></path><path d="M341.674667 512c0 93.866667 76.330667 170.24 170.154666 170.24 93.866667 0 170.154667-76.373333 170.154667-170.24s-76.330667-170.24-170.154667-170.24c-93.866667 0-170.154667 76.373333-170.154666 170.24z" fill="#4285F4" p-id="2761"></path><path d="M577.877333 734.848c-95.530667 28.373333-207.274667-3.114667-268.501333-108.8-46.762667-80.64-170.24-295.765333-226.346667-393.557333-196.565333 301.226667-27.136 711.808 329.685334 781.866666l165.12-279.509333z" fill="#34A853" p-id="2762"></path><path d="M669.866667 341.76a233.130667 233.130667 0 0 1 43.008 286.634667c-40.576 69.973333-170.154667 288.682667-232.96 394.581333 367.658667 22.656 635.733333-337.664 514.645333-681.258667H669.866667z" fill="#FBBC05" p-id="2763"></path></svg>Chrome ≥ '+version_text);
            }
            else if($(this).text().indexOf('File Size') > -1)
            {
                let size_text=$(this).text();
                let arr=size_text.split(":");
                let type=arr[0].trim();
                let size=arr[1].trim();
                $(this).html('• 文件大小: <label class="size">'+size+'</label>');
            }
            else if($(this).text().indexOf('MD5') > -1)
            {
                let size_text=$(this).text();
                let arr=size_text.split(":");
                let type=arr[0].trim();
                let size=arr[1].trim();
                $(this).html(type+': <label class="value">'+size+'</label>');
            }
            else if($(this).text().indexOf('SHA1') > -1)
            {
                let size_text=$(this).text();
                let arr=size_text.split(":");
                let type=arr[0].trim();
                let size=arr[1].trim();
                $(this).html(type+': <label class="value">'+size+'</label>');
            }
            else if($(this).text().indexOf('SHA256') > -1)
            {
                let size_text=$(this).text();
                let arr=size_text.split(":");
                let type=arr[0].trim();
                let size=arr[1].trim();
                $(this).html(type+': <label class="value">'+size+'</label>');
            }
            $(this).addClass('done')
        }
    })

    if($('.app-title').eq(-1).text().indexOf('More Extensions')>-1)
    {
        $('.app-title').eq(-1).hide();
        $('.app-title').eq(-1).next().hide();
    }

    GM_addStyle(`
    div.title {background: #0084ff4f; padding: 2px 6px;}
    #sidebar{display:none}
    `);

    $('blockquote').eq(0).hide();
    $('blockquote').eq(2).hide();
    $('blockquote').eq(3).hide();

})();