// ==UserScript== // @name 第一范文网绕过收费下载文档免费下载文档 // @namespace 第一范文网 1.1 // @version 1.3 // @description 绕过收费,支持网站:www.diyifanwen.com和www.diyifanwen.net // @author LZJ // @match *www.diyifanwen.net/* // @match *s.diyifanwen.com/down/down.asp?url=* // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { if (window.location.host == 'www.diyifanwen.net' || window.location.host == 'www.77cn.com.cn') { let pattern = /(\d+)/ig; //定义正则表达式 let url = window.location.pathname document.getElementsByClassName("word-pic")[0].children[0].href = 'https://www.diyifanwen.net/plus/word.php?id=' + url.match(pattern)[0] document.getElementsByClassName("word-pic")[1].children[0].href = 'https://www.diyifanwen.net/plus/word.php?id=' + url.match(pattern)[0] } if (window.location.host == 's.diyifanwen.com') { $.cookie(cookiename, cookievalue, { expires: expires, path: '/', domain: 'diyifanwen.com' }); $('.webchat-dyfw').hide(); if (document.body.id == 'downdoc') { alert('验证成功,请点击下载按钮进行下载'); $.removeCookie('downfile', { path: '/', domain: 'diyifanwen.com' }); } else if ($.cookie('down-guoxue-file') != undefined) { alert('验证成功,请点击下载按钮进行下载'); document.location = $.cookie('down-guoxue-file'); $.removeCookie('down-guoxue-file', { path: '/', domain: 'diyifanwen.com' }); } else { alert('验证成功,请进行复制'); } } })();