🏠 Home 

电子科大信软学院 - 修正附件下载文件名

让电子科大信软学院网站里的附件在下载时显示正确的文件名


安装此脚本?
// ==UserScript==
// @name 电子科大信软学院 - 修正附件下载文件名
// @description 让电子科大信软学院网站里的附件在下载时显示正确的文件名
// @version 4
// @match http://www.is.uestc.edu.cn/news.do
// @match http://www.is.uestc.edu.cn/notice.do
// @grant none
// @supportURL https://github.com/whtsky/userscripts/issues
// @namespace https://greasyfork.org/users/164794
// ==/UserScript==
const attachmentRe = /附件\d+[-:](.+)$/
document.querySelectorAll('.text a').forEach(anchor => {
const match = anchor.innerText.match(attachmentRe)
if (match) {
anchor.download = match.pop().trim()
}
})