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

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

// ==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://gf.qytechs.cn/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()
  }
})

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址