您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add Com-to-Com link between user and comment user for every comment.
当前为
// ==UserScript== // @name MyAnimeList(MAL) - Com-to-Com Links // @version 1.1.9 // @description Add Com-to-Com link between user and comment user for every comment. // @author Cpt_mathix & N_Ox // @match *://myanimelist.net/profile* // @match *://myanimelist.net/comments* // @exclude *://myanimelist.net/profile/*/* // @grant none // @namespace https://greasyfork.org/users/16080 // ==/UserScript== if (document.location.href.indexOf('profile') > -1) { var element = document.getElementById('lastcomment').getElementsByTagName('a'); for (var i = 0; i < element.length; i++) { if (element[i] && element[i].innerHTML.indexOf("All Comments") > -1) { comtocom(element[i].href); break; } } } else { comtocom(document.location.href); } function comtocom(url) { url = url.replace(/&*show=\d*/g, ""); var i = url.indexOf('id='); if (i == -1) return; url = '/comtocom.php?id1=' + url.substr(i + 3) + '&id2='; if (document.location.href.indexOf('profile') > -1) { document.querySelectorAll('div[id^=comBox]').forEach(function (el) { if (el.getElementsByClassName('postActions ar mt4').length !== 0) { return; } var avatar = el.querySelector('img'); if (!avatar) return; var id = avatar.src || avatar.dataset.src; if (id.indexOf('userimages/') < 0) return; id = id.split("?")[0].replace(/\D+/g, ''); var div = document.createElement('div'); div.className = 'postActions ar mt4 mr12'; var link = document.createElement('a'); link.href = url + id; link.innerHTML = "Conversation"; div.appendChild(link); el.appendChild(div); }); } else { // console.log(document.querySelectorAll('div[id^=comBox] > table > tbody > tr')); // console.log(document.querySelectorAll('div[id^=comBox]')); document.querySelectorAll('div[id^=comBox] > table > tbody > tr').forEach(function (el) { var avatar = el.querySelector('.picSurround img'); if (!avatar) return; var com = el.querySelector('div[id^=com]:not([id^=comtext])'); if (!com) return; if (com.children.length == 3) return; var id = avatar.src || avatar.dataset.src; if (id.indexOf('userimages/') < 0) return; id = id.split("?")[0].replace(/\D+/g, ''); com.insertAdjacentHTML("beforeend", '<div style="margin-top:10px" align="right"><a href="' + url + id + '" title="Comment-to-Comment">Conversation</a></div>'); }); } }