您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
替换ZJU各大办公网站的附件下载名称
// ==UserScript== // @name 智能下载名称 // @namespace https://www.zjucjh.com/ // @version 0.1.2 // @description 替换ZJU各大办公网站的附件下载名称 // @author ZJU帽子 // @match http://*.zju.edu.cn/* // @grant none // @compatible firefox >=52 // @compatible chrome >=55 // @license MIT // ==/UserScript== (function () { 'use strict'; const allA = document.getElementsByTagName("a"); for (let i = 0; i < allA.length; i++) { const a = allA[i]; if (a.target.length <= 0 && isFile(a.href)) { a.download = a.innerHTML; } } function isFile(href) { const l = href.length; const str = href.substring(l - 6, l); if (str.includes('.') && !str.includes('.htm') && !str.includes('.cn') && !str.includes('.com') && !str.includes('.org') && !str.includes('.net')) { return true } else { return false } } })();