// ==UserScript== // @name NCU Net // @version 3.0.0 // @description A campus network helper for Nanchang University // @author kidonng // @namespace https://github.com/kidonng/cherry // @match http://222.204.3.154/* // @match http://222.204.3.221/* // @match http://aaa.ncu.edu.cn/* // ==/UserScript== ;(() => { const config = { // Recommend not too low, or you may encounter "Status Internal Server Error" checkInterval: 5000, // Recommend >= 10s, NCUWLAN needs a 10s break between two login retryTimeout: 10000, } const msg = navigator.language === 'zh-CN' ? { loaded: 'NCU Net 加载成功', connected: '连接成功', failed: `连接失败,${config.retryTimeout / 1000} 秒后重试`, error: '连接异常,正在重连', online: '网络已连接', offline: '网络已断开', ...zh_CN, } : { loaded: 'Successfully loaded NCU Net', connected: 'Successfully connected', failed: `Failed to connect, retry in ${ config.retryTimeout / 1000 } sec(s)`, error: 'Connection error, reconnecting', online: 'Network is online', offline: 'Network is offline', ...en_US, } $('#notice-title, #notice-content').hide() const notice = $('.notice-heading') .after('