CNKI PDF Download

中国知网 PDF 下载

安裝腳本?
作者推薦腳本

您可能也會喜歡 Katakana Terminator

安裝腳本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        CNKI PDF Download
// @description 中国知网 PDF 下载
// @author      Arnie97
// @version     2020.10.20
// @license     MIT
// @grant       none
// @namespace   https://github.com/Arnie97
// @homepageURL https://github.com/Arnie97/cnki-pdf
// @supportURL  https://greasyfork.org/scripts/368399
// @include     *://*/detail/detail.aspx*
// ==/UserScript==

((_, $) => {
    if (!_.title.endsWith('中国知网')) {
        return;
    }

    $('ul.operate-btn>li>a:first-child').forEach(i => {
        if (!i.text.includes('整本下载')) {
            return;
        }
        i.innerHTML = '<i></i> CAJ 下载';
        let li = i.parentNode;
        li.parentNode.insertBefore(li.cloneNode(true), li.nextSibling);

        i.innerHTML = '<i></i> PDF 下载';
        i.href = i.href.replace('nhdown', 'pdfdown');

        // change the button icon
        li.classList.add('btn-dlpdf');
        li.classList.remove('btn-dlcaj');
    });
})(document, selector => Array.from(document.querySelectorAll(selector)));