您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
智慧教育平台(教材下载)
// ==UserScript== // @name 智慧教育平台_教材下载 // @version 0.1.6 // @description 智慧教育平台(教材下载) // @author Codewyx // @match *basic.smartedu.cn/tchMaterial/detail* // @match *zxx.edu.cn/tchMaterial/detail* // @icon https://basic.smartedu.cn/favicon.ico // @license MIT // @grant none // @namespace https://greasyfork.org/users/809727 // ==/UserScript== (function () { function extractString(str) { const regex = /\?file=(.*?)&headers/; const match = str.match(regex); if (match) { return match[1]; // 返回?file=和&headers之间的内容 } return null; // 如果没有找到匹配的内容 } window.onload = () => { var interval = setInterval( function () { const modalContents = document.querySelectorAll(".fish-modal-confirm-content"); modalContents.forEach(modalContent => { if (modalContent.textContent.includes("需要登录才可以查看,是否登录?")) { modalContent.innerHTML="需要登录才可以查看,是否登录?<br/><p style=\"color:red\">登录后才可以使用插件下载课本!</p>" }}) const src = document.getElementById("pdfPlayerFirefox").src; const url = new URL(src); result = extractString(url.search).replace(/-private/g, ''); document.querySelector(".web-breadcrumb").innerHTML += ` <script> </script> <br> <label onclick="window.open('`+ result + `')" id="but_1" class="fish-radio-tag-wrapper fish-radio-tag-wrapper-checked"><span class="fish-radio-tag fish-radio-tag-checked"><span class="fish-radio-tag-inner"></span></span><span>获取教材直链</span></label> `; // <a download="https://r2-ndr.ykt.cbern.com.cn/edu_product/esp/assets_document/`+getQueryString('contentId')+`.pkg/pdf.pdf" target="_blank"><label id="but_2" class="fish-radio-tag-wrapper fish-radio-tag-wrapper-checked"><span class="fish-radio-tag fish-radio-tag-checked"><span class="fish-radio-tag-inner"></span></span><span>下载PDF</span></label></a> if (document.querySelector("#but_1") != null) { clearInterval(interval); return; } }, 1000); } // })();