Greasy Fork

Greasy Fork is available in English.

ResearchGate下载PDF

打开ResearchGate下载PDF页面

当前为 2024-09-30 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         ResearchGate下载PDF
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  打开ResearchGate下载PDF页面
// @author       HuanZhi
// @match        https://www.researchgate.net/*
// @grant        unsafewindow
// @license      MIT
// @run-at       document-end
// ==/UserScript==
(function(){
    //添加按钮显示
    AddDownloadButton()
}
)();

// 下载按钮
function AddDownloadButton(){
    var download_btn = document.createElement("button");
    download_btn.setAttribute('style', "position:absolute; z-index:1000; right:10px; top:55px; height:28px; background-color:#3E8CD0; border:none; color:white; font-size:16px; cursor:pointer; border-radius:1em;");
    download_btn.setAttribute('id', "download_btn");
    download_btn.textContent = '输入关键词';
    document.body.appendChild(download_btn);
    download_btn.onmouseover = function() {
        this.style.backgroundColor="#e9686b";
    };
    download_btn.onmouseout = function() {
        this.style.backgroundColor="#3E8CD0";
    };
    download_btn.onclick = startSearchQueue;
    
    // 监听滚动事件,更新按钮位置
    window.addEventListener('scroll', function() {
        // 更新按钮的top位置
        download_btn.style.top = window.pageYOffset + 55 + 'px';
    });
}

// Function to display the prompt and start the search
function startSearchQueue() {
        const keywords = prompt("输入关键词,逗号分割:");
        if (keywords) {
            const keywordArray = keywords.split(',').map(k => k.trim());
            
            // 循环遍历所有链接
            keywordArray.forEach(function(keyword) {
                // 新标签页打开链接
                window.open("https://www.researchgate.net/search.Search.html?query=", keyword, "&type=publication", '_blank');

            });
        }
    }