您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
饭否上转发消息时避免at到自己
当前为
// ==UserScript== // @name Fanfou Forward Without Mentioning Myself // @version 1.0.4 // @author HackMyBrain // @description 饭否上转发消息时避免at到自己 // @include http://fanfou.com/* // @namespace https://gf.qytechs.cn/users/2844 // ==/UserScript== (function (){ var mylink = document.querySelector('#navigation ul > li:nth-of-type(2) > a'); try{ var fw_textarea = document.getElementById('PopupForm').getElementsByTagName('textarea')[0]; } catch(err) { return; } var fwReplacer = function (e){ if ( e.target.tagName.toLowerCase() === 'a' && e.target.className === 'repost' ){ var text = e.target.getAttribute('text'); var fw_nickname = text.match(/@\S+/)[0]; var content = e.target.parentElement.parentElement.getElementsByClassName('content')[0]; var context_text = ' '; var content_child; for(var i = 0; i < content.childNodes.length; i++){ content_child = content.childNodes[i]; if ( content_child.nodeType === 3 || content_child.tagName.toLowerCase() === 'strong' || content_child.className === 'former' || content_child.className === 'nickquery' || ( !!content_child.href && content_child.href.indexOf('http://fanfou.com/q/') === 0 ) ) { if ( content_child.className === 'former' && content_child.href === mylink.href ) { context_text += content_child.textContent + '\n'; } else { context_text += content_child.textContent; } } else if ( content_child.getAttribute('rel') === 'nofollow' ){ context_text += content_child.getAttribute('title'); } } setTimeout(function(){ if ( e.target.parentElement.getElementsByClassName('delete').length != 0 ) { fw_textarea.value = ('转' + fw_nickname + '\n' + context_text).replace(/\n\x20/g,'\n'); } else { fw_textarea.value = ('转' + fw_nickname + context_text).replace(/\n\x20/g,'\n'); } },30); setTimeout(function(){fw_textarea.setSelectionRange(0,0)}, 60); } } document.addEventListener('click', fwReplacer, false);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址