您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Link IPFS hashes to the IPFS gateway
当前为
// ==UserScript== // @name IPFS Hash Linker // @namespace IPFS Hash Linker // @description Link IPFS hashes to the IPFS gateway // @version 1.0 // @include * // ==/UserScript== text = document.body.innerHTML; if (text.match(/([^A-Za-z0-9/"]|ipfs\/)Qm[A-HJ-NP-Za-km-z1-9]{44,45}[^A-Za-z0-9"]/)) { document.body.innerHTML = text.replace(/(<[^<]*[^A-Za-z0-9/"])(\/?ipfs\/)?(Qm[A-HJ-NP-Za-km-z1-9]{44,45})([^A-Za-z0-9?%"]...)/g,function(matchedString,preHash,path,hash,postHash){ if(typeof path == "undefined") { // Sometimes there's no leading /ipfs/ path = "/ipfs/"; } if(matchedString.match(/^<(textarea|input|pre|code)/i) || postHash=="</a>") { // Make no change inside links or in other weird environments. return preHash+path+hash+postHash; } else { // Otherwise put it in a link. return preHash+"<a href=\"https://gateway.ipfs.io/ipfs/"+hash+"\">"+path+hash+"</a>"+postHash; } }); } // Tips: 1NT9pxhDcPfsFhnrVoehxiUZ7HCC3gnsn3 // Based on the "Bitcoin Tool" userscript: // http://userscripts.org/scripts/show/104381 // This is public domain code, free for commercial and non-commercial use. // If you use some of it, give a link to this script.
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址