Created
February 22, 2025 02:47
-
-
Save Rainboylvx/7dec3b8100f53ecee56708ca1d7a269d to your computer and use it in GitHub Desktop.
NJU-计算机解决问题-替换链接-油猴脚本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name NJU-计算机解决问题-替换链接 | |
// @namespace https://github.com/rainboylvx | |
// @version 0.1 | |
// @description 将http://114.212.10.6/开头的链接替换为http://cslabcms.nju.edu.cn/ | |
// @author rainboy ([email protected]) | |
// @match http://cslabcms.nju.edu.cn/problem_solving/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// 获取页面中所有的链接 | |
const links = document.querySelectorAll('a[href^="http://114.212.10.6/"]'); | |
links.forEach(link => { | |
// 替换链接 | |
link.href = link.href.replace('http://114.212.10.6/', 'http://cslabcms.nju.edu.cn/'); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment