您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
为导航栏新添加一个最新发表标签
当前为
// ==UserScript== // @name MT论坛 // @namespace http://tampermonkey.net/ // @description 为导航栏新添加一个最新发表标签 // @version 0.3.1 // @author MT-戒酒的李白染 // @icon https://bbs.binmt.cc/favicon.ico // @match *://bbs.binmt.cc/* // @grant none // ==/UserScript== (function() { 'use strict'; var ele = document.createElement('li'); var url = window.location.href; ele.id = "latest_publication" ele.innerHTML = '<a href="https:\/\/bbs.binmt.cc\/forum.php?mod=guide&view=newthread" hidefocus="true" title="最新发表">最新发表<\/a>'; document.getElementsByClassName("wp comiis_nvbox cl")[0].children[1].appendChild(ele); if(url=='https:\/\/bbs.binmt.cc\/forum.php?mod=guide&view=newthread') { ele.style.cssText='background: url("https:\/\/cdn2.bbs.binmt.cc\/template\/comiis_mi\/img\/nv_a.png") repeat-x 50% -50px;'; } function ownurl(){ if(window.location.href.match('bbs.binmt.cc/thread')) { if(document.getElementsByClassName('locked').length!=0){ try{ //console.log('开启url转换'); var a = document.getElementsByClassName("showhide")[0].innerHTML; var b = a.replace(/\s/g,''); var d = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/; var e = b.match(d)[0]; var c = '<a target="_blank" href="'+e+'" style="text-decoration:none;border: 1px solid #e74c3c;color: #c0392b;">'+e+'</a>'; var f = '="'+e+'"' var g = b.match(f); if(g) { return }else{ document.getElementsByClassName("showhide")[0].innerHTML = a.replace(e,c); } }catch(err){ return } }else{ var h = document.getElementsByClassName("t_f")[0].innerHTML; var i = h.replace(/\s/g,''); var j = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/ var k = i.match(j)[0]; var l = '<a target="_blank" href="'+k+'" style="text-decoration:none;border: 1px solid #e74c3c;color: #c0392b;">'+k+'</a>'; var m = '="'+k+'"' var n = i.match(l); var o = i.match(m) if(o) { return }else{ document.getElementsByClassName("t_f")[0].innerHTML = document.getElementsByClassName("t_f")[0].innerHTML.replace(k,l); } } }else{ return } } ownurl(); })();