// ==UserScript== // @author Hunlongyu // @name 『净网卫士』 吾爱破解论坛 // @namespace https://github.com/Hunlongyu // @icon https://i.loli.net/2019/04/22/5cbd720718fdb.png // @description 移除广告,精简页面。新增论坛后台自动签到。 // @version 0.3.2 // @include *://*.52pojie.cn/* // @grant GM_addStyle // @run-at document-start // @supportURL https://gist.github.com/Hunlongyu/5eef950d53b733dd67abda224ebed238 // @note 2019/06/27 新增自动签到。 // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Your code here... const css = ` /* 页面背景 */ body{ background: none !important } /* 顶部工具条 */ #toptb{ display: none !important; } /* 版规 */ .bml{ display: none; } /* 帖内广告:水平 + 竖直 */ .dnch_eo_pt, .dnch_eo_pr{ display: none !important; } /* 用户签名 + 签名下的提示 */ .sign, .dnch_eo_pb{ display: none !important; } /* 底部免责声明 */ .res-footer-note{ display: none !important; } /* 底部广告 */ .dnch_eo_f{ display: none !important; } /* 回帖框背景图 */ #f_pst #fastpostmessage{ background: none !important } ` try { GM_addStyle(css) } catch(e) { console.log('脚本失效,刷新后重试。', e) } const p = { befor: 'qds.png', after: 'wbs.png', afterImg: '', ajax: 'home.php?mod=task&do=apply&id=2', hide: `.qq_bind{ display: none }`, show: `.qq_bind{ display: inline-block }`, repeat: '本期您已申请过此任务', success: '任务已完成' } window.onload = function() { const imgDom = document.querySelector('.qq_bind') const img = imgDom.src.substring(imgDom.src.length - 7) if (img === p.after) { console.log('『净网卫士』 已经签到完毕!') return false; } if (img === p.befor) { console.log('『净网卫士』 尝试自动签到中……') GM_addStyle(p.hide) const a = new Ajax() a.getHTML(p.ajax, function(res) { if (res.indexOf(p.success) > 0 || res.indexOf(p.repeat) > 0) { imgDom.parentNode.outerHTML = p.afterImg GM_addStyle(p.show) console.log('『净网卫士』 自动签到成功!') } else { console.log('『净网卫士』 自动签到失败,请手动签到!') } }) } } })(); // ==UserScript== // @author Hunlongyu // @name 『净网卫士』 Krunker 汉化版 // @namespace https://github.com/Hunlongyu // @icon https://i.loli.net/2019/04/22/5cbd720718fdb.png // @description 翻译为中文,精简页面。 // @version 0.0.1 // @include https://krunker.io/* // @grant GM_addStyle // @run-at document-end // @supportURL https://gist.github.com/Hunlongyu/5c169b8ac288ca415e7068938a0fb47a // @note 2019/06/20 v0.1.2 初始化,完成基础功能。 // ==/UserScript== (function () { 'use strict' const css = ` * { font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,SimSun,sans-serif; } ` GM_addStyle(css) // HEAD document.getElementById('signedOutHeaderBar').innerHTML = document.getElementById('signedOutHeaderBar').innerHTML .replace(/>Login登录<') .replace(/>Register注册<') // MENU document.getElementById('menuItemContainer').innerHTML = document.getElementById('menuItemContainer').innerHTML .replace(/>Profile个人中心<') .replace(/>Shop商城<') .replace(/>Social社交<') .replace(/>Maps地图<') .replace(/>Mods模组<') .replace(/>Settings设置<') let globalTimer = null // 全局定时器:用于监控全局弹框 let headerLoopArray = ['Custom Maps'] // 数组内弹框需要循环翻译 // 菜单点击事件:触发全局定时器 let menuItems = document.querySelectorAll('.menuItem') for (let i = 0; i < menuItems.length; i++) { menuItems[i].addEventListener('click', function () { let header = document.getElementById('windowHeader').innerHTML let inOf = headerLoopArray.indexOf(header) if (inOf < 0) { globalModal(header) } else { globalLoopModal(header) } }) } function timerEvent () { globalTimer = setInterval(() => { let flag = document.getElementById('windowHolder').style.display let newHeader = document.getElementById('windowHeader').innerHTML if (flag === 'none') { clearInterval(globalTimer) return false } console.log(oldHeader, newHeader) if (flag === 'block' && oldHeader === newHeader ) { clearInterval(globalTimer) globalWindowHolder(newHeader) } else { loopModal(newHeader) } }, 50) } function loopModal (e) { console.log(e) if (e === 'Custom Maps') { // 地图 document.getElementById('windowHolder').innerHTML = document.getElementById('windowHolder').innerHTML .replace(/>Map Editor地图编辑器<') .replace(/>Publish Map发布地图<') .replace(/>Map Community地图社区<') .replace(/>Hot热门<') .replace(/>New最新<') .replace(/>Favorites最爱<') .replace(/>My Maps我的地图<') .replace(/>Search搜索<') .replace(/>No Maps found没有发现地图<') return false } } // 全局弹出框事件:翻译弹框文本 function globalModal (e) { if (e === 'Account') { // 个人中心 document.getElementById('windowHolder').innerHTML = document.getElementById('windowHolder').innerHTML .replace(/>Name名字<') .replace(/>Clan家族<') .replace(/>None无<') .replace(/>Level等级<') .replace(/>Score积分<') .replace(/>KRKR币<') .replace(/>Kills击杀<') .replace(/>Deaths死亡<') .replace(/>KDR击杀死亡比<') .replace(/>Games Played游戏次数<') .replace(/>Games Won胜利次数<') .replace(/>W\/L胜利失败比<') .replace(/>Time Played游戏时长<') .replace(/>Logout退出账号<') return false } if (e === 'Store') { // 商城 document.getElementById('windowHolder').innerHTML = document.getElementById('windowHolder').innerHTML .replace(/>Prize Wheels抽奖转盘<') .replace(/>Unlock new weapon skins and items解锁新的武器皮肤和物品<') .replace(/>By purchasing you agree to the 购买即表示您同意<') .replace(/>Terms本条款<') .replace(/>Purchase KR充值 KR<') .replace(/> Any 所有 <') .replace(/> Snipers Only! 狙击手 <') .replace(/> Outfits Only! 服装 <') .replace(/>Popular!流行<') .replace(/>Off折扣<') .replace(/ in account/g, '') return false } if (e === 'Mod Manager') { // mod document.getElementById('windowHolder').innerHTML = document.getElementById('windowHolder').innerHTML .replace(/>Mod Guidemod使用说明(英文版)<') .replace(/>Mods Listmod列表<') .replace(/>Publish Mod发布mod<') .replace(/>Viewer查看<') return false } } })()