您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Download Studydrive documents
当前为
// ==UserScript== // @name Studydrive Downloader // @namespace http://tampermonkey.net/ // @version 2024-09-24 // @description Download Studydrive documents // @author You // @match https://www.studydrive.net/*/doc/* // @icon https://www.google.com/s2/favicons?sz=64&domain=studydrive.net // @grant GM_download // @license MIT // ==/UserScript== (function() { 'use strict'; async function download() { if(!PDFView.pdfDocument.getData) { alert("ERROR: Could not get pdf data, maybe the mechanics have changed"); } const blobData = await PDFView.pdfDocument.getData(); const blobUrl = await URL.createObjectURL(new Blob([blobData], { type: "application/pdf" })); let fileName; try { fileName = document.querySelector("#main-container h1").textContent; } catch { fileName = "document.pdf"; // Fallback name } GM_download(blobUrl, fileName); } function setupDownloadButton() { const downloadButton = document.querySelector("button[data-specific-auth-trigger=download]"); if (downloadButton) { // Replace original download button with copy so that we get rid of the original click listeners const buttonCopy = downloadButton.cloneNode(true); downloadButton.parentNode.replaceChild(buttonCopy, downloadButton); buttonCopy.addEventListener('click', download); } } setupDownloadButton(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址