// ==UserScript== // @name 综合文库网绕过收费下载文档免费下载文档 // @namespace 综合文库网 1.0 // @version 1.0 // @description 绕过收费 // @author LZJ // @match *www.cmpx.com.cn/jingdianfanwen/* // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { console.log('123') let pattern = /(\d+)/ig; //定义正则表达式 let url = window.location.pathname document.getElementsByClassName("word-pic")[0].children[0].href = 'https://www.cmpx.com.cn/plus/d.php?id='+url.match(pattern)[0] })();