您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Show Pixiv ID of the artist under nickname in the illustration page
// ==UserScript== // @name Show Artist Pixiv ID // @namespace https://gf.qytechs.cn/en/users/37676 // @description Show Pixiv ID of the artist under nickname in the illustration page // @match *://*.pixiv.net/*/artworks/* // @run-at document-end // @version 1.0.9 // @grant none // @license Creative Commons Attribution 4.0 International Public License; http://creativecommons.org/licenses/by/4.0/ // ==/UserScript== let pageObserver = null; const nextData = document.querySelector('#__NEXT_DATA__'); if (nextData && !pageObserver) { try { const nextJson = JSON.parse(nextData.text); const illustID = nextJson?.query?.id; if (illustID) { fetch('https://www.pixiv.net/ajax/illust/' + illustID) .then(function(response) { return response.json(); }) .then(function(json) { const userID = json?.body?.userId; const userName = json?.body?.userName; const userAccount = json?.body?.userAccount; if (userID && userName && userAccount) { if (!pageObserver) { pageObserver = new MutationObserver(function(mutations) { const profileElement = document.querySelectorAll('a[href*="/users/'+userID+'"]'); if (profileElement.length > 0) { for (let i=0; i < profileElement.length; i++) { const imageElement = profileElement[i].querySelectorAll('div[role*="img"]'); if (imageElement.length > 0) { for (let j=0; j < imageElement.length; j++) { const parentElement = imageElement[j].parentElement; if (parentElement) { const nextElement = parentElement.nextElementSibling; if (nextElement) { if (nextElement.innerHTML.indexOf(userAccount) < 0) { if (parentElement.innerHTML.indexOf(userName) < 0) { nextElement.innerHTML += '<div>'+userName+'</div>'; } nextElement.innerHTML += '<div>'+userAccount+'</div>'; } } } } } } } }); pageObserver.observe(document.querySelector('#__next'), { childList: true, subtree: true }); } } }); } } catch(e) { } }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址