您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
解析CNKI论文PDF格式下载地址,论文搜索结果页面和硕博论文详述页面的caj格式下载链接替换为pdf格式下载链接
当前为
// ==UserScript== // @name 知网下载助手 // @namespace [email protected] // @version 1.3.0 // @description 解析CNKI论文PDF格式下载地址,论文搜索结果页面和硕博论文详述页面的caj格式下载链接替换为pdf格式下载链接 // @author wyn665817 // @match *://*.cnki.net/* // @include */brief.aspx* // @include */detail.aspx* // @run-at document-end // @grant unsafeWindow // @supportURL http://greasyfork.icu/zh-CN/scripts/371938/feedback // @license MIT // ==/UserScript== var $ = unsafeWindow.jQuery, url = location.pathname; String.prototype.dbcode = function() { return this.match(/dbcode=C[DM]FD&/i); }; String.prototype.dflag = function() { return this.replace(/&dflag=\w*|$/, '&dflag=pdfdown'); }; String.prototype.kcms = function() { return this.replace('kns', 'gb.oversea').replace('kns', 'kcms'); }; if (!$) { } else if (url.match(/brief\.aspx$/)) { $('.GridTableContent tr[bgcolor]').each(function() { var $dl = $('.briefDl_Y, .briefDl_D', this), href = ($dl[0] || {}).href || '#'; href = $('.fz14', this).attr('href').dbcode() ? href.kcms() : href; $dl.attr('href', href.dflag()); }); } else if (url.match(/detail\.aspx$/) && location.search.dbcode()) { $('.dllink > .icon').each(function() { var tip = $(this).text().trim(); if (tip == '整本下载') { this.href = this.href.kcms().dflag(); } else if (tip.match(/^分[页章]下载$/)) { this.href = this.href.kcms() + '&cflag=pdf'; } }); }