// ==UserScript== // @name 国家中小学智慧教育平台教材下载按钮 // @namespace https://greasyfork.org/zh-CN/scripts/450700 // @version 2.2 // @description 用于下载国家中小学智慧教育平台的教材 // @author 300g-BoHeYou // @match https://www.zxx.edu.cn/tchMaterial/* // @match https://basic.smartedu.cn/tchMaterial/* // @icon https://www.zxx.edu.cn/favicon.ico // @license MIT // @grant GM_download // @grant GM_log // @downloadURL none // ==/UserScript== (function() { 'use strict'; setTimeout(function(){ var download = document.getElementsByClassName("index-module_info_evO1d")[0]; var download_div = document.createElement("div"); download.appendChild(download_div); download_div.style = 'width:150px;text-align:right;'; download_div.innerHTML = '下载pdf'; document.getElementsByClassName("downloadbtn")[0].onclick = function(){ window.open(performance.getEntriesByType('resource').filter(entry =>{return /viewer\.html/.test(entry.name);})[0].name) GM_log(performance.getEntriesByType('resource').filter(entry =>{return /viewer\.html/.test(entry.name);})[0].name); // GM_download({ // url:performance.getEntriesByType('resource').filter(entry =>{return /viewer\.html/.test(entry.name);})[0].name, // name:"pdf.pdf", // saveAs: true // }) }; },2000); })();