Greasy Fork

Greasy Fork is available in English.

pixiv历史记录

p站历史记录白色部分改为跳转链接

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         pixiv历史记录
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  p站历史记录白色部分改为跳转链接
// @author       2222234
// @match        https://www.pixiv.net/history.php
// @icon         https://www.google.com/s2/favicons?sz=64&domain=pixiv.net
// @grant        none
// @license      114514
// ==/UserScript==

(function() {
    function waitElement(callback) {
        var s = document.getElementsByClassName("_history-items")[0];
        if (s.children.length != 0) {
            callback(s);
        } else {
            setTimeout(() => {
                waitElement(callback);
            }, 100);
        }
    }

    waitElement((s) => {
        var length = s.children.length;
        for(var i = 0;i < length ;i++){
            if(s.children[i].nodeName != "SPAN"){
                continue;
            }
            var a = document.createElement('a');
            var url = getComputedStyle(s.children[i], null)['background-image'];
            var param1 = url.split('/')[13];
            var param2 = param1.split('_')[0];
            a.setAttribute('href', '/artworks/'+param2);
            a.setAttribute('target', '_blank');
            a.setAttribute('class', '_history-item show-detail list-item');
            a.setAttribute('rel','noreferrer');
            a.setAttribute('style', 'background-image:'+url);
            var d = document.createElement('div');
            a.appendChild(d);
            d.setAttribute('class', 'status');
            s.replaceChild(a,s.children[i]);
        }
    });
})();