nefu cleaner

将jwc*.nefu恶心的js超链接转换成正常的超链接,将弹出小窗改为新标签页,提供showModalDialog支持

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name       nefu cleaner
// @version    0.0.3
// @namespace nefu.edu.cn
// @description  将jwc*.nefu恶心的js超链接转换成正常的超链接,将弹出小窗改为新标签页,提供showModalDialog支持
// @include      http://jwcnew.nefu.edu.cn/*
// @include      http://jwc.nefu.edu.cn/*
// @require      http://code.jquery.com/jquery-2.1.1.min.js
// @grant        unsafeWindow
// @license  GPL v3
// ==/UserScript==

function isURL(x){
    if(window.location.href.indexOf(x)!=-1){
    	return true;
    }else{
     	return false;
    }
}

if(isURL("jwcnew.nefu.edu.cn")){
    $('a').each(function() {this.href=this.href.replace(/^javascript:JsMod\(\'(.+)\',.+,.+\)$/g,"$1");});
}else if(isURL("jwc.nefu.edu.cn")){
    $('a').each(function() {this.href=this.href.replace(/^javascript:xiazai\(\'(.+)\'\)$/g,"$1");});
    $('a').each(function() {this.href=this.href.replace(/^javascript:buttonToUrl\(\'(.+)\'\)$/g,"$1");});
    $('a').each(function() {this.href=this.href.replace(/^javascript:buttonToOpenUrl\(\'(.+)\'\)$/g,"$1");});
}
unsafeWindow.showModalDialog=function(url){window.open(url);};
Object.defineProperty(window,"showModalDialog",{get:function(url){window.open(url);},configurable:false,enumerable:true});