// ==UserScript== // @name 磁力链文本变链接 // @namespace https://greasyfork.org/zh-CN/scripts/445899 // @version 1.2 // @description 点击magnet协议文本变为超链接 // @author dwpublic // @include http://* // @include https://* // @grant none // @run-at document-end // @license MIT // @downloadURL none // ==/UserScript== (function() { document.onclick = function(e) { var link = /((magnet?:)(\.|\w|-|#|\?|=|\/|\+|@|%|&|:|;|!|\*|(?![\u4e00-\u9fa5\s*\n\r'"]))+)/g; if (!e.target.innerHTML.match(/$1'); } }; })();